diff --git a/contrib/texinfo/COPYING b/contrib/texinfo/COPYING index eeb586b392a5..d60c31a97a54 100644 --- a/contrib/texinfo/COPYING +++ b/contrib/texinfo/COPYING @@ -1,340 +1,340 @@ GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 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. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed 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 programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - Copyright (C) 19yy + Copyright (C) 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. diff --git a/contrib/texinfo/COPYING.DOC b/contrib/texinfo/COPYING.DOC new file mode 100644 index 000000000000..b42936beb35d --- /dev/null +++ b/contrib/texinfo/COPYING.DOC @@ -0,0 +1,355 @@ + GNU Free Documentation License + Version 1.1, March 2000 + + Copyright (C) 2000 Free Software Foundation, Inc. + 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. + + +0. PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +written document "free" in the sense of freedom: to assure everyone +the effective freedom to copy and redistribute it, with or without +modifying it, either commercially or noncommercially. Secondarily, +this License preserves for the author and publisher a way to get +credit for their work, while not being considered responsible for +modifications made by others. + +This License is a kind of "copyleft", which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + + +1. APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work that contains a +notice placed by the copyright holder saying it can be distributed +under the terms of this License. The "Document", below, refers to any +such manual or work. Any member of the public is a licensee, and is +addressed as "you". + +A "Modified Version" of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A "Secondary Section" is a named appendix or a front-matter section of +the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall subject +(or to related matters) and contains nothing that could fall directly +within that overall subject. (For example, if the Document is in part a +textbook of mathematics, a Secondary Section may not explain any +mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The "Invariant Sections" are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. + +The "Cover Texts" are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. + +A "Transparent" copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, whose contents can be viewed and edited directly and +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup has been designed to thwart or discourage +subsequent modification by readers is not Transparent. A copy that is +not "Transparent" is called "Opaque". + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input format, SGML +or XML using a publicly available DTD, and standard-conforming simple +HTML designed for human modification. Opaque formats include +PostScript, PDF, proprietary formats that can be read and edited only +by proprietary word processors, SGML or XML for which the DTD and/or +processing tools are not generally available, and the +machine-generated HTML produced by some word processors for output +purposes only. + +The "Title Page" means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, "Title Page" means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + + +2. VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + + +3. COPYING IN QUANTITY + +If you publish printed copies of the Document numbering more than 100, +and the Document's license notice requires Cover Texts, you must enclose +the copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a publicly-accessible computer-network location containing a complete +Transparent copy of the Document, free of added material, which the +general network-using public has access to download anonymously at no +charge using public-standard network protocols. If you use the latter +option, you must take reasonably prudent steps, when you begin +distribution of Opaque copies in quantity, to ensure that this +Transparent copy will remain thus accessible at the stated location +until at least one year after the last time you distribute an Opaque +copy (directly or through your agents or retailers) of that edition to +the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. + + +4. MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +A. Use in the Title Page (and on the covers, if any) a title distinct + from that of the Document, and from those of previous versions + (which should, if there were any, be listed in the History section + of the Document). You may use the same title as a previous version + if the original publisher of that version gives permission. +B. List on the Title Page, as authors, one or more persons or entities + responsible for authorship of the modifications in the Modified + Version, together with at least five of the principal authors of the + Document (all of its principal authors, if it has less than five). +C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. +D. Preserve all the copyright notices of the Document. +E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. +F. Include, immediately after the copyright notices, a license notice + giving the public permission to use the Modified Version under the + terms of this License, in the form shown in the Addendum below. +G. Preserve in that license notice the full lists of Invariant Sections + and required Cover Texts given in the Document's license notice. +H. Include an unaltered copy of this License. +I. Preserve the section entitled "History", and its title, and add to + it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. If + there is no section entitled "History" in the Document, create one + stating the title, year, authors, and publisher of the Document as + given on its Title Page, then add an item describing the Modified + Version as stated in the previous sentence. +J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and likewise + the network locations given in the Document for previous versions + it was based on. These may be placed in the "History" section. + You may omit a network location for a work that was published at + least four years before the Document itself, or if the original + publisher of the version it refers to gives permission. +K. In any section entitled "Acknowledgements" or "Dedications", + preserve the section's title, and preserve in the section all the + substance and tone of each of the contributor acknowledgements + and/or dedications given therein. +L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. +M. Delete any section entitled "Endorsements". Such a section + may not be included in the Modified Version. +N. Do not retitle any existing section as "Endorsements" + or to conflict in title with any Invariant Section. + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section entitled "Endorsements", provided it contains +nothing but endorsements of your Modified Version by various +parties--for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + + +5. COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections entitled "History" +in the various original documents, forming one section entitled +"History"; likewise combine any sections entitled "Acknowledgements", +and any sections entitled "Dedications". You must delete all sections +entitled "Endorsements." + + +6. COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. + + +7. AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, does not as a whole count as a Modified Version +of the Document, provided no compilation copyright is claimed for the +compilation. Such a compilation is called an "aggregate", and this +License does not apply to the other self-contained works thus compiled +with the Document, on account of their being thus compiled, if they +are not themselves derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one quarter +of the entire aggregate, the Document's Cover Texts may be placed on +covers that surround only the Document within the aggregate. +Otherwise they must appear on covers around the whole aggregate. + + +8. TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License provided that you also include the +original English version of this License. In case of a disagreement +between the translation and the original English version of this +License, the original English version will prevail. + + +9. TERMINATION + +You may not copy, modify, sublicense, or distribute the Document except +as expressly provided for under this License. Any other attempt to +copy, modify, sublicense or distribute the Document is void, and will +automatically terminate your rights under this License. However, +parties who have received copies, or rights, from you under this +License will not have their licenses terminated so long as such +parties remain in full compliance. + + +10. FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +http://www.gnu.org/copyleft/. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. + + +ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + + Copyright (c) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + A copy of the license is included in the section entitled "GNU + Free Documentation License". + +If you have no Invariant Sections, write "with no Invariant Sections" +instead of saying which ones are invariant. If you have no +Front-Cover Texts, write "no Front-Cover Texts" instead of +"Front-Cover Texts being LIST"; likewise for Back-Cover Texts. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. diff --git a/contrib/texinfo/ChangeLog b/contrib/texinfo/ChangeLog index 126d1fca4637..49cd802867c8 100644 --- a/contrib/texinfo/ChangeLog +++ b/contrib/texinfo/ChangeLog @@ -1,6636 +1,10490 @@ -1999-09-28 Karl Berry +2002-03-04 - * doc/texinfo.txi: New isbn. + * configure.ac: version 4.1. + * util/texi2dvi: version. - * configure.in, - util/texi2dvi: version 4.0. + * doc/texinfo.txi: @settitle is used in html output (from Eli), + various underfull hbox fixes. -1999-09-24 Karl Berry +2002-03-02 - * doc/texinfo.txi: Fixes from Oleg. + * configure.ac: pretest 4.0k -1999-09-20 Karl Berry + * info/info.c: declare add_file_to_directory to avoid warning. - * makeinfo/node.c: Don't write region at an anchor. - From: Thomas Esken + * doc/info-stnd.texi: info standalone so as not to collide with + `standards' in dir. - * info/terminal.c: Only set dumb terminal if tgetent returns < 0, - not 0. - For HP-UP 11. - From jeff.hull@state.co.us. +2002-03-01 Eli Zaretskii - * makeinfo/footnote.c: Don't translate the `Footnotes' string - according to LANG, it should be according to - @documentlanguage, which isn't implemented yet. - From: Jan Nieuwenhuizen + * makeinfo/insertion.c (end_insertion): Insert the /td and /tr + directives in lower case. From Per Bothner . - * doc/texinfo.txi: @end direntry from kama. + * makeinfo/macro.c (cm_alias): Ignore whitespace around the alias + name, like the manual promises. -1999-09-19 Karl Berry + * doc/texinfo.txi (Invoking Macros, Macro Details): Document that + commas in macro arguments don't work in TeX. Advise texi2dvi -e + when macros don't work with TeX. - * doc/texinfo.txi: \ninett is now \smalltt. + * doc/texinfo.txi (Node Line Requirements): Add restrictions about + parens and some punctuation characters in node names. + (Def Cmd Template): Document that macros are not expanded. - * doc/texinfo.txi: arnold changes + The following two changes allow to say "info foo" if there's an + Info file `foo' somewhere along INFOPATH. - 1999-09-03 Akim Demaille - * texi2dvi (getopt): batch has to be assigned `eval', not `echo'. - (bibtex): Launch BibTeX also when the LOG file complains that - there are no BBL file. + * info/info.c (add_file_directory_to_path): New function, code + moved from `main'. + (main): Use add_file_directory_to_path. - * doc/texinfo.txi: Document that @anchor ignores spaces. + * info/session.c (info_follow_menus): If the first menu entry + couldn't be found as an item in DIR's menu, try it as a file name. - * makeinfo/cmds.c (cm_shyph): remove, ­ is not supported in - browsers. - From: Thomas Esken + 2001-06-19 Mark Montague - * makeinfo/makeinfo.c: Don't crash if current_indent = 0. - From: Jan Nieuwenhuizen + * info/filesys.c: Fix for sparc64 (offsets should be "long"s). - * makeinfo/makeinfo.c: Avoid blank lines between @menu entries. - * configure.in: 3.12t + * info/session.c: Fix typos in function calls. - 1999-08-31 Eli Zaretskii - * info/info.c (info_short_help): Document --apropos. + 2001-08-23 Eli Zaretskii -1999-09-18 Karl Berry + * makeinfo/footnote.c (cm_footnote): Don't allow footnotes inside + footnotes. + (output_pending_notes): Increment already_outputting_pending_notes + in the HTML case as well, to protect execute_string from + recursively entering output_pending_notes. - * makeinfo/html.c (html_output_head): use text for , not - html markup. From François. - * makeinfo/makeinfo.c (text_expansion): new routine. - * makeinfo/cmds.c (cm_settitle): don't expand the title here, - we'll do it later. +2002-03-01 <karl@gnu.org> - * makeinfo/makeinfo.h (text_expansion): declare. + * doc/texinfo.tex: fix mismatched $'s for sake of emacs font-lock. + From: Stephen Gildea <gildea@stop.mail-abuse.org>. - * info/indices.c, - * info/infodoc.c, - * info/session.c, - * info/footnotes.c: translate errors. - * info/info.h: Use `' instead of "" in errors. +2002-02-27 <karl@gnu.org> -1999-09-06 Karl Berry <karl@gnu.org> + * configure.ac: pretest 4.0j. - +1999-08-24 Jan Nieuwenhuizen <janneke@gnu.org> - * makeinfo/node.c:cm_node: don't compare current_node when null. + * info/infodoc.c: 1scroll-forward typo. - 1999-08-23 W. L. Estes <will@fumblers.org> - * makeinfo/node.c (cm_node): write <a name=> tags even - ifusing --no-headers +2002-02-26 <karl@gnu.org> - * configure.in: ospeedlib -> trylib - From: Andreas Schwab <schwab@suse.de> + * lib/system.h [! ENABLE_NLS]: let's not go const. - * makeinfo/makeinfo.c (read_command): add explicit 0 to return if - enclosure command. From: Andreas Jaeger <aj@arthur.rhein-neckar.de>. +2002-02-26 Eli Zaretskii <eliz@is.elta.co.il> -1999-08-19 Karl Berry <karl@gnu.org> + * djgpp/config.sed: Add tweaking of file names in "install-info" + and "uninstall-info" targets. - * configure.in: add missing quotes, logic in new termcap library - check. + * doc/inf-stnd.texi (Custom Key Bindings, Invoking infokey): + Add footnotes about DOS file names. -1999-08-17 Karl Berry <karl@gnu.org> + * info/infokey.c (main) [__MSDOS__]: If HOME is not defined, + default to the current directory. - * makeinfo/multi.c, - * makeinfo/sectioning.c, - * makeinfo/node.c, - * makeinfo/macro.c: omit unused vars - * info/session.c (info_goto_invocation_node): omit unused decl. +2002-02-26 <karl@gnu.org> - * configure.in: Check for extra termlib variable necessary on - HP-UX 9. - From: Olaf Bachmann <obachman@mathematik.uni-kl.de> + * lib/system.h (LC_MESSAGES) [! LC_MESSAGES]: need this after all. - 1999-08-16 Andreas Schwab <schwab@suse.de> - * info/terminal.c (terminal_initialize_terminal): Try tcgetattr - and cfgetospeed in preference to TIOCGETP. - (original_tchars, original_ltchars): Define them only if needed. +2002-02-25 <karl@gnu.org> -1999-08-16 Karl Berry <karl@gnu.org> + * doc/info-stnd.texi: contents at top, avoid overfull hbox. + * lib/Makefile.am (libtxi_a_sources): include gettext.h. - * info/infodoc.c (create_internal_info_help_node): rename arg. - (info_find_or_create_help_window): avoid deref of null eligible. + * lib/system.h (LC_MESSAGES): don't need conditional, Bruno says + that locale.h or libintl.h does so. - * info/terminal.c (TIOCGETP, TIOCGETC, TIOCGLTC) [alpha && linux]: - #undef. Useless stubs are present. + * configure.ac: pretest 4.0i. -1999-08-15 Karl Berry <karl@gnu.org> + * dir-example: infokey. + * doc/info-stnd.texi: invoking infokey. + * info/infokey.c (short_help): reorganize slightly. - * info/nodes.c: Remove reference to nonexistent RFC for Info - files. + * lib/system.h: use "gettext.h" instead of <libintl.h> per gettext + 0.11 recommendation. -1999-08-11 Eli Zaretskii <eliz@is.elta.co.il> +2002-02-25 gettextize <bug-gnu-gettext@gnu.org> - * info/nodes.c (info_find_file_internal): If the file's contents - were gc'ed since last time it was loaded, reload the file. + * Makefile.am (SUBDIRS): Add intl. + * configure.ac (AC_CONFIG_FILES): Add intl/Makefile. -Wed Aug 11 06:42:47 1999 Karl Berry <karl@gnu.org> +2002-02-25 <karl@gnu.org> - * doc/Makefile.am (EXTRA_DIST): add txi-pt.tex from Lalo. + * util/Makefile.am (LDADD): + * makeinfo/Makefile.am (LDADD): + * info/Makefile.am (LDADD): @LIBINTL@ per gettextize. -Mon Aug 9 16:28:18 1999 Karl Berry <karl@gnu.org> + * configure.ac: gettextize changes. + * Makefile.am: gettextize changes. - * util/texi2dvi: Support preloaded texinfo.tex, from Stephen. +2002-02-25 gettextize <bug-gnu-gettext@gnu.org> - * makeinfo/makeinfo.c (add_char): restore ugly check for first - character being <. + * Makefile.am (SUBDIRS): Add m4. + (SUBDIRS): Remove intl. + (ACLOCAL_AMFLAGS): New variable. + (EXTRA_DIST): Add config.rpath. + * configure.ac (AC_CONFIG_FILES): Add m4/Makefile. + (AC_CONFIG_FILES): Remove intl/Makefile. - * makeinfo/cmds.c (cm_kbd): Increment in_fixed_width_font for - html. +2002-02-23 <karl@gnu.org> - * doc/texinfo.txi: effect not affect + * pretest 4.0h. - * makeinfo/makeinfo.c: Rearrange help. + * 2002-02-23 Eli Zaretskii <eliz@is.elta.co.il> + * doc/info-stnd.texi (Invoking Info): Add a reference to the + description of index-apropos and index-search. Document the + --raw-escapes option. + (Searching Commands): Describe index-search and index-apropos. - * makeinfo/toc.c: Cast %* arguments to (int) to placate gcc - -Wformat. + * info/man.c (clean_manpage): If raw_escapes_p is not set, remove + ANSI escape sequences from the man page. -Fri Aug 6 13:03:14 1999 Karl Berry <karl@gnu.org> + * info/info.h: Declare raw_escapes_p. - * util/install-info.c: Hardwire the File: dir, Node: top part of - the skeleton dir file. - Report from: Stanislav Brabec <utx@k332.feld.cvut.cz> + * info/info.c: <raw_escapes_p>: New variable. + New option --raw-escapes or -R. + (main): Handle it. + (info_short_help): Document it. + (main): Honor --output together with --usage, by dumping the node + we found to the named file. - * info/Makefile.am (BUILT_SOURCES): rm -f $(BUILT_SOURCES), a - kludge. + 2002-02-23 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/html.c (nodename_to_filename): Call + nodename_to_filename_1 with the last argument 1, not 0. - 1999-07-28 Karl Eichwalder <ke@gnu.franken.de> + * makeinfo/toc.c (shortcontents_update_html) + (contents_update_html): Don't omit the entry for the Top node. - * makeinfo/makeinfo.c: Fix help string (-o). + * 2002-01-30 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/node.c (cm_node): Don't condition splitting on + top_node_seen being non-zero. If current_node is NULL, use the + current output file name to get at the file name for the previous + node. Don't compute a new file name for a node if we didn't close + the current file. - 1999-07-30 Eli Zaretskii <eliz@is.elta.co.il> + 2002-02-01 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/node.c (cm_node): Call html_output_head whenever we + create a new split-HTML file. - * makeinfo/makeinfo.c (cm_uref, cm_email): Don't collapse -- and - `` in the URL part of the reference. + * makeinfo/html.c (html_output_head): Make html_title static. + Compute it only once, and don't free it. Output the <h1> title + header only once per run. - 1999-08-03 Eli Zaretskii <eliz@is.elta.co.il> + 2002-02-02 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/toc.c (contents_update_html): Fix the condition for + omitting duplicate TOC entries. Fix comparison with the TOC entry + for "Top". - * util/install-info.c (main): For entries given on command line, - set entry_sections and entry_sections_tail members to NULL, and - set text_len member to the entry length. After processing the - Info file, update the entry_sections pointers of all entries that - came from the command line. +2002-02-14 <karl@gnu.org> - * util/texindex.c (sort_offline, sort_in_core): use off_t rather - than long. - Found on FreedBSD 2.2.8 by "Trond Endrestol" <endrestol@hotmail.com>. + * doc/Makefile.am (DISTCLEANFILES): use this variable instead of + the distclean-aminfo target, which apparently is no longer used. -Mon Jul 19 17:16:46 1999 Karl Berry <karl@gnu.org> + * pretest 4.0g. - * configure.in: 3.12n + * doc/texinfo.tex (\appendixentry): new macro for typesetting + appendix toc entries. + (\appendixzzz, \summarycontents, \pdfoutlines): use it, instead of + usurping \chapentry. This allows the bookmarks in the pdf output + to come out right. Report from: Kurt Hornik + <Kurt.Hornik@ci.tuwien.ac.at>. - * makeinfo/makeinfo.c (add_char): Don't insert <p> if we're in - @html. +2002-02-13 <karl@gnu.org> - * makeinfo/html.c (add_escaped_anchor_name), - * makeinfo/toc.c (toc_add_entry): use URL_SAFE_CHAR. - * makeinfo/makeinfo.h (HTML_SAFE, URL_SAFE_CHAR): new macros. + * configure.ac: ALL_LINGUAS is deprecated as of gettext 0.11. + * doc/texinfo.tex (\image): remove spurious \loggingall. -Sun Jul 18 14:47:40 1999 Karl Berry <karl@gnu.org> + * doc/texinfo.txi: @math now implies @tex. + * doc/texinfo.tex (\math): imply @tex. - * dir-example: Add bzip2. +2002-02-11 <karl@gnu.org> - * configure.in: 3.12m. + * makeinfo/insertion.c (handle_verbatim_environment): save and + restore filling_enabled and inhibit_paragraph_indentation. Bug + report from: Alexandre Duret-Lutz <duret_g@lrde.epita.fr>. - * doc/texinfo.txi (@afourlatex,@afourwide): add to command list. + * makeinfo/makeinfo.c (reader_loop): don't worry about bare braces + inside @math. -1999-07-17 Eli Zaretskii <eliz@is.elta.co.il> +2002-02-08 <karl@gnu.org> - * makeinfo/makeinfo.c (cm_xref): Don't collapse `` and -- while - expanding node names. Generate a terminating period for - @pxref, when it has more than a single argument. + * info/infodoc.c: keep underlines with the text they refer to, for + translation purposes. + Pointed out by Christian Rose <menthos@menthos.com>, 20 nov 2001. - * makeinfo/index.c (cm_printindex): Don't collapse `` and -- while - expanding node names. + * doc/info.texi: recommend setting INFOPATH. -Sat Jul 17 16:33:45 1999 Karl Berry <karl@gnu.org> + * doc/Makefile.am (install-tex): need $(srcdir) for install. + From: istry <istry@mail.ru>. - * 3.12l. + * doc/texinfo.tex: replace $$$ delimiter with $.$, for sake of + font-lock in Emacs 21.1. Suggestion from: Stephen Gildea + <gildea@stop.mail-abuse.org>. - * doc/texinfo.txi: @alias, @definfoenclose, etc. + 2002-01-26 Eli Zaretskii <eliz@is.elta.co.il> + * info/infomap.c (default_emacs_like_info_keys) + (default_emacs_like_ea_keys, default_vi_like_info_keys) + (default_vi_like_ea_keys): Fix default keybindings to be + consistent with non-INFOKEY branch. Add bindings for Home, End, + and Delete keys. - * util/texindex.c (indexify): error message instead of abort(2) - when no page number. + 2002-01-23 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/toc.h <TOC_ENTRY_ELT>: New member html_file. -Fri Jul 16 18:00:26 1999 Karl Berry <karl@gnu.org> + * makeinfo/toc.c (toc_add_entry): Compute and set the html_file + member. + (shortcontents_update_html): Produce the toc_* links correctly, + without duplicating the link text. Fix comparison with "Top". + Handle the case when there's @shortcontents, but no @contents. + (contents_update_html): Fix the way toc_* anchors are produced + from toc_entry_alist[i]->name: take only the node name from the + string in toc_entry_alist[i]->name. Fix comparison with "Top". - * doc/texinfo.txi: Overfull boxes, help2man, etc. + * makeinfo/sectioning.c (sectioning_html): Take the toc_anchor + substring before closing the anchor with </a>. Fix the closing + </hN> tag--add 2 to level, not 1. Use sizeof instead of a magic + value of 9. - * util/Makefile.am (EXTRA_DIST): texi-outline.gawk is really - outline.gawk, add fixref.gawk and prepinfo.awk and - texi-docstring-magic.el. + * makeinfo/cmds.c: Make @summarycontents call cm_shortcontents, as + promised by the docs. -Thu Jul 15 18:57:54 1999 Karl Berry <karl@gnu.org> + 2002-01-19 Eli Zaretskii <eliz@is.elta.co.il> + * djgpp/config.sed: Fix a problem with AC_CONFIG_LINKS that + prevented building from a directory on another drive. - * doc/texinfo.txi: .fmt, etc. - * doc/texinfo.txi: More macro docs, etc. + * djgpp/config.bat: Fix problems with long --srcdir diectory names. -Wed Jul 14 19:58:47 1999 Karl Berry <karl@gnu.org> + * djgpp/README: Update. - * doc/texinfo.txi: Give good quote. +2002-01-31 <karl@gnu.org> - * util/Makefile.am (EXTRA_DIST): add texi-outline.gawk. + * doc/texinfo.txi: mention dvips - From: kama@hippo.fido.de (Karl Heinz Marbaise) - * makeinfo/toc.c (contents_update_html): go back to start level. - * doc/texinfo.txi: deftypeop +2002-01-28 <karl@gnu.org> - From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> - * makeinfo/toc.c (toc_add_entry): don't assume sprintf return type - is int. - * makeinfo/sectioning.c (insert_and_underscore): declare more - unsigned char *. - * makeinfo/macro.h (itext_info, itext_size): remove declarations, - they're defined static. - * makeinfo/makeinfo.c: Split up help string even more. + * configure.ac (ALL_LINGUAS): add hr. -Tue Jul 13 17:16:18 1999 Karl Berry <karl@gnu.org> +2002-01-22 <karl@gnu.org> - * doc/texinfo.txi: Document @rmacro. - * makeinfo/macro.c (cm_rmacro): new command to do @allow-recursion - by default. - (define_macro): split off from cm_macro. + * makeinfo/defun.c (defun.c): only warn about ( immediately + following a defun name, since the groff manual needs other + characters there where whitespace is incorrect. + Reported by Werner Lemberg <wl@gnu.org>. - * makeinfo/macro.h (cm_rmacro): declare. - * makeinfo/macro.h (delete_macro): do not need to export. - * makeinfo/cmds.c (rmacro): new command. + * doc/info-stnd.texi: alphabetize variable list. - * makeinfo/html.c, - * makeinfo/toc.c, - * makeinfo/lang.c, - * makeinfo/makeinfo.c: Use strchr instead of member. + * doc/texinfo.txi: no :'s in index entries, index @page/@group + some more. -Mon Jul 12 08:01:19 1999 Karl Berry <karl@gnu.org> + * makeinfo/index.c (index_add_arg): warn if index entry contains a + colon. From: Kenneth Lorber <keni@his.com>. - * doc/texinfo.txi: document this. - * makeinfo/macro.c (apply): warn if \ in macro body is not - followed by a parameter name or \, instead of silently - accepting it, for compatibility with TeX. +2002-01-21 <karl@gnu.org> - * makeinfo/macro.c: Doc fix. + * makeinfo/insertion.c: </pre not /<pre, reported by Mike + Benefield <mike@duckbrain.com>. -Sun Jul 11 12:49:50 1999 Karl Berry <karl@gnu.org> +2002-01-18 <karl@gnu.org> - * makeinfo/macro.c (cm_macro): do @quote-arg implicitly if single - argument to macro. - * doc/texinfo.txi: Document this. + * configure.ac: pretest 4.0f. - * doc/texinfo.txi (Smallcaps): Document makeinfo warning if arg is - all uppercase. - * makeinfo/cmds.c (cm_sc): warn if arg is all upper (suggested by - Jim Meyering). + * util/texindex.c: + * util/install-info.c: + * makeinfo/makeinfo.c: + * info/info.c: it's 2002. - * makeinfo/cmds.c (cm_var): warn if argument contains any of ,[]() - which are unlikely to be allowable in real variable names. - Suggested by rms. + * info/session.c: pass right args to info_scroll_half_screen_up. + From Eli. - * makeinfo/makeinfo.h (member): remove weird masking macro. +2002-01-18 Eli Zaretskii <eliz@is.elta.co.il> - * doc/texinfo.txi: Probably ok to indent @example. + * makeinfo/multi.c (multitable_item): Always return a value. - * configure.in: 3.12k. + * util/install-info.c (xmalloc, xrealloc, pfatal_with_name) + (open_possibly_compressed_file, parse_input): Call `fatal' with 3 + arguments, to avoid compiler warnings. + (main): Call `fatal', `error', and `warning' with the right number + of arguments. - * makeinfo/html.c (add_escaped_anchor_name): Cast to unsigned char - for 8-bit chars. From Yoshiki. + * makeinfo/makeinfo.c (main): Remove extraneous first arg of + usage(). - * makeinfo/makeinfo.c: complain -> warn for sake of <80 chars. + * info/window.c (build_message_node): Supply a 4th argument to + build_message_buffer. -1999-07-09 Eli Zaretskii <eliz@is.elta.co.il> - * makeinfo/multi.c (multitable_item): Quote the value of align= - property. +2002-01-18 Eli Zaretskii <eliz@is.elta.co.il> - * makeinfo/defun.c (defun_internal): Ditto. + * makeinfo/sectioning.c (sectioning_html): End the anchor properly + with a </a>. - * makeinfo/cmds.c (cm_center): Ditto. + * info/session.c (info_menu_or_ref_item): If we didn't find a + cross-reference on this line, try the one before. - * makeinfo/toc.c (toc_add_entry): New argument ANCHOR; all callers - changed. In HTML mode, expand NODE_NAME, or use ANCHOR, if - non-NULL, and save it together with the TOC name in the name - member of the TOC entry. - (toc_add_entry, toc_find_section_of_node): Add a warning in a - comment that the NODE argument must be unexpanded. - (contents_update_html): Terminate the TOC entry with </a>. + * info/infomap.c (fetch_user_maps): Provide two different + translations for ``file too small'' and ``file too big'' error. - * makeinfo/sectioning.c (sectioning_html): If the sectioning - command is outside any node, generate explicit anchor and pass it - to toc_add_entry. + * info/info.c (info_short_help): Print the --speech-friendly + option together with the other options, not at the end of the help + screen. - * makeinfo/node.c (expand_node_name): Now external instead of - static. - (cm_node): Output expanded node name in the navigation bar. +2002-01-18 Andreas Schwab <schwab@suse.de> - * makeinfo/node.h: Declare expand_node_name. + * makeinfo/html.c (escape_string): When string is empty don't read + past end of it. - * makeinfo/index.c (cm_printindex): Produce valid HTML links, even - if index->node is NULL or empty. Fix format of index under - --no-headers. +2002-01-17 <karl@gnu.org> -Fri Jul 9 18:09:28 1999 Karl Berry <karl@gnu.org> + * doc/info-stnd.texi: overfull box in table. - * doc/texinfo.txi: Pair @end html properly. From Olaf B. +2002-01-16 <karl@gnu.org> - * doc/Makefile.am (EXTRA_DIST): add txi-nl.tex from Marcel van der Boom - <marcel@virtualprojects.org>. + * configure.ac: pretest 4.0e. - * doc/txi-en.tex: Doc fix. + * doc/info.texi: update from emacs. -Wed Jul 7 16:07:44 1999 Karl Berry <karl@gnu.org> +2002-01-03 Eli Zaretskii <eliz@is.elta.co.il> - * doc/Makefile.am: Doc fix. + * makeinfo/makeinfo.c (file_line_error): New function. - * configure.in (txi_CHECK_DECLS): call this new macro (in - acinclude.m4). - * acinclude.m4: new file. + * makeinfo/insertion.c (discard_insertions): Call file_line_error + instead of changing global variables. -Tue Jul 6 19:12:37 1999 Karl Berry <karl@gnu.org> + * makeinfo/sectioning.c (cm_top): Ditto. - * makeinfo/insertion.h, - * makeinfo/insertion.c, - * makeinfo/cmds.c, - * makeinfo/defun.c: new command @deftypeop. - Suggestion from: booth@us.ibm.com. + * makeinfo/node.c (validate_file): Ditto. -1999-07-05 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/makeinfo.c (discard_braces, handle_variable_internal): + Ditto. - * makeinfo/makeinfo.c (cm_value): Don't convert quotes and dashes - in the argument of @value, since @set doesn't. + * makeinfo/macro.c (define_macro): Ditto. -Mon Jul 5 16:43:23 1999 Karl Berry <karl@gnu.org> + 2001-12-31 Eli Zaretskii <eliz@is.elta.co.il> - * makeinfo/insertion.c (get_item_function): return "@ " rather - than "@". (command_needs_braces): new fn. - (cm_item): handle @itemize markers that don't take braces. - Bug reported by Stephen, prototype fix from Yoshiki. + * makeinfo/node.h (TAG_ENTRY): New struct member html_fname. - * doc/texinfo.txi (Contents): @contents ignored at beginning when - outputting to stdout. - Installed this. ->1999-05-02 Eli Zaretskii <eliz@is.elta.co.il> -> * makeinfo/toc.c (cm_contents, cm_shortcontents): If writing to -> stdout, output the contents and short contents immediately, and -> assign NULL to contents_filename and shortcontents_filename, so -> that toc_update won't try to rewrite stdout. + * makeinfo/node.c (find_node_by_fname): New function. + (remember_node): Accept an additional argument FNAME, the node's + file name, and record it in the list of nodes; callers changed. + (cm_node): Call find_node_by_fname to see if this node's file name + clashes with another node or anchor. If it clashes with another + node, append the new node to the same file instead of erasing the + other node. If it clashes with an anchor, print an error message + and overwrite the anchor's file. + (cm_anchor): If this anchor's file name clashes with another + anchor or node, print an error message and ignore the anchor. + * makeinfo/files.c (normalize_filename): New function. - * makeinfo/sectioning.c (sectioning_html): declare starting_pos - and ending_pos as unsigned char * since they're based on - output_paragraph. + * makeinfo/files.h <normalize_filename>: Add declaration. - * makeinfo/insertion.c: Cast output_paragraph to char * for sake - of strncmp prototype (on IRIX 4). - From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> + * makeinfo/html.c (nodename_to_filename_1): Call + normalize_filename before returning the file name to the caller. + Disable the code which adds #Nodified-filename to the file name we + produce. + * makeinfo/makeinfo.c (add_char): Don't replace whitespace with +   if we are producing an HTML directive. + (add_html_elt): New function. + (cm_xref, cm_inforef, cm_uref, cm_email, cm_image): Use + add_html_elt instead of add_word, where appropriate. - * info/man.c (get_manpage_contents): restore previous (default) - SIGCHLD handler so the pclose when gunzipping info files - doesn't fail with `No child processes' (because - reap_children reaped it). - From: Josip Rodin <jrodin@public.srce.hr> - njs@uclink4.berkeley.edu, 38063-forwarded@bugs.debian.org + * makeinfo/html.c (add_link): Ditto. -Fri Jul 2 14:26:22 1999 Karl Berry <karl@gnu.org> + * makeinfo/footnote.c (cm_footnote): Ditto. - From gildea: - * info/terminal.c (TIOCGETC) [M_XENIX && TIOCGETC]: #undef. - * info/session.c (strncasecmp) [M_XENIX]: declare. + * makeinfo/defun.c (defun_internal): Ditto. -Thu Jul 1 19:25:12 1999 Karl Berry <karl@gnu.org> + 2001-12-27 Eli Zaretskii <eliz@is.elta.co.il> - * makeinfo/makeinfo.c (cm_value): erroneous capitalization in - error message. + * makeinfo/node.c (cm_node): Don't omit links to (DIR) from the + navigation bar, add_anchor_name will DTRT now. - * makeinfo/insertion.c (end_insertion): @end html should turn html - escaping back on. From esr. + * makeinfo/makeinfo.c (cm_xref): Produce a split-HTML file name + from arg1, the node name, not from arg3 or arg2, which are the + reference name. Use arg2 or arg3 for the text to be displayed as + a link between ">" and "</a>". Use add_anchor_name instead of + add_nodename_to_filename. + (cm_inforef): Use add_anchor_name instead of + add_nodename_to_filename. Handle the case of a missing second + argument in @inforef. - * makeinfo/makeinfo.c (cm_pxref): No period needed to terminate - cross-reference. + * makeinfo/html.c (add_anchor_name): Always add # and the anchor + name, even if we are splitting. If the node is "(dir)", treat it + as if it were "dir". + (nodename_to_filename_1): Don't append #Top for the Top node. + (add_link): Don't punt if nodename is "(dir)". Output "</a>" + after the link. -Sun Jun 13 16:12:41 1999 Karl Berry <karl@gnu.org> + 2001-12-25 Eli Zaretskii <eliz@is.elta.co.il> - * doc/texinfo.txi: Remove some more node links. + * makeinfo/makeinfo.c (cm_xref, cm_inforef): Output the target + file name via add_nodename_to_filename. -Sat May 1 16:01:36 1999 Karl Berry <karl@gnu.org> + 2001-12-20 Eli Zaretskii <eliz@is.elta.co.il> - * info/info.c: Single space for option indent to match others. + * makeinfo/html.c (nodename_to_filename_1): Make references to Top + to refer to index.html#Top. + (add_nodename_to_filename): Accept additional argument HREF; + callers changed. - * makeinfo/makeinfo.c, - * util/texindex.c, - * util/install-info.c: Must indent option list for help2man. + * makeinfo/toc.c (rewrite_top): If the filename to rewrite is + stdout or the null device, do nothing. - * info/infodoc.c [HELP_NODE_GETS_REGENERATED]: set to true. - (info_internal_help_text): put moving cmds first so they know how to go - forward in the help window. - (create_internal_info_help_node): can't always quit help with C-x 0. - (info_find_or_create_help_window): pass !one_window_p. + * makeinfo/makeinfo.c (insert_toplevel_subdirectory): Use + FILENAME_CMP instead of strcmp. Search for a period forward, not + backward. Make index_name[] a static const array, and its len + computed at compile time. + (convert_from_loaded_file): If output_filename is the null device, + turn off HTML splitting. + (cm_xref): Use add_anchor_name, rather than add_escaped_anchor_name, + in the 5-argument case in HTML mode. + (cm_inforef): Fix external references in HTML mode. -1999-04-29 Yoshiki Hayashi <g740685@komaba.ecc.u-tokyo.ac.jp> + * makeinfo/node.c (cm_node): Use FILENAME_CMP instead of strcmp. + Don't open a new file if the new node's name is empty. Take the + directory part of split-HTML files from current_output_filename, + not from toplevel_output_filename (the latter doesn't include the + manual's subdirectory part). - * makeinfo/makeinfo.c (cm_xref): Don't collapse --- to -- etc., - in references. + * makeinfo/html.c (nodename_to_filename_1): Use FILENAME_CMPN + instead of strncmp. Support *.inf files in references. -Mon Apr 26 16:41:55 1999 Karl Berry <karl@gnu.org> +2001-12-11 Eli Zaretskii <eliz@is.elta.co.il> - * makeinfo/node.c (validate): arrange to translate the reference type. - Report from Sergio. + * djgpp/config.bat, djgpp/config.sed, djgpp/config.site: Update + for Texinfo 4.0d. - * makeinfo/makeinfo.c (validate): should not be declared here. + * makeinfo/makeinfo.c (insert_toplevel_subdirectory): Use IS_SLASH + instead of literal `/'. + (convert_from_loaded_file): Flush the output stream before + creating the TOC. - * makeinfo/index.c (cm_printindex): <ul compact> is not - translatable. From Yoshiki. - * doc/Makefile.am (EXTRA_DIST): include new txi-es.tex from Adrian - Perez Jorge <alu1415@csi.ull.es>. And new txi-en.tex. +2002-01-14 <karl@gnu.org> -Sun Apr 25 16:08:27 1999 Karl Berry <karl@gnu.org> + * info/info.c: translate --speech-friendly (from Eli). + * makeinfo/index.c: formatting. - * makeinfo/cmds.c (cm_settitle): don't output html head here. + 2001-12-24 Eli Zaretskii <eliz@is.elta.co.il> + * info/infomap.c (initialize_info_keymaps): Bind the user-defined + keys on top of the default ones, not the other way around. - * makeinfo/makeinfo.c: Move html routines to html.c. - * makeinfo/Makefile.am (makeinfo_SOURCES): add html.[ch]. - * makeinfo/html.[ch]: new files. +2002-01-11 <karl@gnu.org> - * makeinfo/makeinfo.c: Restore -- in --output line. From Sergio. + * info/info.c: can't do #ifdef inside of printf any more. + From: Tyler <tyler@zerodivide.cx> -1999-04-23 Yoshiki Hayashi <g740685@komaba.ecc.u-tokyo.ac.jp> + * configure.ac (ALL_LINGUAS): add he, from Eli. - * makeinfo/cmds.c (cm_center): Recover the previous state when - called with --html. +2002-01-09 Eli Zaretskii <eliz@is.elta.co.il> -1999-04-24 Eli Zaretskii <eliz@is.elta.co.il> + * info/window.c (calculate_line_starts): Cast node->contents[i] to + unsigned char. - * makeinfo/cmds.c (cm_bye): Flush the output, in case some command - produced it immediately before @bye. +2002-01-04 <karl@gnu.org> - * makeinfo/toc.h (TOC_ENTRY_ELT): New member: containing_node. + * doc/texinfo.tex (\footnotezzz): \noindent=\relax. - * makeinfo/toc.c (lots_of_stars): New variable. - (toc_add_entry): Add a new parameter node_name; all callers - changed. Record the name of the node containing the section. - (toc_find_section_of_node): New function. - (toc_free): Free the new containing_node member. - (contents_update_info, shortcontents_update_info): Underline the - title with stars. Output two empty lines after the TOC. - (contents_update): Fix off-by-one error in writing the rest of the - file after updating the TOC. +2002-01-03 <karl@gnu.org> - * makeinfo/index.c (cm_printindex): Save and restore line_number - and input_filename. Don't output the "* Menu" header when - --no-headers is in effect. Make the fake node name for index - entries that are outside any node be more explanatory, and emit an - error for such index entries. Under --no-headers, output a - reference to the section name, as returned by a call to - toc_find_section_of_node, instead of a node name. + * doc/texinfo.tex (\imagexxx): handle pdf and dvi cases the same. + (\dopdfimage): need \immediate to avoid seg fault when including the + same image twice. + Bug reports from Alexandre Duret-Lutz <duret_g@lrde.epita.fr>. -1999-04-24 Eli Zaretskii <eliz@is.elta.co.il> +2001-12-31 <karl@gnu.org> - * makeinfo/index.c (struct index_elt): Add a new member - entry_text. - (free_index, make_index_entries_unique): Free the entry_text - member. - (index_add_arg): Don't HTML-escape the index entry here. - (index_add_arg): Initialize the entry member to NULL. Put the - entry text into the entry_text member. - (sort_index): Expand the index entries as if in non-HTML mode. - Put the expansion into the entry member of struct index_elt. - (cm_printindex): Allocate the line[] array in Info mode only. - In HTML mode, escape and expand the original index entry text, - don't use the results of expansion inside sort_index. + * makeinfo/makeinfo.c (cm_image): check *ext_arg as well as + ext_arg when computing length of fullname. - * makeinfo/cmds.c (cm_r): Undo the effect of @code while printing - one of the "code"-style indices in HTML mode. + * makeinfo/defun.c: docbook changes. + * makeinfo/docbook.c (docbook_punctuation): remove deprecated + default: at end of statement. -1999-04-23 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/docbook.c: initial. + * makeinfo/docbook.h: initial. + * makeinfo/Makefile.am (makeinfo_SOURCES): add docbook.[ch]. + * makeinfo/makeinfo.c (add_char): use   in docbook case. - * info/infomap.c (initialize_vi_like_keymaps): Bind DEL in echo - area to ea_rubout, except for __MSDOS__. + * doc/texinfo.tex (\footnotezzz): use \everypar={\hang} instead of + just \hang in case a footnote extends for multiple paragraphs. - * doc/info-stnd.texi (Node Commands): Document that `I' only - produces its effect for programs documented in the current Info - file. Tell them to invoke `I' from DIR if it doesn't work from - current place. +2001-12-18 <karl@gnu.org> -Thu Apr 22 09:59:02 1999 Karl Berry <karl@gnu.org> + * info/Makefile.am (BUILT_SOURCES): include $(EXEEXT) on makedoc + dependency since automake doesn't do it. - * makeinfo/makeinfo.c, - * info/info.c: Rewrite help string a little more. + 2001-12-11 Eli Zaretskii <eliz@is.elta.co.il> - * doc/info-stnd.texi: Change chapter name to match node name, - * other changes. + * djgpp/config.bat, djgpp/config.sed, djgpp/config.site: Update + for Texinfo 4.0d. - * makeinfo/cmds.c (cm_bye): call discard_braces. + * info/infomap.c (fetch_user_maps): Initialize `filename' to NULL + and don't try to call `open' if `filename' is NULL. + [__MSDOS__]: Try the current directory if neither $INFOKEY nor + $HOME are defined. - * makeinfo/cmds.c (cm_settitle): output more meta and link tags. + * makeinfo/makeinfo.c (insert_toplevel_subdirectory): Use IS_SLASH + instead of literal `/'. + (convert_from_loaded_file): Flush the output stream before + creating the TOC. - * configure.in (ALL_LINGUAS): add eo. + 2001-12-10 Eli Zaretskii <eliz@is.elta.co.il> - * util/install-info.c [STRIP_DOT_EXE]: #if not #ifdef + * info/infokey.c (main): Use FOPEN_WBIN instead of "w". -Wed Apr 21 19:40:51 1999 Karl Berry <karl@gnu.org> + * info/infokey.h (INFOKEY_SRCFILE, INFOKEY_FILE) [__MSDOS__]: + Special definitions for MS-DOS. - * makeinfo/makeinfo.c: Doc fix. + 2001-12-09 Eli Zaretskii <eliz@is.elta.co.il> - * makeinfo/sectioning.c (insert_and_underscore): do not output - html anchor here. - * makeinfo/node.c (cm_node): do anchor at node name not sectioning - title. + * lib/system.h: Condition inclusion of libintl.h on ENABLE_NLS. + (gettext, bindtextdomain, textdomain) [!ENABLE_NLS]: Provide + trivial definitions for when NLS is not used. + (LC_MESSAGES) [!ENABLE_NLS]: Define if undefined by locale.h. - * makeinfo/node.c: Newlines on node lines. +2001-12-18 Eli Zaretskii <eliz@is.elta.co.il> -Tue Apr 20 13:02:46 1999 Karl Berry <karl@gnu.org> + * info/infomap.c (decode_keys): Change the return type to int; + callers changed. Return zero if some of the special keys in SRC + are not defined by the terminal; return non-zero otherwise. + (section_to_keymaps): If decode_keys returns zero, don't bind the + key sequence. - * info/man.c (get_manpage_contents): freopen stdin and stderr to - /dev/null rather than closing them. http://bugs.debian.org/14787 +2001-12-18 Eli Zaretskii <eliz@is.elta.co.il> -Mon Apr 19 14:12:09 1999 Karl Berry <karl@gnu.org> + * makeinfo/xml.c (xml_insert_element_with_attribute) + (xml_insert_element): Rename the argument `element' to `elt'. - * doc/texinfo.txi: Document possibility of `titlepage' stuff for - plain text output using @ifinfo. - Report from: Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at>. + * info/infokey.c (compile): Use \033 instead of (non-standard) \e. - * makeinfo/cmds.c: Screw that. - * doc/texinfo.txi: Fix up frontmatter a bit. +2001-12-17 <karl@gnu.org> - * dir-example: Spaces not tabs. - * dir-example (R FAQ): add. + 2001-12-16 Eli Zaretskii <eliz@is.elta.co.il> - * makeinfo/makeinfo.c: Lowercase makeinfo in first line. + * info/pcterm.c (pc_initialize_terminal) [INFOKEY]: Store term_kh, + term_ke, term_ki, and term_kx sequences. + (DJGPP_keytab): Map Home, End, and Insert to escape sequences, not + to C-a, C-e, etc. - * doc/info.texi (The node reached...): is a @subsection not a - @subsub. + * info/infomap.c (default_emacs_like_info_keys) + (default_emacs_like_ea_keys, default_vi_like_info_keys) + (default_vi_like_ea_keys): Add the leading suppress-default flag, + to be consistent with the table which comes from a file. - * doc/texinfo.txi: Document option rename. - * makeinfo/makeinfo.c: Rename option to commands-in-node-names. + * info/session.c (info_do_lowercase_version): Add a doc string. - * makeinfo/index.h (index_compare_fn): declare. - * makeinfo/index.c (index_element_compare): call through new - variable index_compare_fn, and set it to strcoll if - @documentlanguage was used and LANG != en. - #include lang.h. + * info/infodoc.c (describe_key) [INFOKEY]: If keystroke is bound + to do-lowercase-version, but its lower-case variant is undefined, + say that keystroke is also undefined. -Sat Apr 17 14:46:47 1999 Karl Berry <karl@gnu.org> - * makeinfo/insertion.c (current_item_function, cm_item): rewrite - to skip all conditionals. - (cm_item): use current_item_function rather than current_insertion_type - to check what to use for @item, so @ifset etc. can be used around - @items. - Report from: "W. L. Estes" <wlestes@br20920.uncg.edu>. +2001-12-12 <karl@gnu.org> - * makeinfo/makeinfo.c (current_insertion_type): no need to - declare. + * makeinfo/files.c (find_and_load): remove conditionals on + VMS|O_BINARY, always just read as many bytes as we can. - * makeinfo/makeinfo.c: Add examples to help message. + 2001-12-11 Eli Zaretskii <eliz@is.elta.co.il> + * new files for djgpp/. - * util/texindex.c (usage): Rearrange --help, avoid extra newline. + 2001-09-09 Eli Zaretskii <eliz@is.elta.co.il> + * info/echo-area.c (build_completions): Look for a candidate + completion which matches user's request including the letter-case, + use that as the value of LCD_completion. - * info/info.c: Sort --help in the usual place. + 2001-12-06 Eli Zaretskii <eliz@is.elta.co.il> + * info/echo-area.c (build_completions): When looking for the best + completion candidate, only compare as much characters as the user + typed. - * makeinfo/makeinfo.c: Reindent help message, rename - --expensive-validation to --commands-in-nodes. -Fri Apr 16 17:53:48 1999 Karl Berry <karl@gnu.org> +2001-12-04 <karl@gnu.org> - * makeinfo/cmds.c (cm_ignore_arg): new routine. - (cm_ignore_line_no_op): remove, can use cm_ignore_line. + * doc/texinfo.tex (\pdfmkpgn): remove trailing @ in link names + again. Also from Kurt. -Tue Apr 13 16:45:39 1999 Karl Berry <karl@gnu.org> + * doc/texinfo.tex (\image): need five commas to ignore additional + optional args to @image. From Kurt.Hornik@ci.tuwien.ac.at. - * doc/info-stnd.texi: Frontmatter changes. + * doc/texinfo.tex (\afourlatex): reset \globaldefs=0 explicitly. + From Trond Endrestĝl <trond@ramstind.gtf.ol.no>. - * doc/info.texi: Remove advanced remark in first node. +2001-12-01 <karl@gnu.org> - * doc/texinfo.txi: Texinfo.tex does macros now. From Eli. + * makeinfo/files.c (find_and_load): remove O_BINARY from open + call, this messes up under Windows. From eli. - * doc/texinfo.txi: Document @w{ } to produce an unbreakable space. +2001-11-20 <karl@gnu.org> - * util/texi2dvi: Update from Akim, avoid Solaris ucb echo weirdness. + * makeinfo/makeinfo.c (cm_image): reword error messages. - * info/infodoc.c: Parenthesize function calls, don't depend on - gettext being there. Report from: Doug Semler - <doug@seaspace.com>. +2001-11-19 <karl@gnu.org> -1999-04-12 Eli Zaretskii <eliz@is.elta.co.il> + * Pretest 4.0d. + * doc/texinfo.txi: index ragged right/left. - * info/infomap.c (initialize_vi_like_keymaps): Initialize the echo - are keymap *before* it is filled up with keys. + * info/window.c (build_message_buffer): handle %1$s as used in + ja.po. From Fumitoshi UKAI <ukai@debian.or.jp>. -1999-04-10 Eli Zaretskii <eliz@is.elta.co.il> + * configure.ac (ALL_LINGUAS): add sv. - * makeinfo/macro.c (execute_macro): Reset the line number to where - the macro argumenst begin, before executing its expansion. +2001-11-16 <karl@gnu.org> - * makeinfo/makeinfo.c (cm_xref): Expand the name of arguments - before writing them in HTML mode. - (handle_menu_entry): Expand the name of the gleaned node before - writing it in HTML mode. + * Makefile.am (EXTRA_DIST): add COPYING.DOC. - * makeinfo/sectioning.c (sectioning_html): Expand the name of the - current node when producing the <a name=... anchor. + 1999-10-30 Andrew Bettison <andrewb@zip.com.au> - * makeinfo/node.c (cm_node): Expand the name of node and its links - before outputting them in HTML mode. + All these changes are to implement user-configurable key mapping + using the new 'infokey' program. For the time being, the new + code is conditional on [INFOKEY] and the old code is still there + in case we want to revert. - * makeinfo/index.c (cm_printindex): Expand node names to which the - index points. + * info/session.c (incremental_search): test for printable chars + _before_ isearch command keys -- makes a difference if the + isearch commands are bound to printable chars. - * makeinfo/footnote.c (cm_footnote): Call execute_string instead - of add_word_args, since current_node needs to be expanded. Expand - the name of the Footnotes node before calling - remember_node_reference. + * info/doc.h, + * info/infodoc.c, + * info/infomap.c, + * info/m-x.c, + * info/session.c: New typedef InfoCommand, plus a bunch of + supporting macros, to abstract a "command" away from being a + function pointer. - * makeinfo/tests/node-expand.txi: New test, for testing how node - names are expanded in @node, @menu, cross-references, and - indices. + * info/doc.h (pretty_keyseq), + * info/infodoc.c (pretty_keyseq), + * info/session.c (pretty_keyseq): Moved definition from + session.c into infodoc.c, and rewrote to recognise special + terminal sequences (PgUp, PgDn, etc.). - * makeinfo/makeinfo.c (add_char): If we output <p>, adjust the - affected brace positions by 3, so cm_xxx functions get what they - expect in START and END. - (insert_html_tag): Likewise. + * info/infodoc.c (create_internal_info_help_node, + replace_in_documentation, info_where_is), + * info/m-x.c (info_execute_command): Cleaned up references to + hardwired keystrokes. + + * info/infodoc.c (replace_in_documentation): + Extended the \\[foo] syntax to recognise \\%-X.Y[foo], which + causes the replacement text to be inserted using sprintf("%-X.Ys"). + + * info/session.c (_scroll_forward, _scroll_backward, + scroll_forward_page_only, scroll_backward_page_only, + scroll_forward_page_only_set_window, + scroll_backward_page_only_set_window): New functions, eliminating + need for SPC and DEL hack. - * makeinfo/cmds.c (cm_sc): Remove the kludge that looks for the - beginning of <small>, it is no longer needed. + * info/session.c (scroll_forward, scroll_backward, + scroll_forward_set_window, scroll_backward_set_window): Call + _scroll_forward and _scroll_backward to do all the work. + + * info/infomap.c (initialize_info_keymaps)[!INFOKEY]: set 'v' + and Control('v') key bindings to info_scroll_backward_page_only + and info_scroll_forward_page_only respectively. + + * info/Makefile.am (bin_PROGRAMS): Added new executable `infokey'. + (infokey_SOURCES): Defined. + (EXTRA_DIST): Added `sample_infokey'. + (BUILT_SOURCES): Added `key.c'. + + * info/infokey.h, + * info/infokey.c: Created, for new program `infokey' which + creates a $HOME/.info file by compiling a text source file with + syntax very similar to that used by `lesskey' in less 3.4.0. + + * info/makedoc.c: Generate new file `key.c' defining an array to + map command names to codes. + + * info/key.h: Created, to define contents of new `key.c' now + created by makedoc. + + * info/info.h (INFOKEY): Define, to enable all following changes. + (set_variable_to_value)[INFOKEY]: Declare new function. + + * info/makedoc.c [INFOKEY]: Write '#define A_' numeric command + code definitions into `funs.h' to support new key binding system. + + * info/session.c (info_dispatch_on_key, info_numeric_arg_digit_loop) + [INFOKEY], + * info/infomap.c [INFOKEY], + * info/infodoc.c (function_documentation, function_name, + describe_key, pretty_keyname, pretty_keyseq_internal, + where_is_internal)[INFOKEY], + * info/terminal.h (term_kh, term_ke, term_kx, term_ki)[INFOKEY], + * info/terminal.c (term_kh, term_ke, term_kx, term_ki, + terminal_initialize_terminal)[INFOKEY], + * info/variables.c (set_variable_to_value)[INFOKEY], + * info/sample_infokey: Added infokey functionality, copied more + or less wholesale from 'lesskey' in GNU Less 3.4.0. Added a new + typedef struct FUNCTION_KEYSEQ, and a new element `keys' to + typedef struct FUNCTION_DOC, to give the user some control over + the keystrokes that appear in the documentation node generated + by get-help-window, and to improve efficiency a little. + + * info/infodoc.c (info_internal_help_text, + create_internal_info_help_node)[INFOKEY]: Rewrote all code that + assumes fixed keystrokes, replacing %10s sequences with \\%10[foo] + sequences instead. + + * doc/info-stnd.texi: Documented above changes. + +2001-09-19 <karl@gnu.org> + + * makeinfo/cmds.c: </ not /<, duh :). From janneke. + +2001-09-12 <karl@gnu.org> + + * configure.ac (AC_SYS_POSIX_TERMIOS, AC_HEADER_TIOCGWINSZ): use + these new autoconf macros instead of the old automake ones. + + * info/terminal.c: remove unconditional include of sys/ioctl.h. + * info/termdep.h: <sys/ioctl.h> [GWINSZ_IN_SYS_IOCTL]: include outside of HAVE_TERMIOS_H, + per autoconf manual. + + * doc/Makefile.am (install-info-am): remove override of automake's + target, instead enable looking in . for info files within automake. + + * doc/info-stnd.texi: include separate version-stnd.texi + * configure.ac: autoconf 2.52, and rename to configure.ac. - * makeinfo/macro.c (cm_definfoenclose): Don't stop at the first - blank after the second comma: the blank may belong to the second - delimiter. +2001-09-11 <karl@gnu.org> - * makeinfo/tests/htmlpara.txi: New test, for the commands affected - by the <p> output at paragraph beginning. + * doc/texinfo.txi: recommend against using - and _ in @set names, + * and rearrange that section. - * makeinfo/makeinfo.h (expensive_validation): New option. + * info/infodoc.c (replace_in_documentation): free fun_name to fix + memory leak. + From: "Art Haas" <ahaas@neosoft.com>, Sat, 4 Aug 2001 08:34:31 -0500. + + * makeinfo/lang.c: encoding support for info output from kama. + * makeinfo/lang.h: encoding support for info output from kama. + + * makeinfo/html.c: include document encoding code unless + no_encoding. + * makeinfo/insertion.c (cm_direntry): don't call begin_insertion + if ignoring. + (cm_documentdescription): moved here, and likewise. + (begin_insertion): don't need output format conditionals here. - * makeinfo/makeinfo.c (long_options): Add expensive_validation. - (usage): Likewise. + * makeinfo/cmds.c (cm_documentdescription): move to insertion.c. + * makeinfo/makeinfo.h (enable_encoding): new global. + * makeinfo/makeinfo.c: new option --enable-encoding, rearrange help. - * makeinfo/node.c (find_node): If NAME isn't found verbatim, try - expanding it and every node name in tag table, before comparing - them, but only if expensive_validation is non-zero. - (find_node_reference): Likewise. - (cm_node): Don't expand node name and its links here. - (validate_file): If direct comparisons fail, try expanding the - comparees before giving up, unless expensive_validation is zero. - Switch the order of NODE and UP in error message about a lacking - menu item. + Sun Oct 31 18:44:24 UTC 1999 Karl Heinz Marbaise <kama@hippo.fido.de> -1999-04-07 Eli Zaretskii <eliz@is.elta.co.il> + - lang.{c,h}: + o added translation map between HTML markups and 8-Bit + (ISO-8859-1 codes; supplemental is Unicode for the future). + o added cm_search_iso_map: + search for characters based on HTML markup names for + translation 8-Bit code. + o recognizing of @documentencoding improved. + now we can recognize things like ISO-8859-{1...15} - * makeinfo/index.c (cm_printindex): Don't output "Menu" header. + - makeinfo.{c,h}: + o added two command line switches. + + info-encoding to activate the encoding for info output + which is correctly shown by info. Default is NOT to + encode the output to be compatible with earlier versions. + + no-encoding to suppress encoding e.g. while producing + ASCII output (--no-headers) results in that you get + "A for Ä as before. + o help output changed to document the switches. - * makeinfo/node.c (get_node_token): Collapse whitespace in node - names. - (glean_node_from_menu, expand_node_name): Likewise. + - html.c: + charset encoding in html based on @documentencoding. - * info/infomap.c (initialize_vi_like_keymaps): Bind all the 256 - keys to ea_insert, like the Emacs-like case does. - * doc/info-stnd.texi (Invoking Info): Document support for files - compessed with bzip2, and the --vi-keys option. - (Many places): Document key bindings under --vi-keys. +2001-07-31 <karl@gnu.org> -1999-04-06 Eli Zaretskii <eliz@is.elta.co.il> + * doc/texinfo.txi: mention pdfcolor.tex. + * doc/texinfo.tex: doc. + * doc/Makefile.am (install-tex): install pdfcolor.tex too. + * doc/pdfcolor.tex: new file, since Kurt.Hornik@ci.tuwien.ac.at + reports that not all pdftex installations include it. - * info/session.c (info_last_node, info_first_node): With a numeric - argument, go to ARGth node counting from the beginning. Skip - anchor tags when looking for the target node--the last tag can be - an anchor, for example. - (last_search_direction, last_search_case_sensitive): New - variables. - (last_search_for_string): Remove variable. - (info_search_internal): Always move point by one notch before - beginning the search, to avoid complications in repeated search - commands. When looking for the next node tag, skip any anchor - tags. - (info_search_1): Accept a 5th argument ASK_FOR_STRING, and only - prompt for search string if it's non-zero. All callers changed. - Look for the COUNTth occurence of the string. - (info_search, info_search_backward, info_search_case_sensitively): - Set last_search_direction and last_search_case_sensitive. - (info_search_next, info_search_previous): New commands, repeat - last search in the same or reverse direction without prompting the - user for the string. +2001-07-25 <karl@gnu.org> + + * doc/texinfo.tex (\Etitlepage): need \HEADINGSon before the + \...aftertitlepage checks to get page numbers. Report from + 3diff@gnu.org. + +2001-07-06 <karl@gnu.org> - * info/infomap.c (initialize_emacs_like_keymaps): Bind `C-x n' to - info_search_next and `C-x N' to info_search_previous. - (initialize_vi_like_keymaps): Bind `n' to info_search_next and `N' - to info_search_previous. + * doc/texinfo.txi: mention http://docbook2X.sourceforge.net/. -1999-04-04 Eli Zaretskii <eliz@is.elta.co.il> +2001-06-29 <karl@gnu.org> - * makeinfo/makeinfo.c (get_rest_of_line): Don't expand non-macros, - so that macro-expanded output will still have them. + * makeinfo/makeinfo.c: make output to stdout imply --no-split for + HTML, too. -1999-04-03 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/html.c (html_output_head): use documentdescription if set. + * makeinfo/insertion.h (insertion_type): new case documentdescription. + * makeinfo/insertion.c (begin_insertion, end_insertion, + insertion_type_names): new case for documentdescription. + * makeinfo/cmds.c (cm_documentdescription): new fn. + * makeinfo/makeinfo.h (document_description): new global. + * doc/texinfo.txi: @documentdescription. + @documentdescription implementation from patches by Will Estes. - * makeinfo/node.c (cm_node): Expand the node name and its links - completely before using them, so that they could use e.g. @value{} - etc. +2001-06-26 <karl@gnu.org> - * makeinfo/makeinfo.c (replace_with_expansion): Don't - remember_itext if we are executing_string. + * doc/texinfo.txi: documentdescription + * doc/texinfo.tex: Ignore @documentdescription ... @end + documentdescription. - * makeinfo/sectioning.c (sectioning_html): Remove #ifdef - HAVE_MACROS. Don't call me_execute_string if already - executing_string. + * doc/texinfo.txi: document sequential punctuation in @footnote is + normal, suggested by rms. - * makeinfo/toc.c (toc_add_entry): Expand macros in TOCNAME right - here, since the macro can be later redefined. - (contents_update_html, contents_update_info, - shortcontents_update_html, shortcontents_update_info): Use stdio - functions for output instead of add_word etc. - (rewrite_top, contents_update, shortcontents_update, toc_update): - New functions, replace the TOC placebo with the actual TOC. - (cm_contents): Output a placebo instead of writing the TOC. - (cm_shortcontents): Output a placebo instead of writing the short - TOC. +2001-06-21 <karl@gnu.org> - * makeinfo/makeinfo.c (convert_from_loaded_file): Call toc_update - if appropriate. + * doc/texinfo.tex (\textfonts): call \setleading here, so that we can + switch font sizes back and forth inside @tex with \globaldefs=1 + and not lose the leading. - * makeinfo/sectioning.c (cm_top): Don't output the HTML header - here, since the Top node might be preceeded by other commands, - like @contents. + * doc/texinfo.txi: allow @smallbook to run without overfull or + underfull boxes. - * makeinfo/cmds.c (cm_settitle): Output the HTML header here. +2001-06-19 <karl@gnu.org> - * makeinfo/node.c (set_current_output_filename): New function, - saves the name of the actual file we are now writing, including in - the case of split-HTML output. - (cm_node): Call it to record the name of output file. + * doc/texinfo.tex (\imagexxx): ignore new optional args to @image. - * makeinfo/footnote.c (free_pending_notes): Re-initialize - current_footnote_number to 1. + * makeinfo/html.c (html_output_head): include <h1>title</h1> at + beginning of document. + * makeinfo/sectioning.c (cm_top): don't include explicit links in + HTML output, the regular code for @node will do it. + (sectioning_html): use <h2> for chapter instead of <h1>, etc. + * makeinfo/node.c (cm_node): do not include code to output the + HTML <head>, we do that elsewhere now. + + 1999-11-26 W. L. Estes <will@fumblers.org> + * makeinfo/insertion.c (begin_insertion): add an explicit <br> + before beginning a <pre> block. for flushleft and flushright, use + <div> tag with an align attribute set. + * makeinfo/insertion.c (end_insertion): for flushleft and + flushright, end the </div> block. - * makeinfo/index.c (index_add_arg): Remove redundant xstrdup. - (cm_printindex): Don't free index->entry: it is freed in - free_index, if, e.g., there's more than one file to convert. + * makeinfo/makeinfo.c (cm_image): new variable, alt_arg now allows + user-supplied alt attribute value and + ext_arg allows user-supplied extension for image files. - * makeinfo/makeinfo.c (init_internals): Call toc_free. + * makeinfo/toc.c (contents_update_html): add anchors at chapter + level entries + (shortcontents_update_html): hrefs in shortcontents point to the + above anchors in the detailed contents -Mon Apr 5 16:53:33 1999 Karl Berry <karl@gnu.org> + * doc/texinfo.txi: document changes to @image and the new behavior + of shortcontents entries - * doc/Makefile.am: Texmf_{texinfo,dvips}: dirs not files. From - Kurt Hornik. +2001-06-14 <karl@gnu.org> -Wed Mar 31 13:50:09 1999 Karl Berry <karl@gnu.org> + * makeinfo/node.c: no need for size_t. - * Pretest 3.12h. +2001-06-13 <karl@gnu.org> - * makeinfo/node.c (last_node_p): new fn. - (split_file): call it, instead of assuming no more entries means - no more nodes. (Loses with anchors.) - Report from: "Oleg S. Tihonov" <ost@benetnash.ffke-campus.mipt.ru>. + * texinfo.tex (\pdfmkdest): \normalturnoffactive, so refs and + defs match. + (\xrefX): pdf link defs no longer use @, so link refs shouldn't use @ + either. (All xrefs in pdf were failing.) + (\mkpgn): remove redundant second definition. - * makeinfo/index.c (sort_index): whether an entry is @code or not - depends on the element, not the index, because of synindex. + * texinfo.tex (\smallerfonts): new font size. + (\smallexample, et al.): use it, in all cases, not just @smallbook. + + 1999-11-30 Andreas Schwab <schwab@suse.de> + * doc/texinfo.tex (\xrefX): Turn off active characters when writing + out the link name for pdf. - * doc/Makefile.am (install-tex): Must use $(TEXMF), do - $(mkinstalldirs) on tex dirs. - From: Nathan Sidwell <nathan@acm.org>. +2001-06-13 <karl@gnu.org> - * doc/texinfo.txi: Document need for blank line before @image if - you want space. + * doc/texinfo.txi: document that @smallexample is smaller in all + page formats now. - * Install changes from Eli: +2001-06-11 <karl@gnu.org> - 1999-03-09 Eli Zaretskii <eliz@is.elta.co.il> + * 4.0c. + * util/Makefile.am: Don't need automake patch any more, with + automake 1.4p4. - * info/infodoc.c (info_internal_help_text): Remove hard-wired key - names, use %-10s instead. - (info_help_keys_text): New variable, holds two variants of keys - that invoke basic commands, indexed by vi_keys_p. - (create_internal_info_help_node): Use info_help_keys_text[]. + * configure.in (AC_FUNC_SETVBUF_REVERSED): only needed on + pre-sysvr3 systems that nobody has anymore? Or so Russ Allbery + informs me ... - * info/window.c (build_message_buffer): Support more general - format strings, like %-10.15s, %+4d etc. +2001-06-08 <karl@gnu.org> - * info/infomap.c (initialize_vi_like_keymaps): Bind ESC-h, ESC-t, - C-x LFD and C-x RET. + * makeinfo/Makefile.am (EXTRA_DIST): include texinfo.{dtd,xsl}. - 1999-03-08 Eli Zaretskii <eliz@is.elta.co.il> + * util/Makefile.am: automake-1.4p3 now. - * util/install-info.c (output_dirfile): Sort the entries and - output them in alphabetic order. Output each entry only in those - sections where it belongs. - (parse_input): New function, code moved from main. Process - sections and entries in a single loop, and record with each entry - the list of sections where that entry belongs. Record each entry - separately, not all of them together as a single block. - (parse_dir_file): New function, code moved from main. - (main): Move code to parse_input and parse_dir_file. Put the new - entries only into sections where they belong. - (compare_entries_text): New function, called when sorting new - entries. +2001-06-07 <karl@gnu.org> - * info/infomap.c (initialize_vi_like_keymaps): New function. Bind - keys a-la Less, including new functions from session.c below. - (initialize_emacs_like_keymaps): New function, with the guts of - initialize_info_keymaps. + * util/texi2dvi: comment out conditional text, from Werner LEMBERG + <wl@gnu.org>. - * info/session.c (info_scroll_forward, info_scroll_backward): If - default_window_size is non-negative, use it as the default number - of lines to scroll. - (info_scroll_forward_set_window, info_scroll_backward_set_window, - info_down_line, info_up_line, info_scroll_half_screen_down, - info_scroll_half_screen_up, info_search_backward): New functions, - for Less-like look and feel. + 2001-06-02 Eli Zaretskii <eliz@is.elta.co.il> + * info/echo-area.c (info_read_completing_internal): If there are + no completions, say that instead of "Not complete". -Tue Mar 30 16:44:53 UTC 1999 Karl Heinz Marbaise <kama@hippo.fido.de> + * configure.in (ALL_LINGUAS): add da - * doc/txi-de.tex: - - added additional putwordin - * doc/texinfo.txi: - - changed defivar into deftypeivar - * makeinfo/sectioning.c: - - changed output of anchors based on problems with ie. - * makeinfo/defun.c: - - output in HTML mode changed to be on previous state. - * makeinfo/insertion.c: - - fixed up HTML output for deftypeivar. + * makeinfo/Makefile.am (pkgdata_DATA): include texinfo.xsl. -1999-03-30 Akim Demaille <demaille@inf.enst.fr> + * configure.in: update for autoconf 2.50. - * texi2dvi ($tmpdir): Avoid security holes. +2001-06-04 <karl@gnu.org> -Fri Mar 26 17:06:55 1999 Karl Berry <karl@gnu.org> + * util/Makefile.am (EXTRA_DIST): automake-14p2.patch now. + * util/automake-14p2.patch: rename from 14p1. - * makeinfo/cmds.c (cm_exdent): rewrite to preserve blank lines. - Bug from: "Oleg S. Tihonov" <ost@benetnash.ffke-campus.mipt.ru>. +2001-05-22 <karl@gnu.org> - * makeinfo/cmds.c (cm_exdent): arg is in `roman'. + * changes from feloy for lowercase xml names, etc. -Thu Mar 25 16:21:27 1999 Karl Berry <karl@gnu.org> +2001-05-21 <karl@gnu.org> - * makeinfo/insertion.c, - * makeinfo/defun.c, - * makeinfo/insertion.h (insertion_type): add deftypeivar. - * makeinfo/defun.h (cm_defun): declare here. - * makeinfo/cmds.c (defun.h): include. - * doc/texinfo.txi (deftypeivar[x]): new commands. - * makeinfo/cmds.c (deftypeivar[x]): new commands. + * util/Makefile.am (EXTRA_DIST): add automake-14p1.patch. + * makeinfo/Makefile.am (pkgdata_DATA): define to install + texinfo.dtd. - * makeinfo/cmds.c (cm_exdent): save, set and restore - in_fixed_width_font. + 2001-05-17 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/makeinfo.c (cm_xref, cm_inforef): Don't allow empty + first arguments in cross references. - * doc/texinfo.txi (uref): rewrite. + * makeinfo/makeinfo.c: redo --help, basic patch from ke@suse.de. - * info/info.c (info_short_help): more spaces for new help2man. +2001-05-03 <karl@gnu.org> - * makeinfo/node.c (cm_node): output node name in html, change - navbar punctuation. + * doc/info.texi: move help-cross to be subnode of cross-refs, + instead dangling out in space. + * doc/info.texi: update from eli - * doc/texinfo.5: Fix URL. +2001-05-02 <karl@gnu.org> - * Finally installed this: - 1998-05-01 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - * makeinfo/makeinfo.c (convert_from_loaded_file): When the file - contains no @setfilename then always look for \input (not - \include) in the first line and skip that. Don't skip the first - line if no \input was found. + * makeinfo/xml.c (xml_push_current_element): need to select the + `name' member. -1999-03-24 Akim Demaille <demaille@inf.enst.fr> +2001-05-01 <karl@gnu.org> - * configure.in (AC_HEADER_STAT): Added. - * util/texindex.c (main): Check infiles are not directories. + * configure.in: 4.0b -1999-03-24 Akim Demaille <demaille@inf.enst.fr> + * doc/info.texi (Help-Cross): subsection of Cross-refs. - * texi2dvi (index_files): Don't use `!' to run sed -e "s!foo$!!" - since the shell will interpret `$!'. + * lib/system.h (va_alist, etc.): moved from makeinfo.c. + * makeinfo/makeinfo.c (va_alist, etc.): move to system.h -Tue Mar 23 16:41:08 1999 Karl Berry <karl@gnu.org> + * makeinfo/xml.[ch]: new files from Philippe Martin <feloy@free.fr>. + * pretty much all files also modified for XML/DocBook output. + * doc/texinfo.txi: minimally mention --xml and --docbook. + * makeinfo/xml.c: convert to K&R until we can do ansi2knr. - * doc/texinfo.txi (uref): rewrite to make HTML output read more - nicely. From Tim S. + * util/texindex.c, + * util/install-info.c, + * info/info.c: it's 2001. - * info/info.c (info_short_help): include examples. +2001-04-15 <karl@gnu.org> - * makeinfo/makeinfo.c (close_paragraph_with_lines): move earlier - so can be static. + * doc/info.texi: major update from eli. - * makeinfo/sectioning.c, - * makeinfo/node.c, - * makeinfo/makeinfo.h, - * makeinfo/makeinfo.c, - * makeinfo/macro.c, - * makeinfo/insertion.c, - * makeinfo/cmds.c, - * makeinfo/files.c, - * makeinfo/footnote.c (size_of_input_text): rename to - input_text_length. +2001-04-13 <karl@gnu.org> - * makeinfo/makeinfo.c (cm_xref): make wrong-char-following a warning. - (replace_with_expansion): remove bogus conditional that was duplicated - unconditionally. - From: Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de> + 1999-10-16 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/node.c (cm_node): Don't generate cross-references to + "(DIR)". + * makeinfo/html.c (add_link): Likewise. -Mon Mar 22 14:39:59 1999 Karl Berry <karl@gnu.org> + 1999-10-16 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/makeinfo.c (insert): Don't call html_output_head here. + (add_char): Call html_output_head here... + * makeinfo/cmds.c (cm_sp): ...and here... + * makeinfo/toc.c (cm_contents, cm_shortcontents): ...and here... + * makeinfo/node.c (cm_anchor): ...and here. + + * makeinfo/html.c (html_output_head): `free' html_title if + expanded. Make <head> and <body> stand out. - * doc/Makefile.am (install-tex): parenthesize. +2001-04-12 <karl@gnu.org> - * Makefile.am (dist-hook): remove, it uses hard links so we chmod - all our sources. + 1999-12-26 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/defun.c (defun_internal): Use execute_string instead + add_word_args to expand defined_name, type_name and category (in + HTML mode). - * makeinfo/toc.c, - * makeinfo/defun.c, - * makeinfo/sectioning.c: Use _, not N_. +2001-03-29 <karl@gnu.org> - * info/Makefile.am (ginfo_SOURCES): include $(BUILT_SOURCES) - explicitly. + * Makefile.am: simple license. - * makeinfo/lang.c, - * makeinfo/lang.h: ISO-639 updates. +2001-02-27 <karl@gnu.org> - * makeinfo/cmds.c: exampleindent changes. + 1999-12-17 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> + * info/terminal.h, info/terminal.c (term_kh, term_ke, term_kD): + New variables to hold Home, End, Delete key sequences. + * info/infomap.c (initialize_emacs_like_keymaps, + initialize_vi_like_keymaps): Set them. - * info/info.c (info_short_help): reformat somewhat, and don't say - info info options any more. + * makeinfo/makeinfo.h, + * makeinfo/makeinfo.c: --split-size option from Yoshiki: + 1999-12-09 Yoshiki Hayashi <t90553@mail.ecc.u-tokyo.ac.jp> + * makeinfo/makeinfo.h (split_size): New option. + * makeinfo/makeinfo.c (long_options): Add split_size. + (usage): Ditto. Suggested by Richard Y. Kim. - * doc/info-stnd.texi (Invoking): make description format somewhat - more standard. + * util/texi2dvi: -o support from Akim. - * info/infomap.c (Initialize_info_keymaps): do ea_insert bindings - first so subsequent bindings (e.g., for ESC) override. +2001-02-02 <karl@gnu.org> -Sun Mar 21 17:31:00 1999 Karl Berry <karl@gnu.org> + * dir-example: don't need zsh twice. - * makeinfo/multi.c (output_multitable_row): remove unnecessary - trailing whitespace from output, output blank row for blank @item. + From: Nishio Futoshi <fut_nis@d3.dion.ne.jp>, 02 Apr 2000. + * doc/texinfo.txi: capitalization fixes. + * doc/info.texi: up pointer fixes. + * doc/texinfo.txi: installing an info file. - * doc/texinfo.txi: Remove extra @item in language multitable. + * makeinfo/makeinfo.c: --output is for split html, not non-split. + From: Karl Eichwalder <keichwa@gmx.net> -Sat Mar 20 12:30:25 1999 Karl Berry <karl@gnu.org> +2001-01-12 <karl@gnu.org> - * doc/texinfo.txi: Update language table from ISO 639: - http://www.iro.umontreal.ca/contrib/po/iso-639. From kama. + 1999-10-15 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/cmds.c (cm_sc): Don't print the warning about + all-uppercase argument in menus under --no-headers. - * doc/texinfo.txi (exampleindent): document. + * makeinfo/files.c: pass O_BINARY flag to open, suggested by bfox. - * doc/texinfo.txi (Creating an Info File): use this for the node name. +2001-01-11 <karl@gnu.org> - * doc/info.texi: Make Texinfo references consistent, etc. + * info/terminal.c [HAVE_TERMIOS_H && TCOON]: tcflow TCOOFF/TCCON + to resume output if user presses CTRL-S at the beginning of + things. + [HAVE_TERMIO_H && TCXONC]: ditto. + From Kevin Ryde <user42@zip.com.au>, 16jun2000; + cf. emacs/src/sysdep.c. -1999-03-18 Yoshiki Hayashi <g740685@komaba.ecc.u-tokyo.ac.jp> +2001-01-08 <karl@gnu.org> - * makeinfo/makeinfo.c (set_default_indentation_increment): new - routine. - * makeinfo/insertion.c (cm_exampleindent): new routine. - Call set_default_indentation_increment. + * makeinfo/cmds.c: afivepaper, afourwide, afourlatex. + * doc/texinfo.txi: afivepaper -Mon Mar 15 17:06:15 1999 Karl Berry <karl@gnu.org> +2001-01-05 <karl@gnu.org> - * info/Makefile.am (ginfo_SOURCES): Remove doc.c and funs.h in - hopes they then won't be distributed. Report from Andreas. + * doc/info.texi: typo from: Martin Buchholz <martin@xemacs.org>. + * doc/info.texi: typo fixes from meyering. - * makeinfo/cmds.c (cm_sp): close paragraph and disable filling to - produce blank lines in info. - Report from: Michael Vanier <mvanier@bbb.caltech.edu>. +2001-01-02 <karl@gnu.org> - * doc/texinfo.txi: Attempt to get Edition info on one line. + * makeinfo/makeinfo.c (remember_brace_1): don't assume command is + non-null, an (erroneous) input line like \hbox to7in{ passes in a + null. - * makeinfo/makeinfo.h (cr_or_whitespace): use whitespace and check - for \r. (skip_whitespace_and_newlines, command_char): use it. - Report from bonzini@gnu.org. + * makeinfo/toc.c: fix from jan + * makeinfo/html.c: fix from jan for top-level references. - * makeinfo/cmds.c (cm_center): save and restore filling_enabled, - so @center can be used inside an @example. Bug from kama. +2000-12-22 <karl@gnu.org> -1999-03-13 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/makeinfo.c: --help changes. + * doc/texinfo.txi: -o means the directory name for HTML output. - * makeinfo/footnote.c (cm_footnote): In separate footnote style, - generate a reference to "foo-Footnote-NN" for each footnote. - (output_pending_notes): In separate footnote style, generate an - anchor "foo-Footnote-NN" for each footnote, so that the link in - the parent node would lead directly to the footnote. +2000-12-21 <karl@gnu.org> - * info/footnotes.c (make_footnotes_node): Recognize the new - "foo-Footnote-NN" style of footnote references. + * doc/texinfo.txi: switch to fdl -1999-03-09 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> + * makeinfo/html.c: doc fix. + * makeinfo/insertion.c: no space after _ I guess. + * makeinfo/cmds.c: no space after _ I guess. - * configure.in (AC_OUTPUT): Remove command to create po/Makefile, - already done by AM_GNU_GETTEXT. + * makeinfo/html.c (nodename_to_filename_1): fix up external + * top-node references. -Tue Mar 9 17:48:46 1999 Karl Berry <karl@gnu.org> +2000-12-20 <karl@gnu.org> - * Makefile.am (dist-hook): make distribution directory writable. +* HTML table patch from Jan: + 2000-12-19 Jan Nieuwenhuizen <janneke@gnu.org> - * Installed these changes: + * makeinfo/multi.c (multitable_item), + (cm_tab): close html table columns. Also, align cell contents to + top, which is probably the most sensible thing to do for text. - 1999-03-04 Akim Demaille <demaille@inf.enst.fr> - * texi2dvi (bibtex): Allow several runs of bibtex, this can be - used if bibentries reference other bibentries. Moreover, looking - for `Citation' in the LOG should be enough to avoid uneless runs. +2000-12-19 <karl@gnu.org> - Sun Mar 7 15:15:00 1999 UTC Karl Heinz Marbaise <kama@hippo.fido.de> + * makeinfo/makeinfo.c (insert_toplevel_subdirectory): try + name.html if just name doesn't work. - * makeinfo/sectioning.{c,h}: - - using defines instead of literals. - - cleaned up some stylistic matters like Karl Berry - suggested. Handling of things like: - @unnumbered .. - @section ... - now it works correct. + * doc/texinfo.txi: document html output in .html directory + sometimes. - * makeinfo/toc.{c,h} - - addTocEntry, freeToc changed into toc_add_entry - toc_free. stylistics changed. + * util/Makefile.am (EXTRA_DIST): add install-info-html. - * makeinfo/iso2cht.pl,iso-639: script, table from the web. - - perl script converting the iso-639 table from the web - into the appropiate files (isoenum.h, isotab.c and - iso.texi) which can be inserted directly into - lang.c, lang.h and texinfo.txi. + * util/texindex.c: 2000 + * util/install-info.c: 2000 + * info/info.c: 2000 + * configure.in: 4.0a -Tue Mar 9 17:47:59 1999 Karl Berry <karl@gnu.org> + * lib/system.h: include limits.h - * configure.in: Bump to 3.12g. + * Applied HTML splitting changes from Jan: + 2000-11-10 Jan Nieuwenhuizen <janneke@gnu.org> -Sun Mar 7 07:01:19 1999 Karl Berry <karl@gnu.org> + * makeinfo: removed code for numbered split HTML output, removed + SPLIT_JCN conditional. - * info/infomap.c: Don't do isprint, just bind everything. + 2000-11-09 Jan Nieuwenhuizen <janneke@gnu.org> -Fri Mar 5 14:31:42 1999 Karl Berry <karl@gnu.org> + * makeinfo/html.c: prepared nodifying filename functions for + linking not non-spit HTML documents, by adding ``#anchor'' to + external refernces. - * doc/texinfo.txi, - * makeinfo/makeinfo.c: Document that --no-headers writes to stdout - by default. + * doc/texinfo.txi (Installing HTML info): updated doco for --html + option, added node Installing HTML info. - * doc/texinfo.txi: @setchapternewpage doesn't change - \bindingoffset, just headers. Recommend not including it in the - manual source at all. + * util/install-info-html.in: new script. The bare minimum + required for generating HTML index. - * makeinfo/node.c (write_tag_table_internal): set - in_fixed_width_font while constructing this so --- doesn't - collapse to --, etc. Bug report from Sergio. + * lib/system.h: compilation fix. - * dir-example: Add a2ps stuff. + 2000-11-08 Jan Nieuwenhuizen <janneke@gnu.org> - * info/session.c: Allow any character in search string. + * makeinfo/makeinfo.c (convert_from_loaded_file): [SPLIT_JCN]: + overloaded already way too hairy function with logic to put split + html output into subdirectory with basename of toplevel output + file. - * info/infodoc.c (describe_key): don't assume non-latin1 - characters are undefined. + * makeinfo/html.c (fix_filename): new function. - * info/infomap.c (initialize_info_keymaps): make all characters - insertable by default in echo area. From Eli. + 2000-11-07 Jan Nieuwenhuizen <janneke@gnu.org> - * Installed these changes: + * toc.c (toc_add_entry): + (contents_update_html): + (shortcontents_update_html): [SPLIT_JCN]: use hrefs for nodename based + html files. - Wed Feb 23 22:00:00 1999 Karl Heinz Marbaise <kama@hippo.fido.de> + * node.c (cm_node): [SPLIT_JCN]: create html filename based on + nodename (instead of a numbered node<num>.html filename). - * makeinfo/sectioning.{c,h}: - - added to hold complete handling of sectioning - a little step towards modularization ;-) + * makeinfo/makeinfo.c (main): [SPLIT_JCN]: enable splitting of + html output. - * makeinfo/cmds.c: - - sectioning_alist moved to sectioning.c and - added information about enumerated chapter, - section ..., appendix or not. Everything - which has any relationship with sectioning - moved to sectioning.{c,h} I hope I have found - all. + * makeinfo/html.c + (add_url_name,add_nodename_to_filename,nodename_to_filename): new + functions. - * makeinfo/toc.{c,h}: - - added for complete handling of "table of contents" - "short contents". Better ASCII only support - (--no-headers) so no Text "Menu" is printed. - May be we can do more. +2000-12-15 <karl@gnu.org> - * makeinfo/makeinfo.{c,h}: - - added new command line switch --number to enumerate - chapter, sections etc. + * configure.in (AC_CHECK_HEADERS): add limits.h explicitly. - * doc/texinfo.txi: - - --number option documented. +2000-11-10 <karl@gnu.org> - 1999-02-28 Yoshiki Hayashi <g740685@komaba.ecc.u-tokyo.ac.jp> + * dir-example: update + * info/nodes.c: doc fixes, etc. - * makeinfo/insertion.c (in_paragraph): New variable. - (cm_item): Add </p> only if <p> is open. - * makeinfo/makeinfo.c (handle_menu_entry): Ditto. + * incorporated verbatim patch from janneke: + 2000-04-14 <janneke@gnu.org> - * makeinfo/insertion.c (begin_insertion), - * makeinfo/makeinfo.c (handle_menu_entry): If commentary - precedes first menu item, put them outside of <ul>. - Put <p> and </p> correctly. + * applied texinfo-3.12s.jcn4 patch - 1999-02-27 Eli Zaretskii <eliz@is.elta.co.il> + 1999-09-02 <janneke@gnu.org> - * info/info.c (info_short_help): Document --show-options and - --usage. + * makeinfo/cmds.c, + * makeinfo/insertion.c: @verbatiminclude file + * doc/texinfo.tex: @verbatiminclude file + * doc/texinfo.txi: @vebatiminclude file doco + * NEWS: added @verbatiminclude to Language section - 1999-02-26 Eli Zaretskii <eliz@is.elta.co.il> + 1999-09-01 <janneke@gnu.org> - * info/makedoc.c (main) [STRIP_DOT_EXE]: Strip the .exe suffix, so - that doc.c says "./makedoc.c", not "./makedoc.exe.c". + * makeinfo/makeinfo.c: bf: @exdent (urg6.texi) -- Rolled into 4.0 + * NEWS: added verb* to Language section + * doc/texinfo.txi: @verb, @verbatim doco + * doc/texinfo.tex: tricky tex-fix for @verb{<char>..<char>} + * doc/texinfo.tex: real tab expansion for @verbatim mode + * doc/texinfo.tex: proper start of environment, no indentation - * info/info.c (goto_invocation_p): New variable. - (long_options): New options --show-options and its alias --usage. - (main): Don't update the display until we find the first node to - be displayed, to avoid flushing incorrect display. If user wants - to see the command-line options node right away, display whatever - info_intuit_options_node finds. + 1999-08-31 <janneke@gnu.org> - * info/session.c (info_intuit_options_node): New function, uses - heuristics to find the node which describes program's invocation. - (info_goto_invocation_node): New command, asks for a program's - name and displays the invocation node of that program. - (entry_in_menu): New function, fuzzily looks for a menu entry in a - node's menu. - (program_name_from_file_name): New function, suggests a program - name given a name of its Info file. - (info_search_in_node): Accept an additional argument: a flag to - search case-sensitively; all callers changed. If case-sensitive - search is required, don't turn on the case-fold flag in the search - binding. - (info_search_internal): Accept an additional argument: a flag to - search case-sensitively; all callers changed. Share the last - search string between normal and case-sensitive search commands. - (info_search_1): New function, with the guts that previously - belonged to info_search. If the search is case-sensitive, - mentions that in the prompt for the search string. If the search - string includes upper-case characters, searches case-sensitively. - (info_search): Calls info_search_1 with zero case-sensitivity - flag. - (info_search_case_sensitively): New command, calls info_search_1 - with non-zero case-sensitivity flag. - (incremental_search): If the search - string includes upper-case characters, searches case-sensitively. + * makeinfo/cmds.c: + * makeinfo/insertion.{c,h}, + * makeinfo/makeinfo.{c,h}: redo of @verbatim, @verb{<char>..<char>} + * doc/texinfo.tex: fixed @verb{<char>..<char>} - * info/search.c (search_backward): Fix bug in case-sensitive - search. + 1999-08-30 Jan Nieuwenhuizen <janneke@gnu.org> - * info/infomap.c (initialize_info_keymaps): `-' in info window map - produces negative arguments. `S' invokes case-sensitive search. - `O' and `I' invoke goto-invocation. + * makeinfo/cmds.c, + * makeinfo/insertion.{c,h}, + * makeinfo/makeinfo.{c,h}: added @verbatim (and preliminary @verb) + support + * doc/texinfo.tex: added @verbatim (and preliminary @verb) support - * doc/info-stnd.texi (Invoking Info): Document --show-options. - (Node Commands): Document `O', goto-invocation. - (Searching Commands): Document `S' and the case-sensitive search - when the search string includes upper-case letters. Document `/' - as a synonym for `s'. - (Miscellaneous Commands): Document `M--' and `-'. + 1999-08-24 Jan Nieuwenhuizen <janneke@gnu.org> - 1999-02-25 Eli Zaretskii <eliz@is.elta.co.il> + * bf: empty node: makeinfo/node.c:cm_node () -- Rolled into 4.0 - * info/info.c (main): Under --index-search, search indices *after* - following menus, so that we don't look for an index in DIR. +2000-10-18 <karl@gnu.org> -Wed Mar 3 17:20:07 1999 Karl Berry <karl@gnu.org> + * doc/info.texi: eli update - * makeinfo/cmds.c: Do not output <small> in info mode. - From: Eli Zaretskii <eliz@is.elta.co.il>. +2000-09-22 <karl@gnu.org> - * makeinfo/insertion.c (enum_html): Remove unused var temp. - From: Yoshiki Hayashi <g740685@komaba.ecc.u-tokyo.ac.jp> + * makeinfo/defun.c: warn if non-whitespace follows @defun'd name + (suggestion from Akim). - * info/infodoc.c: Avoid translation of blank lines. + Installed some patches: + + 2000-08-04 Paul Eggert <eggert@twinsun.com> + * makeinfo/multi.c (find_template_width): + Don't access before start of *PARAMS. - * info/tilde.c, - * info/man.c, - * makeinfo/index.c (index_add_arg): avoid use of alloca. + 2000-08-21 Eli Zaretskii <eliz@is.elta.co.il> + * info/filesys.c (info_file_in_path): Reject FILENAME if it is + empty, or ".", or "..". - * info/echo-area.c: Don't pause for an additional 75 microseconds. - Noted by Eli. - - * configure.in: Bump to 3.12f. + 2000-08-23 Eli Zaretskii <eliz@is.elta.co.il> + * info/session.c (info_menu_or_ref_item): If the user have chosen + menu item or xref that's identical to defentry's label, use + defentry instead of looking for its label. Otherwise, select the + entry whose position is the closest to the window's point, in + case there's more than a single entry with that label. - * doc/texinfo.txi: findex enddots. From Eli. +2000-09-12 <karl@gnu.org> -1999-03-01 Yoshiki Hayashi <g740685@komaba.ecc.u-tokyo.ac.jp> + * doc/texinfo.txi: it's 2000 now. + * doc/texinfo.txi: document the only real (and rare) reason for not using implicit pointer + creation. - * makeinfo/makeinfo.c (insert_html_tag): Add <p> when - paragraph is not opened. - (sectioning_html): Call close_paragraph so that paragraph - will be started. +2000-09-06 <karl@gnu.org> -1999-02-26 Akim Demaille <demaille@inf.enst.fr> + * configure.in: test all termcap variables for existence. From + andy@rz.uni-karlsruhe.de. - * texi2dvi (get_xref_files): Take $filename_noext as $1. - (get_xref_files): Look for $1.idx only, not *.idx. - (get_xref_files): Look for $1.cb files (\usepackage{changebar}). - * texi2dvi: Look for rerun requests in LOG files in addition to - xref files comparison. - (bibtex): Remove useless `./' (already added in - command_line_filename). - (filename_dir): Smarter sed expression that handles file names - with no directory part. - (txiversion): Removed useless () (`` already guarantee a subshell). + * configure.in (ALL_LINGUAS): include ja. + * lib/system.h [HAVE_IO_H]: make #include <io.h> conditional for + BeOS. Reported by Dan Moore, dan@moore.cx. + * configure.in (AC_CHECK_HEADERS): add io.h. -1999-02-25 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> +2000-06-05 <karl@gnu.org> - * makeinfo/multi.c (find_template_width): Fix operator precedence. + * doc/texinfo.txi: forgot to escape {}. -Tue Feb 23 10:35:53 1999 Karl Berry <karl@gnu.org> +2000-05-30 <karl@gnu.org> - * dir-example: ccmode not cc-mode. From hds. + * info/filesys.c (is_dir_name): check all info suffixes as well as + the compression suffixes. Fixes segmentation fault on a dir.info + file ending after the * Menu. -Mon Feb 22 07:34:00 1999 Karl Berry <karl@gnu.org> +2000-05-28 <karl@gnu.org> - * makeinfo/lang.c, - * doc/texinfo.txi: Fix kazakhkh typo. + * doc/texinfo.txi: Forgot {arg} in @rmacro example. From Olaf B. -1999-02-21 Eli Zaretskii <eliz@is.elta.co.il> +2000-05-27 <karl@gnu.org> - * djgpp/config.sed: Add pcterm.c to terminal.o dependencies. + * doc/txi-cs.tex: update from: Stepan Kasal <kasal@suse.cz>. -1999-02-21 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> + * doc/Makefile.am (install-data-local): reformat warning per + François to hopefully make it more noticeable. - * makeinfo/lang.c (cm_accent_generic): Emit the accent character - only once, after the argument. + 2000-02-08 Eli Zaretskii <eliz@is.elta.co.il> + * info/session.c (incremental_search): Don't retain RET when + exiting isearch. Suggested by Hrvoje Niksic <hniksic@iskon.hr>. -Sun Feb 21 16:36:14 1999 Karl Berry <karl@gnu.org> +2000-05-22 <karl@gnu.org> - * makeinfo/makeinfo.c (handle_menu_entry): new routine. - (reader_loop): call it, allowing for comments in menus. + * doc/texinfo.txi: pageparams -> pagesizes - * makeinfo/node.c: Rearrange functions to make static, etc. +2000-05-18 <karl@gnu.org> - * doc/Makefile.am (EXTRA_DIST, install-tex): Add txi-cs and txi-no. + * makeinfo/lang.c (cm_accent_tilde): need N in list. + From: kama@hippo.fido.de (Karl Heinz Marbaise) -1999-02-20 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/files.c (find_and_load): read only the number of bytes + available in the buffer. Also, remove one-byte-at-a-time reading + in the WIN32 case. + From: "J. David Bryan" <dbryan@bcpl.net> - * util/install-info.c (open_possibly_compressed_file): Output - explicit message about empty input files. - (insert_entry_here): Insert multiple entries in alphabetical order. + * info/man.c: use eli's patch after all, we re-increment j at the + top of the loop. -Fri Feb 19 09:13:28 1999 Karl Berry <karl@gnu.org> +2000-05-16 <karl@gnu.org> - * makeinfo/insertion.c (enum_html): new routine. - (begin_insertion): call it. - Based on code from: Yoshiki Hayashi <g740685@komaba.ecc.u-tokyo.ac.jp>. + * info/man.c (clean_manpage): don't write before the beginning of + newpage. + (based on patch from Eli). - * lib/xexit.c (EXIT_FAILURE) [!defined EXIT_SUCCESS && VMS]: weird - long value. - From: Lars Hecking <lhecking@nmrc.ucc.ie> +2000-02-03 <karl@gnu.org> -Thu Feb 18 16:42:10 1999 Karl Berry <karl@gnu.org> + * doc/texinfo.txi: remove spurious space. from kaja. - * makeinfo/node.h (remember_node_reference): decl. - * makeinfo/makeinfo.c (find_unused_reference): dump unused decl. +1999-10-12 Karl Berry <karl@gnu.org> -1999-02-18 Eli Zaretskii <eliz@is.elta.co.il> + * doc/Makefile.am (install-tex): install all txi-?? files. - * makeinfo/cmds.c (cm_dots, cm_enddots): Don't produce … for - HTML, as too many browsers don't support it; use "..." in a - smaller font. - (cm_top): Output the lang= attribute inside <html>. +1999-10-01 W. L. Estes <will@fumblers.org> - * makeinfo/node.c (cm_node): Output the lang= attribute inside - <html>. + * makeinfo/cmds.c: dont treat @center as separate paragraph, + use div element to output center - * makeinfo/footnote.c (output_pending_notes): Generate <ol> - instead of <dl compact>. Make the text of each footnote start a - new paragraph. +1999-09-29 Eli Zaretskii <eliz@is.elta.co.il> -1999-02-17 Eli Zaretskii <eliz@is.elta.co.il> + * djgpp/README: Say `dir-example', not DIR. - * makeinfo/insertion.c (cm_item): Remove <dd> when immediately - followed by a <dt>. Add a <br> before every <dt>, except if we - are converting @itemx, or in the first item after <dl>. - (begin_insertion): Use <dl> for tables, to make it look closer to - the Info output. Don't output a newline after a <pre>. + * lib/system.h (DEFAULT_INFOPATH) [__DJGPP__]: Define. -1999-02-17 Eli Zaretskii <eliz@is.elta.co.il> +1999-09-28 Karl Berry <karl@gnu.org> - * makeinfo/makeinfo.c (handle_variable): Don't backup input - pointer if we hit the end of text (usually, inside - execute_string). - * makeinfo/insertion.c (get_item_function): Likewise. + * configure.in, + util/texi2dvi: version 4.0. + * doc/texinfo.txi: New isbn. -Wed Feb 17 15:09:06 1999 Karl Berry <karl@gnu.org> +1999-09-24 Karl Berry <karl@gnu.org> - * doc/texinfo.txi: Better indexing of space entries. + * doc/texinfo.txi: Fixes from Oleg. - * makeinfo/multi.c (find_template_width): new routine to really - parse @multitable {...} templates. - (setup_multitable_parameters): call it. - Bug report from: Sergio Pokrovskij <pok@nbsp.nsk.su>. +1999-09-20 Karl Berry <karl@gnu.org> - * lib/system.h (substring): declare. + * makeinfo/node.c: Don't write region at an anchor. + From: Thomas Esken <esken@nmlab.informatik.fh-dortmund.de> - * lib/Makefile.am (libtxi_a_SOURCES): add substring.c. + * info/terminal.c: Only set dumb terminal if tgetent returns < 0, + not 0. + For HP-UP 11. + From jeff.hull@state.co.us. - * makeinfo/defun.c: Move substring to lib. + * makeinfo/footnote.c: Don't translate the `Footnotes' string + according to LANG, it should be according to + @documentlanguage, which isn't implemented yet. + From: Jan Nieuwenhuizen <janneke@gnu.org> - * util/texindex.c (tempcopy): no longer used. - (maketempname): make static. + * doc/texinfo.txi: @end direntry from kama. - * Installed these changes: +1999-09-19 Karl Berry <karl@gnu.org> -1999-02-13 Eli Zaretskii <eliz@is.elta.co.il> + * doc/texinfo.txi: \ninett is now \smalltt. - * makeinfo/cmds.c (cm_acronym): New function, makes @acronym - produce a smaller font size in HTML mode. - (cm_sc): Produce smaller font size in HTML mode. + * doc/texinfo.txi: arnold changes - * makeinfo/footnote.c (cm_footnote): In HTML output, make the - footnote number be a superscript; remove [] around the link. + 1999-09-03 Akim Demaille <akim@epita.fr> + * texi2dvi (getopt): batch has to be assigned `eval', not `echo'. + (bibtex): Launch BibTeX also when the LOG file complains that + there are no BBL file. - * makeinfo/cmds.c (cm_var_sc): Separated into two functions: - cm_var and cm_sc, since @var and @sc have different effects in - HTML output. + * doc/texinfo.txi: Document that @anchor ignores spaces. - * makeinfo/makeinfo.c (cm_xref, cm_inforef): Don't put "[]" around - HTML links. + * makeinfo/cmds.c (cm_shyph): remove, ­ is not supported in + browsers. + From: Thomas Esken <esken@nmlab.informatik.fh-dortmund.de> - * info/pcterm.c (DJGPP_keytab): Add translation for Alt-PgUp and - Alt-PgDn, to support the new M-prior key. + * makeinfo/makeinfo.c: Don't crash if current_indent = 0. + From: Jan Nieuwenhuizen <janneke@gnu.org> -Wed Feb 17 11:50:46 1999 Karl Berry <karl@gnu.org> + * makeinfo/makeinfo.c: Avoid blank lines between @menu entries. + * configure.in: 3.12t - * doc/texinfo.txi: Don't mention texi2roff so prominently. + 1999-08-31 Eli Zaretskii <eliz@is.elta.co.il> + * info/info.c (info_short_help): Document --apropos. - * makeinfo/makeinfo.c: Pass enclose_expand to remember_brace - rather than enclose_command. From Eli. +1999-09-18 Karl Berry <karl@gnu.org> - * makeinfo/macro.c (cm_alias, cm_definfoenclose): Expand macros in - first call to get_until_in_line. From Eli. + * makeinfo/html.c (html_output_head): use text for <title>, not + html markup. From François. + * makeinfo/makeinfo.c (text_expansion): new routine. + * makeinfo/cmds.c (cm_settitle): don't expand the title here, + we'll do it later. - * info/makedoc.c, + * makeinfo/makeinfo.h (text_expansion): declare. + + * info/indices.c, + * info/infodoc.c, * info/session.c, - * info/man.c, - * info/tilde.c, - * info/info.c, - * makeinfo/files.c, - * makeinfo/multi.c, - * makeinfo/node.c, - * makeinfo/makeinfo.c: Use xexit. - * makeinfo/makeinfo.h (NO_ERROR, FATAL, SYNTAX): remove. + * info/footnotes.c: translate errors. + * info/info.h: Use `' instead of "" in errors. - * info/terminal.c: Avoid sleep unless on sun-cmd terminal. +1999-09-06 Karl Berry <karl@gnu.org> - * lib/xexit.c (EXIT_FAILURE) [!EXIT_FAILURE]: #define to 1 to fix - Sony NEWS-OS 4.0C lossage. From Akim. + +1999-08-24 Jan Nieuwenhuizen <janneke@gnu.org> + * makeinfo/node.c:cm_node: don't compare current_node when null. - * info/infodoc.c: Translate where is doc string, underline lines - in help. - From: Trond Endrestol <trond@agamemnon.gtf.ol.no> + 1999-08-23 W. L. Estes <will@fumblers.org> + * makeinfo/node.c (cm_node): write <a name=> tags even + ifusing --no-headers - * makeinfo/cmds.c (cm_dots, cm_enddots): go back to ... and ...., - … apparently doesn't work widely enough. + * configure.in: ospeedlib -> trylib + From: Andreas Schwab <schwab@suse.de> -Tue Feb 16 07:37:54 1999 Karl Berry <karl@gnu.org> + * makeinfo/makeinfo.c (read_command): add explicit 0 to return if + enclosure command. From: Andreas Jaeger <aj@arthur.rhein-neckar.de>. - * configure.in (ALL_LINGUAS): add de_AT. +1999-08-19 Karl Berry <karl@gnu.org> - * util/texi2dvi: Redirect cd output to /dev/null when determining - txiversion. + * configure.in: add missing quotes, logic in new termcap library + check. -Mon Feb 15 13:43:37 1999 Karl Berry <karl@gnu.org> +1999-08-17 Karl Berry <karl@gnu.org> - * util/install-info.c, - * util/texindex.c: Call xexit instead of exit. + * makeinfo/multi.c, + * makeinfo/sectioning.c, + * makeinfo/node.c, + * makeinfo/macro.c: omit unused vars + * info/session.c (info_goto_invocation_node): omit unused decl. - * lib/system.h (xexit): Declare. + * configure.in: Check for extra termlib variable necessary on + HP-UX 9. + From: Olaf Bachmann <obachman@mathematik.uni-kl.de> - * lib/Makefile.am (libtxi_a_SOURCES): Add xexit.c. + 1999-08-16 Andreas Schwab <schwab@suse.de> + * info/terminal.c (terminal_initialize_terminal): Try tcgetattr + and cfgetospeed in preference to TIOCGETP. + (original_tchars, original_ltchars): Define them only if needed. - * doc/texinfo.txi: Document that @documentencoding is used in the - HTML output. +1999-08-16 Karl Berry <karl@gnu.org> - * makeinfo/cmds.c (cm_top): use document_encoding if set. - (command_table): call cm_documentencoding instead of no-op. - * makeinfo/lang.c (document_encoding, cm_documentencoding): define. - * makeinfo/lang.h (document_encoding, cm_documentencoding): declare. + * info/infodoc.c (create_internal_info_help_node): rename arg. + (info_find_or_create_help_window): avoid deref of null eligible. - * makeinfo/insertion.c: Restore </p> before <li>. + * info/terminal.c (TIOCGETP, TIOCGETC, TIOCGLTC) [alpha && linux]: + #undef. Useless stubs are present. - * util/texi2dvi: If texinfo.tex version is too low for macros, use - makeinfo. +1999-08-15 Karl Berry <karl@gnu.org> - * makeinfo/cmds.c (cm_center): save and restore value of - indented_fill, otherwise @center within an @enumerate (say) - also closes the indentation. - Bug from: Sergio Pokrovskij <pok@nbsp.nsk.su>. + * info/nodes.c: Remove reference to nonexistent RFC for Info + files. -Sun Feb 14 15:25:02 1999 Karl Berry <karl@gnu.org> +1999-08-11 Eli Zaretskii <eliz@is.elta.co.il> - * makeinfo/makeinfo.c: Doc fix. + * info/nodes.c (info_find_file_internal): If the file's contents + were gc'ed since last time it was loaded, reload the file. - * doc/texinfo.txi: Be enthusiastic if people want to implement - more output formats, but use makeinfo to do the job. +Wed Aug 11 06:42:47 1999 Karl Berry <karl@gnu.org> - * makeinfo/index.c (index_element_compare): Use strcoll if it's - available. - * configure.in: Call AC_FUNC_STRCOLL. - * makeinfo/makeinfo.c (main): Use LC_CTYPE and LC_COLLATE - categories. Suggestion from Oleg. + * doc/Makefile.am (EXTRA_DIST): add txi-pt.tex from Lalo. - * lib/system.h (setlocale) [!HAVE_SETLOCALE]: #define away. - Suggestion from Akim. +Mon Aug 9 16:28:18 1999 Karl Berry <karl@gnu.org> - * doc/texinfo.txi: Document @paragraphindent working in TeX now. + * util/texi2dvi: Support preloaded texinfo.tex, from Stephen. - * doc/texinfo.txi, - * makeinfo/lang.c, - * makeinfo/lang.h (language_code_type): abbrev changes from Oleg. + * makeinfo/makeinfo.c (add_char): restore ugly check for first + character being <. - * makeinfo/cmds.c, - * makeinfo/node.c: Only translate `Next:', `Previous:', and `Up:', - not the whole href. From Eli. + * makeinfo/cmds.c (cm_kbd): Increment in_fixed_width_font for + html. - * doc/texinfo.txi: Document that only unsplit html output is - supported in this release. + * doc/texinfo.txi: effect not affect -Sat Feb 13 17:55:30 1999 Karl Berry <karl@gnu.org> + * makeinfo/makeinfo.c: Rearrange help. - * configure.in: Check for termlib before termcap for sake of - Solaris (judging from less-332 configure.in) and maybe - HP-UX 11. + * makeinfo/toc.c: Cast %* arguments to (int) to placate gcc + -Wformat. - * doc/texinfo.txi (Footnote commands): incoherency reported by Aharon. - Language vs country fixes from Oleg. +Fri Aug 6 13:03:14 1999 Karl Berry <karl@gnu.org> -1999-02-13 Karl Eichwalder <ke@gnu.franken.de> + * util/install-info.c: Hardwire the File: dir, Node: top part of + the skeleton dir file. + Report from: Stanislav Brabec <utx@k332.feld.cvut.cz> - * makeinfo/node.c (cm_node): Tag navigation links as translatable. - * makeinfo/cmds.c (cm_top): Ditto. + * info/Makefile.am (BUILT_SOURCES): rm -f $(BUILT_SOURCES), a + kludge. -Wed Feb 10 22:00:00 1999 Karl Heinz Marbaise <kama@hippo.fido.de> + 1999-07-28 Karl Eichwalder <ke@gnu.franken.de> - * makeinfo/defun.h: - - new because we need get_base_type-function - accessible in insertion.c + * makeinfo/makeinfo.c: Fix help string (-o). - * makeinfo/defun.c: - - complete HTML handling of the @def... things. + 1999-07-30 Eli Zaretskii <eliz@is.elta.co.il> - * makeinfo/Makefile.am: - - defun.h added as part of makeinfo. + * makeinfo/makeinfo.c (cm_uref, cm_email): Don't collapse -- and + `` in the URL part of the reference. - * makeinfo/makeinfo.c: - - define looking_at moved into header-file, because - we need it in defun.c + 1999-08-03 Eli Zaretskii <eliz@is.elta.co.il> - * makeinfo/insertion.c: - - some minor changes made to support the @def... - things in HTML. - - * makeinfo/lang.c: (cm_accent_generic) - - bug fixed. Using umlaut (accent ...) - would produce &A only if an umlaut follows - an empty line. - - bug fixed. Because things like ˜ ` - and ˆ do not exist as standalone characters - in HTML. - - cm_special_char now produce correct HTML for - @O{} and @o{}. - - warning using _("Text") instead "Text" (gettext). + * util/install-info.c (main): For entries given on command line, + set entry_sections and entry_sections_tail members to NULL, and + set text_len member to the entry length. After processing the + Info file, update the entry_sections pointers of all entries that + came from the command line. - * makeinfo/cmds.c: - - @url fixed. Display the given Text. + * util/texindex.c (sort_offline, sort_in_core): use off_t rather + than long. + Found on FreedBSD 2.2.8 by "Trond Endrestol" <endrestol@hotmail.com>. - * doc/texinfo.txi: - - corrected the references for @uref, because - they were given as "url" instead of "uref". - @uref has three arguments, so show them in - command list. +Mon Jul 19 17:16:46 1999 Karl Berry <karl@gnu.org> -Wed Feb 10 17:27:58 1999 Karl Berry <karl@gnu.org> + * configure.in: 3.12n - * doc/texinfo.txi: Rewrite for overfull box. + * makeinfo/makeinfo.c (add_char): Don't insert <p> if we're in + @html. -Tue Feb 9 19:03:16 1999 Karl Berry <karl@gnu.org> + * makeinfo/html.c (add_escaped_anchor_name), + * makeinfo/toc.c (toc_add_entry): use URL_SAFE_CHAR. + * makeinfo/makeinfo.h (HTML_SAFE, URL_SAFE_CHAR): new macros. - * doc/texinfo.txi: Document more HTML output stuff. Based on esr - changes. - * makeinfo/macro.c, - * makeinfo/macro.h, - * makeinfo/makeinfo.c: Do alias and definfoenclose expansion. - From esr. +Sun Jul 18 14:47:40 1999 Karl Berry <karl@gnu.org> -Mon Feb 8 14:41:07 1999 Karl Berry <karl@gnu.org> + * dir-example: Add bzip2. - * makeinfo/cmds.c: New commands @alias and @definfoenclose. - From: "Eric S. Raymond" <esr@snark.thyrsus.com>. + * configure.in: 3.12m. - * doc/texinfo.txi: Document @documentlanguage and - @documentencoding. + * doc/texinfo.txi (@afourlatex,@afourwide): add to command list. - * makeinfo/cmds.c: Move accent support to lang.c. +1999-07-17 Eli Zaretskii <eliz@is.elta.co.il> - * makeinfo/makeinfo.c (add_char): add   rather than an 8-bit - char for html. + * makeinfo/makeinfo.c (cm_xref): Don't collapse `` and -- while + expanding node names. Generate a terminating period for + @pxref, when it has more than a single argument. - * makeinfo/Makefile.am (makeinfo_SOURCES): add lang.[ch]. + * makeinfo/index.c (cm_printindex): Don't collapse `` and -- while + expanding node names. - * doc/texinfo.txi: Be even more emphatic that @url is not - typically what you want. - * doc/texinfo.txi: Document that macro calls must use empty - braces. +Sat Jul 17 16:33:45 1999 Karl Berry <karl@gnu.org> - * info/session.c: Do not translate node pointers. From Karl E. + * 3.12l. - * makeinfo/cmds.c (cm_dfn): Use <dfn>. Suggestion from Eli. + * doc/texinfo.txi: @alias, @definfoenclose, etc. -Sun Feb 7 07:00:08 1999 Karl Berry <karl@gnu.org> + * util/texindex.c (indexify): error message instead of abort(2) + when no page number. - * makeinfo/makeinfo.c: Make --html imply --no-split. +Fri Jul 16 18:00:26 1999 Karl Berry <karl@gnu.org> - * makeinfo/cmds.c (cm_top): don't core dump if the top node has no - next. + * doc/texinfo.txi: Overfull boxes, help2man, etc. - * makeinfo/makeinfo.c (replace_with_expansion): compare length - after expansion with length of full input text before - expansion, not just the length of the expanded text. - Bug (contents2) reported by kama. + * util/Makefile.am (EXTRA_DIST): texi-outline.gawk is really + outline.gawk, add fixref.gawk and prepinfo.awk and + texi-docstring-magic.el. - * info/infodoc.c (create_internal_info_help_node): gettext calls - to help msg strings. From Ulrich. +Thu Jul 15 18:57:54 1999 Karl Berry <karl@gnu.org> -Fri Feb 5 17:35:13 1999 Karl Berry <karl@gnu.org> + * doc/texinfo.txi: .fmt, etc. + * doc/texinfo.txi: More macro docs, etc. - * util/texi2dvi: set makeinfo= for latex case. +Wed Jul 14 19:58:47 1999 Karl Berry <karl@gnu.org> - * doc/texinfo.txi (@deftp summary): ref Data Types node that - actually describes it. From kama. + * doc/texinfo.txi: Give good quote. -Thu Feb 4 07:39:10 1999 Karl Berry <karl@gnu.org> + * util/Makefile.am (EXTRA_DIST): add texi-outline.gawk. - * makeinfo/makeinfo.c: Take it back. Emacs info needs that text - before the CTRL-_. - * makeinfo/makeinfo.c: Don't bother to output the header (This is - -, produced ...) to stdout. + From: kama@hippo.fido.de (Karl Heinz Marbaise) + * makeinfo/toc.c (contents_update_html): go back to start level. + * doc/texinfo.txi: deftypeop - * doc/texinfo.txi (Other Info Directories): Mention that dir files - must be named dir. + From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> + * makeinfo/toc.c (toc_add_entry): don't assume sprintf return type + is int. + * makeinfo/sectioning.c (insert_and_underscore): declare more + unsigned char *. + * makeinfo/macro.h (itext_info, itext_size): remove declarations, + they're defined static. + * makeinfo/makeinfo.c: Split up help string even more. - * makeinfo/makeinfo.c (cm_uref): implement optional third - argument. - * doc/texinfo.txi (uref): document it. - Suggestion from: Charles Karney <karney@pppl.gov> +Tue Jul 13 17:16:18 1999 Karl Berry <karl@gnu.org> - * doc/Makefile.am (info_TEXINFOS): put texinfo.txi first so - UPDATED reflects its modtime, rather than info-stnd's. + * doc/texinfo.txi: Document @rmacro. + * makeinfo/macro.c (cm_rmacro): new command to do @allow-recursion + by default. + (define_macro): split off from cm_macro. - * makeinfo/files.c (full_pathname) [!WIN32]: #endif in wrong place. - From: Yoshiki Hayashi <g740685@komaba.ecc.u-tokyo.ac.jp> + * makeinfo/macro.h (cm_rmacro): declare. + * makeinfo/macro.h (delete_macro): do not need to export. + * makeinfo/cmds.c (rmacro): new command. - * makeinfo/cmds.c (cm_url): Remove URL: from output. It's ugly. + * makeinfo/html.c, + * makeinfo/toc.c, + * makeinfo/lang.c, + * makeinfo/makeinfo.c: Use strchr instead of member. -Wed Feb 3 16:05:03 1999 Karl Berry <karl@gnu.org> +Mon Jul 12 08:01:19 1999 Karl Berry <karl@gnu.org> - * info/infodoc.c: Doc fix, zero not oh. + * doc/texinfo.txi: document this. + * makeinfo/macro.c (apply): warn if \ in macro body is not + followed by a parameter name or \, instead of silently + accepting it, for compatibility with TeX. - * makeinfo/makeinfo.c (add_char): don't ignore if - only_macro_expansion, even in no_headers case. - Otherwise menu items don't get remembered and defaulting - doesn't work. Macros suck! + * makeinfo/macro.c: Doc fix. - * util/texi2dvi (common): include orig_pwd. - (language): reguess for each file if not explicitly set. +Sun Jul 11 12:49:50 1999 Karl Berry <karl@gnu.org> -Tue Feb 2 16:22:32 1999 Karl Berry <karl@gnu.org> + * makeinfo/macro.c (cm_macro): do @quote-arg implicitly if single + argument to macro. + * doc/texinfo.txi: Document this. - * configure.in: Bump to 3.12d now. + * doc/texinfo.txi (Smallcaps): Document makeinfo warning if arg is + all uppercase. + * makeinfo/cmds.c (cm_sc): warn if arg is all upper (suggested by + Jim Meyering). -Mon Feb 1 14:46:45 1999 Karl Berry <karl@gnu.org> + * makeinfo/cmds.c (cm_var): warn if argument contains any of ,[]() + which are unlikely to be allowable in real variable names. + Suggested by rms. - * makeinfo/insertion.c (cm_item): For itemize and enumerate, do - </p> before the <li> for html. Bug from Eli. + * makeinfo/makeinfo.h (member): remove weird masking macro. - * makeinfo/index.c: Installed change in index.c: - Mon Dec 28 12:50:14 1998 Matthew Fredette <fredette@mit.edu> - * makeinfo.c (index_add_arg): Use xstrdup on input_filename - when saving it in the new index entry. + * doc/texinfo.txi: Probably ok to indent @example. - * util/texi2dvi: cd / before cd $orig_pwd in case of DOS drive - change. + * configure.in: 3.12k. -Sun Jan 31 16:39:01 1999 Karl Berry <karl@gnu.org> + * makeinfo/html.c (add_escaped_anchor_name): Cast to unsigned char + for 8-bit chars. From Yoshiki. - * util/texi2dvi: Used sed to expand only the @{if,}tex parts of - the source since makeinfo's conditional options aren't ready yet - (from Akim). - Also use ${1+"$@"} for Digital Unix "$@" expansion bug (from Noah). + * makeinfo/makeinfo.c: complain -> warn for sake of <80 chars. - * util/install-info.c: Doc fix from Eli. +1999-07-09 Eli Zaretskii <eliz@is.elta.co.il> - * doc/texinfo.txi: Oops, said we looked for .png twice. + * makeinfo/multi.c (multitable_item): Quote the value of align= + property. -Sat Jan 30 17:18:14 1999 Karl Berry <karl@gnu.org> + * makeinfo/defun.c (defun_internal): Ditto. - * info/session.c (forward_move_node_structure): remove tangled - code to merely print words instead of numbers; too hard to translate. + * makeinfo/cmds.c (cm_center): Ditto. - * info/session.c: Missing _'s for more i18n. From Trond. + * makeinfo/toc.c (toc_add_entry): New argument ANCHOR; all callers + changed. In HTML mode, expand NODE_NAME, or use ANCHOR, if + non-NULL, and save it together with the TOC name in the name + member of the TOC entry. + (toc_add_entry, toc_find_section_of_node): Add a warning in a + comment that the NODE argument must be unexpanded. + (contents_update_html): Terminate the TOC entry with </a>. - * doc/Makefile.am (EXTRA_DIST): Include txi-no.tex from Trond. + * makeinfo/sectioning.c (sectioning_html): If the sectioning + command is outside any node, generate explicit anchor and pass it + to toc_add_entry. -Sun Jan 24 09:28:12 1999 Karl Berry <karl@gnu.org> + * makeinfo/node.c (expand_node_name): Now external instead of + static. + (cm_node): Output expanded node name in the navigation bar. - * Makefile.am (EXTRA_DIST): Use djgpp by itself instead of listing - each file separately (new feature in automake 1.4). + * makeinfo/node.h: Declare expand_node_name. - * makeinfo/insertion.c (begin_insertion): for quotation, always - increment current_indent even if html output, why not. - (Otherwise must not decrement current_indent in end_insertion.) + * makeinfo/index.c (cm_printindex): Produce valid HTML links, even + if index->node is NULL or empty. Fix format of index under + --no-headers. - * doc/texinfo.txi: More overfull box fixes. +Fri Jul 9 18:09:28 1999 Karl Berry <karl@gnu.org> - * makeinfo/insertion.c: Add some assertions and the beginnings of - handling @tex. + * doc/texinfo.txi: Pair @end html properly. From Olaf B. - * doc/texinfo.txi: Fix overfull boxes, but tables of contents at - the front. + * doc/Makefile.am (EXTRA_DIST): add txi-nl.tex from Marcel van der Boom + <marcel@virtualprojects.org>. - * util/texi2dvi: Can't pass --no-ifinfo --iftex to makeinfo yet, - it's not ready. + * doc/txi-en.tex: Doc fix. -Sat Jan 23 10:22:16 1999 Karl Berry <karl@gnu.org> +Wed Jul 7 16:07:44 1999 Karl Berry <karl@gnu.org> - * util/texi2dvi: Pass --no-ifinfo --iftex to makeinfo. + * doc/Makefile.am: Doc fix. -Fri Jan 22 19:09:49 1999 Karl Berry <karl@gnu.org> + * configure.in (txi_CHECK_DECLS): call this new macro (in + acinclude.m4). + * acinclude.m4: new file. - * doc/texinfo.txi: Include version.texi before @settitle so - @value{VERSION} gets expanded in the html title. From kama. +Tue Jul 6 19:12:37 1999 Karl Berry <karl@gnu.org> - * These patches from Tim Singletary <talon@clark.net>. - * makeinfo/makeinfo.c: Simplify and improve html menus. - * makeinfo/insertion.c (begin_insertion): simplify html menu case - and set had_menu_commentary. - * makeinfo/insertion.h (had_menu_commentary): declare new global. - * makeinfo/node.h (glean_node_from_menu): declare. - * makeinfo/node.c (glean_node_from_menu): new arg to specify what - type of reference to remember as. + * makeinfo/insertion.h, + * makeinfo/insertion.c, + * makeinfo/cmds.c, + * makeinfo/defun.c: new command @deftypeop. + Suggestion from: booth@us.ibm.com. - Date: Sun, 29 Nov 1998 09:21:01 -0500 (EST) - From: Tim Singletary <tsingle@talon.clark.net> - To: texinfo-pretest@tug.org - Subject: explanation of previous patches +1999-07-05 Eli Zaretskii <eliz@is.elta.co.il> - > These diffs introduce some non-trivial changes into very - > sensitive parts of makeinfo, and it is hard to judge them without - > knowing what exactly do they solve. + * makeinfo/makeinfo.c (cm_value): Don't convert quotes and dashes + in the argument of @value, since @set doesn't. - At a high level, these patches fix (or at least significantly improve) - the html conversion of menus. Specifically, they fix bugs in the - conversion of menu commentary and detailmenu entries. +Mon Jul 5 16:43:23 1999 Karl Berry <karl@gnu.org> - The menu commentary fixes require some justification: The unpatched - makeinfo attempts, with many bugs, to place menu commentary outside - the <menu> by adding </ul> and <ul> tags. While I understand the - motivation for this, that there might be browsers that don't support - <p> within <menu>, I'm not aware of any such browser and don't see any - compelling reason to continue the </ul> kludge. + * makeinfo/insertion.c (get_item_function): return "@ " rather + than "@". (command_needs_braces): new fn. + (cm_item): handle @itemize markers that don't take braces. + Bug reported by Stephen, prototype fix from Yoshiki. - Certainly - <menu> - <li>First paragraph. - <p>Second paragraph. - <li>Second item. - </menu> - is valid html! + * doc/texinfo.txi (Contents): @contents ignored at beginning when + outputting to stdout. + Installed this. +>1999-05-02 Eli Zaretskii <eliz@is.elta.co.il> +> * makeinfo/toc.c (cm_contents, cm_shortcontents): If writing to +> stdout, output the contents and short contents immediately, and +> assign NULL to contents_filename and shortcontents_filename, so +> that toc_update won't try to rewrite stdout. - Anyway, here's what my patches do: - 1) Deleted the `<h4>Menu</h4>' at the beginning of each menu. Using - `<h4>' is wrong since menus don't usually come after an `h3' - header. `<b>' looks the same on most browsers, but my opinion is - that there's no need for any header at all! + * makeinfo/sectioning.c (sectioning_html): declare starting_pos + and ending_pos as unsigned char * since they're based on + output_paragraph. - 2) Deleted the `<li>' kludge at the begining of each menu. It's no - longer needed since I'm deleting the </ul> kludge. + * makeinfo/insertion.c: Cast output_paragraph to char * for sake + of strncmp prototype (on IRIX 4). + From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> - 3) Replace `in_menu_para', declared static in makeinfo.c:add_char() - with `had_menu_commentary', declared globally. Modified - insertion.c:begin_insertion() to initialize had_menu_commentary to - 1 when beginning a menu. Now there's enough state information for - menu commentary to be processed within <menu> ... </menu>; the - commentary can be seperated from the rest of the menu by bracketing - it between <p>'s. - Note that the first patch had a bug initializing - had_menu_commentary; the second patch fixes this bug. + * info/man.c (get_manpage_contents): restore previous (default) + SIGCHLD handler so the pclose when gunzipping info files + doesn't fail with `No child processes' (because + reap_children reaped it). + From: Josip Rodin <jrodin@public.srce.hr> + njs@uclink4.berkeley.edu, 38063-forwarded@bugs.debian.org - 4) Changed the semantics of the argument to - node.c:glean_node_from_menu(). Previously, glean_node_from_menu() - only called remember_node_reference() when the argument was - non-zero. But add_char() didn't call `glean_node_from_menu(1)' - when processing detailmenu entries. In other words, detailmenu - entries didn't get registered as references, which lead to the html - conversion of detailmenu entries not producing proper hrefs! +Fri Jul 2 14:26:22 1999 Karl Berry <karl@gnu.org> - The new semantics are that glean_node_from_menu always calls - remember_node_reference(), but calls it with `menu_reference' when - the first arg to glean_node_from_menu() is 1 and with - `followed_reference' otherwise. Now, detailmenu entries get - registered as `followed_reference' (normal menu entries still get - registered as `menu_reference') and the html conversion produces - proper hrefs. + From gildea: + * info/terminal.c (TIOCGETC) [M_XENIX && TIOCGETC]: #undef. + * info/session.c (strncasecmp) [M_XENIX]: declare. - 5) The above changes made it possible to streamline the section of - add_char() that deals with html menu text. +Thu Jul 1 19:25:12 1999 Karl Berry <karl@gnu.org> - 6) In an otherwise unrelated change, rewrote a section of - glean_node_from_menu to no longer use `goto save_node;'. + * makeinfo/makeinfo.c (cm_value): erroneous capitalization in + error message. + * makeinfo/insertion.c (end_insertion): @end html should turn html + escaping back on. From esr. -Thu Jan 21 12:55:42 1999 Karl Berry <karl@gnu.org> + * makeinfo/makeinfo.c (cm_pxref): No period needed to terminate + cross-reference. - * doc/info-stnd.texi: OK, let's try restoring the @include - version.texi with the new automake. +Sun Jun 13 16:12:41 1999 Karl Berry <karl@gnu.org> - * makeinfo/cmds.c: Improve HTML @pounds, @bullet, etc. + * doc/texinfo.txi: Remove some more node links. - * doc/Makefile.am (install-tex): new target. - (EXTRA_DIST): Include txi-??.tex. - txi-de.tex: new file from kama. +Sat May 1 16:01:36 1999 Karl Berry <karl@gnu.org> - * Makefile.am (AUTOMAKE_OPTIONS): Bump to 1.4. - (install-tex): new target. + * info/info.c: Single space for option indent to match others. - * util/texi2dvi: Restore "$@" for explicitness in main loop. + * makeinfo/makeinfo.c, + * util/texindex.c, + * util/install-info.c: Must indent option list for help2man. - * doc/Makefile.am (*.1) [TEXINFO_MAINT]: Conditionalize. + * info/infodoc.c [HELP_NODE_GETS_REGENERATED]: set to true. + (info_internal_help_text): put moving cmds first so they know how to go + forward in the help window. + (create_internal_info_help_node): can't always quit help with C-x 0. + (info_find_or_create_help_window): pass !one_window_p. - * configure.in (AC_PREREQ): Bump to 2.13. - (TEXINFO_MAINT): Define this AM_CONDITIONAL. +1999-04-29 Yoshiki Hayashi <g740685@komaba.ecc.u-tokyo.ac.jp> - * doc/texinfo.txi: Document that the HTML output name is derived - from @setfilename. + * makeinfo/makeinfo.c (cm_xref): Don't collapse --- to -- etc., + in references. - * makeinfo/makeinfo.c (convert_from_loaded_file): Use @setfilename - for basename of html output. +Mon Apr 26 16:41:55 1999 Karl Berry <karl@gnu.org> - * doc/texinfo.txi (url): Use example.org for the example. + * makeinfo/node.c (validate): arrange to translate the reference type. + Report from Sergio. - * makeinfo/cmds.c (cm_url): @url should not produce a link, sorry - to say. + * makeinfo/makeinfo.c (validate): should not be declared here. -Wed Jan 20 16:31:55 1999 Karl Berry <karl@gnu.org> + * makeinfo/index.c (cm_printindex): <ul compact> is not + translatable. From Yoshiki. - * util/texindex.c, - * util/install-info.c, - * makeinfo/makeinfo.c, - * info/info.c: It's 1999. + * doc/Makefile.am (EXTRA_DIST): include new txi-es.tex from Adrian + Perez Jorge <alu1415@csi.ull.es>. And new txi-en.tex. - * doc/info.texi (Advanced info commands): Fix typos from Gildea. +Sun Apr 25 16:08:27 1999 Karl Berry <karl@gnu.org> - * makeinfo/makeinfo.c (end_of_sentence_p): don't check negative - array offset. - From: Enrico Scholz <enrico.scholz@wirtschaft.tu-chemnitz.de> + * makeinfo/cmds.c (cm_settitle): don't output html head here. -Sun Jan 17 16:42:16 1999 Karl Berry <karl@gnu.org> + * makeinfo/makeinfo.c: Move html routines to html.c. + * makeinfo/Makefile.am (makeinfo_SOURCES): add html.[ch]. + * makeinfo/html.[ch]: new files. - * util/texi2dvi: Restore --batch, handle changing escape character - more cleanly. From Akim (as always). + * makeinfo/makeinfo.c: Restore -- in --output line. From Sergio. -Thu Jan 14 16:47:41 1999 Karl Berry <karl@gnu.org> +1999-04-23 Yoshiki Hayashi <g740685@komaba.ecc.u-tokyo.ac.jp> - * configure.in (ALL_LINGUAS): Add no. - From: Trond Endrestol <trond@agamemnon.gtf.ol.no> + * makeinfo/cmds.c (cm_center): Recover the previous state when + called with --html. - * util/texi2dvi: Doc fix from Akim and do not always exit 1 from trap. - And it's 1999. +1999-04-24 Eli Zaretskii <eliz@is.elta.co.il> - * doc/texinfo.txi (image): Document imagename.pdf. + * makeinfo/cmds.c (cm_bye): Flush the output, in case some command + produced it immediately before @bye. - * Apply this change from Eli: + * makeinfo/toc.h (TOC_ENTRY_ELT): New member: containing_node. - 1998-11-20 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/toc.c (lots_of_stars): New variable. + (toc_add_entry): Add a new parameter node_name; all callers + changed. Record the name of the node containing the section. + (toc_find_section_of_node): New function. + (toc_free): Free the new containing_node member. + (contents_update_info, shortcontents_update_info): Underline the + title with stars. Output two empty lines after the TOC. + (contents_update): Fix off-by-one error in writing the rest of the + file after updating the TOC. - * makeinfo/makeinfo.h (meta_char_pos): New variable. - * makeinfo/makeinfo.c (init_paragraph): Initialize it. - (add_char): Use META to create a non-breakable space character. - (add_meta_char): New function. - (end_of_sentence_p): Don't handle characters at meta_char_pos as - normal sentence enders. - (flush_output): Only unMETA the non-breaking space character. - Reset meta_char_pos to zero. - (do_flush_right_indentation): Call adjust_braces_following. - (indent): Likewise. - (cm_value): Save and restore the value of meta_char_pos. - (expansion): Likewise. - * makeinfo/macro.c (me_execute_string_keep_state): Save and - restore the value of meta_char_pos. - * makeinfo/node.c (cm_node): Save and restore the value of - meta_char_pos. - * makeinfo/cmds.c (cm_accent): Make the dot we add due to - @dotaccent be a meta-character. - (cm_code, cm_dfn): Call add_meta_char to insert the closing - quote. - (cm_cite): Call add_char instead of add_word. + * makeinfo/index.c (cm_printindex): Save and restore line_number + and input_filename. Don't output the "* Menu" header when + --no-headers is in effect. Make the fake node name for index + entries that are outside any node be more explanatory, and emit an + error for such index entries. Under --no-headers, output a + reference to the section name, as returned by a call to + toc_find_section_of_node, instead of a node name. -Thu Jan 7 18:04:26 1999 Karl Berry <karl@gnu.org> +1999-04-24 Eli Zaretskii <eliz@is.elta.co.il> - * util/texi2dvi: Handle pdf files more cleanly. From Akim. + * makeinfo/index.c (struct index_elt): Add a new member + entry_text. + (free_index, make_index_entries_unique): Free the entry_text + member. + (index_add_arg): Don't HTML-escape the index entry here. + (index_add_arg): Initialize the entry member to NULL. Put the + entry text into the entry_text member. + (sort_index): Expand the index entries as if in non-HTML mode. + Put the expansion into the entry member of struct index_elt. + (cm_printindex): Allocate the line[] array in Info mode only. + In HTML mode, escape and expand the original index entry text, + don't use the results of expansion inside sort_index. -Wed Jan 6 17:49:11 1999 Karl Berry <karl@gnu.org> + * makeinfo/cmds.c (cm_r): Undo the effect of @code while printing + one of the "code"-style indices in HTML mode. - * makeinfo/makeinfo.c (cm_image): Check for .png also. +1999-04-23 Eli Zaretskii <eliz@is.elta.co.il> -Sun Dec 20 07:54:47 1998 Karl Berry <karl@gnu.org> + * info/infomap.c (initialize_vi_like_keymaps): Bind DEL in echo + area to ea_rubout, except for __MSDOS__. - * util/texi2dvi: Add --pdf. + * doc/info-stnd.texi (Node Commands): Document that `I' only + produces its effect for programs documented in the current Info + file. Tell them to invoke `I' from DIR if it doesn't work from + current place. - * util/texi2dvi: New option -@ to use @input and @nonstopmode, in - case texinfo is preloaded. - From: Khimenko Victor <khim@sch57.msk.ru> - Date: Sun, 20 Dec 1998 02:04:12 +0300 (EET) +Thu Apr 22 09:59:02 1999 Karl Berry <karl@gnu.org> -Sat Dec 19 17:37:37 1998 Karl Berry <karl@gnu.org> + * makeinfo/makeinfo.c, + * info/info.c: Rewrite help string a little more. - * doc/texinfo.txi (Multitable Column Widths): leading zero ok for - @columnfractions. + * doc/info-stnd.texi: Change chapter name to match node name, + * other changes. - * util/texi2dvi: New version from Akim, plus --quiet is like - --batch, etc. + * makeinfo/cmds.c (cm_bye): call discard_braces. -Fri Dec 18 17:22:44 1998 Karl Berry <karl@gnu.org> + * makeinfo/cmds.c (cm_settitle): output more meta and link tags. - * doc/texinfo.txi: Document that the Texinfo source can't be - arbitrarily ordered (for print) even if all pointers are supplied. + * configure.in (ALL_LINGUAS): add eo. - * makeinfo/insertion.c (end_insertion): In itemize case, - close_insertion_paragraph so @end itemize cause a line break. - Report from: Sergei Pokrovsky <pok@nbsp.nsk.su> - Date: Sun, 22 Nov 1998 19:45:21 +0700 (GMT) + * util/install-info.c [STRIP_DOT_EXE]: #if not #ifdef -Tue Dec 15 16:21:51 1998 Karl Berry <karl@gnu.org> +Wed Apr 21 19:40:51 1999 Karl Berry <karl@gnu.org> - * doc/texinfo.txi: More fixes from Oleg. + * makeinfo/makeinfo.c: Doc fix. - * configure.in: Bump version to 3.12c for next pretest. + * makeinfo/sectioning.c (insert_and_underscore): do not output + html anchor here. + * makeinfo/node.c (cm_node): do anchor at node name not sectioning + title. - * util/install-info.c (open_possibly_compressed_file) - [STRIP_DOT_EXE]: logic for compression_program assignment - was reversed. - From: wlestes@wlestes.uncg.edu + * makeinfo/node.c: Newlines on node lines. -Sat Dec 12 18:02:48 1998 Karl Berry <karl@gnu.org> +Tue Apr 20 13:02:46 1999 Karl Berry <karl@gnu.org> - * Merged these changes from Andreas: + * info/man.c (get_manpage_contents): freopen stdin and stderr to + /dev/null rather than closing them. http://bugs.debian.org/14787 -1998-12-06 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> +Mon Apr 19 14:12:09 1999 Karl Berry <karl@gnu.org> - * makeinfo/node.c (cm_node): When searching for @menu don't - require a space after it. + * doc/texinfo.txi: Document possibility of `titlepage' stuff for + plain text output using @ifinfo. + Report from: Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at>. -1998-12-06 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> + * makeinfo/cmds.c: Screw that. + * doc/texinfo.txi: Fix up frontmatter a bit. - * makeinfo/cmds.c (cm_top): free top_name only after done using it. + * dir-example: Spaces not tabs. + * dir-example (R FAQ): add. -Sat Dec 12 15:40:13 1998 Karl Berry <karl@gnu.org> + * makeinfo/makeinfo.c: Lowercase makeinfo in first line. - * doc/texinfo.txi: Various typos and fixes from Oleg. + * doc/info.texi (The node reached...): is a @subsection not a + @subsub. - * doc/texinfo.txi: Move @node's outside of @ifinfo for the sake of - HTML processing. + * doc/texinfo.txi: Document option rename. + * makeinfo/makeinfo.c: Rename option to commands-in-node-names. - * doc/texinfo.txi (titlepage): @pxref was not in parens. From Oleg. + * makeinfo/index.h (index_compare_fn): declare. + * makeinfo/index.c (index_element_compare): call through new + variable index_compare_fn, and set it to strcoll if + @documentlanguage was used and LANG != en. + #include lang.h. -Sun Dec 6 16:49:09 1998 Karl Berry <karl@gnu.org> +Sat Apr 17 14:46:47 1999 Karl Berry <karl@gnu.org> - * dir-example: Amd is now am-utils. + * makeinfo/insertion.c (current_item_function, cm_item): rewrite + to skip all conditionals. + (cm_item): use current_item_function rather than current_insertion_type + to check what to use for @item, so @ifset etc. can be used around + @items. + Report from: "W. L. Estes" <wlestes@br20920.uncg.edu>. - * doc/Makefile.am: Reinstate help2man invocations for development. + * makeinfo/makeinfo.c (current_insertion_type): no need to + declare. - * doc/texinfo.txi: Document @set...contentsaftertitlepage (from kama). - Fix incorrect sense for @image and Hungariam typo (from Oleg). + * makeinfo/makeinfo.c: Add examples to help message. - * lib/system.h: #include libintl.h here instead of acconfig.h, so - the system include files have a chance to #define NULL - before it does. - * acconfig.h: Remove libintl.h and #defines from here. - From: "Philippe De Muyter" <phdm@macqel.be> - Date: Fri, 4 Dec 1998 00:56:25 +0100 (CET) + * util/texindex.c (usage): Rearrange --help, avoid extra newline. - * info/signals.c: Start #ifdef's in column one for cc on sysv68 - (m68k-motorola-sysv). - From: "Philippe De Muyter" <phdm@macqel.be> - Date: Fri, 4 Dec 1998 00:56:25 +0100 (CET) + * info/info.c: Sort --help in the usual place. - * info/filesys.c (is_dir_name): use strcpy instead of automatic - array initialization. - From: "Philippe De Muyter" <phdm@macqel.be> - Date: Fri, 4 Dec 1998 00:56:25 +0100 (CET) + * makeinfo/makeinfo.c: Reindent help message, rename + --expensive-validation to --commands-in-nodes. - * configure.in (ALL_LINGUAS): add ru. +Fri Apr 16 17:53:48 1999 Karl Berry <karl@gnu.org> -Fri Dec 4 08:12:11 1998 Karl Berry <karl@gnu.org> + * makeinfo/cmds.c (cm_ignore_arg): new routine. + (cm_ignore_line_no_op): remove, can use cm_ignore_line. - * info/infodoc.c: Gettextize the help buffer string. +Tue Apr 13 16:45:39 1999 Karl Berry <karl@gnu.org> -Sun Nov 29 17:12:35 1998 Karl Berry <karl@gnu.org> + * doc/info-stnd.texi: Frontmatter changes. - * doc/texinfo.txi: Use @ifnottex rather than @ifinfo for @top. - (makeinfo top): document this. + * doc/info.texi: Remove advanced remark in first node. - * doc/info-stnd.texi, - * doc/info.texi: Use @ifnottex rather than @ifinfo for @top. + * doc/texinfo.txi: Texinfo.tex does macros now. From Eli. - * makeinfo/insertion.c (cm_menu): Implicitly insert @top command - so we can construct the node tree as usual when we see @menu - before @node. Probably this is when the input uses - @ifinfo instead of @ifnottex, as virtually all existing - manuals do. + * doc/texinfo.txi: Document @w{ } to produce an unbreakable space. - * makeinfo/insertion.c (discard_insertions): Let any conditional - cross node boundary. (So the @top node can be wrapped - in @ifnottex, for example.) + * util/texi2dvi: Update from Akim, avoid Solaris ucb echo weirdness. - * Installed these: + * info/infodoc.c: Parenthesize function calls, don't depend on + gettext being there. Report from: Doug Semler + <doug@seaspace.com>. -1998-11-21 Eli Zaretskii <eliz@is.elta.co.il> +1999-04-12 Eli Zaretskii <eliz@is.elta.co.il> - * makeinfo/makeinfo.c (expansion): Save and restore - last_inserted_character and last_char_was_newline. + * info/infomap.c (initialize_vi_like_keymaps): Initialize the echo + are keymap *before* it is filled up with keys. - * makeinfo/cmds.c (cm_dircategory): Kill any indentation before - INFO-DIR-SECTION. install-info relies on this. +1999-04-10 Eli Zaretskii <eliz@is.elta.co.il> -1998-11-20 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/macro.c (execute_macro): Reset the line number to where + the macro argumenst begin, before executing its expansion. - * makeinfo/multi.c (struct env): Add meta_char_pos member. - (select_output_environment): Save and restore meta_char_pos. - (out_char): Output characters by switching environment to #0 and - calling insert. Call flush_output when a newline is output. - (output_multitable_row): Update the current environment's - output_paragraph_offset as well, after removing trailing - whitespace. Fix typo in loop index. - (do_multitable): Call close_single_paragraph. - (end_multitable): Call close_insertion_paragraph. Don't output - an extra newline. + * makeinfo/makeinfo.c (cm_xref): Expand the name of arguments + before writing them in HTML mode. + (handle_menu_entry): Expand the name of the gleaned node before + writing it in HTML mode. -1998-11-20 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/sectioning.c (sectioning_html): Expand the name of the + current node when producing the <a name=... anchor. - * makeinfo/makeinfo.h (meta_char_pos): New variable. - * makeinfo/makeinfo.c (init_paragraph): Initialize it. - (add_char): Use META to create a non-breakable space character. - (add_meta_char): New function. - (end_of_sentence_p): Don't handle characters at meta_char_pos as - normal sentence enders. - (flush_output): Only unMETA the non-breaking space character. - Reset meta_char_pos to zero. - (do_flush_right_indentation): Call adjust_braces_following. - (indent): Likewise. - (cm_value): Save and restore the value of meta_char_pos. - (expansion): Likewise. - * makeinfo/macro.c (me_execute_string_keep_state): Save and - restore the value of meta_char_pos. - * makeinfo/node.c (cm_node): Save and restore the value of - meta_char_pos. - * makeinfo/cmds.c (cm_accent): Make the dot we add due to - @dotaccent be a meta-character. - (cm_code, cm_dfn): Call add_meta_char to insert the closing - quote. - (cm_cite): Call add_char instead of add_word. + * makeinfo/node.c (cm_node): Expand the name of node and its links + before outputting them in HTML mode. -Sun Nov 29 16:30:06 1998 Karl Berry <karl@gnu.org> + * makeinfo/index.c (cm_printindex): Expand node names to which the + index points. - * info/info.h, - * info/footnotes.h (FOOTNOTE_LABEL), - * info/indices.c (APROPOS_NONE): Use N_ rather than _. + * makeinfo/footnote.c (cm_footnote): Call execute_string instead + of add_word_args, since current_node needs to be expanded. Expand + the name of the Footnotes node before calling + remember_node_reference. - * info/infodoc.c (create_internal_info_help_node, - function_documentation): Do not translate the empty string. - Date: Fri, 25 Sep 1998 15:09:42 +0400 - From: "Oleg S. Tihonov" <tihonov@ffke-campus.mipt.ru> + * makeinfo/tests/node-expand.txi: New test, for testing how node + names are expanded in @node, @menu, cross-references, and + indices. - * doc/info-stnd.texi: Mention PRIOR as another alias for - PREVIOUS/PageUp. + * makeinfo/makeinfo.c (add_char): If we output <p>, adjust the + affected brace positions by 3, so cm_xxx functions get what they + expect in START and END. + (insert_html_tag): Likewise. - * doc/texinfo.txi: @emph produces _emph_ not *emph*. Spurious - junk before makeinfo bison example. - From: tihonov@ffke-campus.mipt.ru. + * makeinfo/cmds.c (cm_sc): Remove the kludge that looks for the + beginning of <small>, it is no longer needed. -1998-11-16 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/macro.c (cm_definfoenclose): Don't stop at the first + blank after the second comma: the blank may belong to the second + delimiter. - * makeinfo/defun.c (defun_internal): Don't expand the arguments to - @defun and its ilk. + * makeinfo/tests/htmlpara.txi: New test, for the commands affected + by the <p> output at paragraph beginning. - * makeinfo/makeinfo.c (expansion): Copy the name of the currently- - executing command and restore it after expansion. + * makeinfo/makeinfo.h (expensive_validation): New option. -Sun Nov 15 17:40:51 1998 Karl Berry <karl@gnu.org> + * makeinfo/makeinfo.c (long_options): Add expensive_validation. + (usage): Likewise. - * makeinfo/makeinfo.c: Rearrange usage, allow -v for verbose, only - output `Making' line when verbose. - * makeinfo/makeinfo.h (process_html, process_info, process_tex): - declare. - * makeinfo/cmds.c: Use conditional commands. - * makeinfo/insertion.c (find_type_from_name): Handle rawhtml and - rawtex. - (conditional commands): Allow individual switching on and off. + * makeinfo/node.c (find_node): If NAME isn't found verbatim, try + expanding it and every node name in tag table, before comparing + them, but only if expensive_validation is non-zero. + (find_node_reference): Likewise. + (cm_node): Don't expand node name and its links here. + (validate_file): If direct comparisons fail, try expanding the + comparees before giving up, unless expensive_validation is zero. + Switch the order of NODE and UP in error message about a lacking + menu item. - * makeinfo/insertion.h: Declare conditionals. +1999-04-07 Eli Zaretskii <eliz@is.elta.co.il> -1998-11-14 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/index.c (cm_printindex): Don't output "Menu" header. - * makeinfo/insertion.c (begin_insertion, end_insertion): Use <pre> - to convert @display and @smalldisplay into HTML. + * makeinfo/node.c (get_node_token): Collapse whitespace in node + names. + (glean_node_from_menu, expand_node_name): Likewise. - * makeinfo/cmds.c (cm_asterisk): Don't insert an extra newline in - HTML mode, since input includes a newline right after the @*. - (cm_sp): Output "<br><p>\n" as many times as the argument says. - (cm_url): Don't include "<a href=" in the anchor text in HTML - output. + * info/infomap.c (initialize_vi_like_keymaps): Bind all the 256 + keys to ea_insert, like the Emacs-like case does. - * makeinfo/makeinfo.c (cm_pxref): Don't add a period after @pxref - if in HTML mode. - (get_rest_of_line): Accept an additional argument EXPAND, and - expand the rest of line if it's non-zero. All callers changed. - (close_paragraph): When in HTML mode, honor the formatting of the - source paragraphs by generating "<p>" for every closed paragraph; - follow it by as many "<p>"'s as paragraph_spacing specifies. + * doc/info-stnd.texi (Invoking Info): Document support for files + compessed with bzip2, and the --vi-keys option. + (Many places): Document key bindings under --vi-keys. -Sat Nov 14 17:38:27 1998 Karl Berry <karl@gnu.org> +1999-04-06 Eli Zaretskii <eliz@is.elta.co.il> - * makeinfo/insertion.c: Use <ul compact> instead of deprecated <menu>. - Omit extra <li> after the menu beginning. + * info/session.c (info_last_node, info_first_node): With a numeric + argument, go to ARGth node counting from the beginning. Skip + anchor tags when looking for the target node--the last tag can be + an anchor, for example. + (last_search_direction, last_search_case_sensitive): New + variables. + (last_search_for_string): Remove variable. + (info_search_internal): Always move point by one notch before + beginning the search, to avoid complications in repeated search + commands. When looking for the next node tag, skip any anchor + tags. + (info_search_1): Accept a 5th argument ASK_FOR_STRING, and only + prompt for search string if it's non-zero. All callers changed. + Look for the COUNTth occurence of the string. + (info_search, info_search_backward, info_search_case_sensitively): + Set last_search_direction and last_search_case_sensitive. + (info_search_next, info_search_previous): New commands, repeat + last search in the same or reverse direction without prompting the + user for the string. - * makeinfo/index.c: Use <ul compact> instead of deprecated <menu>. + * info/infomap.c (initialize_emacs_like_keymaps): Bind `C-x n' to + info_search_next and `C-x N' to info_search_previous. + (initialize_vi_like_keymaps): Bind `n' to info_search_next and `N' + to info_search_previous. -Thu Nov 12 16:33:09 1998 Karl Berry <karl@gnu.org> +1999-04-04 Eli Zaretskii <eliz@is.elta.co.il> - * Makefile.am (EXTRA_DIST): add djgpp/config.sed. + * makeinfo/makeinfo.c (get_rest_of_line): Don't expand non-macros, + so that macro-expanded output will still have them. - * info/terminal.c: #include <sys/ioctl.h> to define TIOCGWINSZ - under LynxOS. From: Marius Groeger <mag@sysgo.de>. +1999-04-03 Eli Zaretskii <eliz@is.elta.co.il> -1998-11-06 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> + * makeinfo/node.c (cm_node): Expand the node name and its links + completely before using them, so that they could use e.g. @value{} + etc. - * makeinfo/insertion.c (begin_insertion): Correctly handle - ifnottex and ifnothtml. - (end_insertion): Likewise. + * makeinfo/makeinfo.c (replace_with_expansion): Don't + remember_itext if we are executing_string. -Sun Nov 8 17:30:23 1998 Karl Berry <karl@gnu.org> + * makeinfo/sectioning.c (sectioning_html): Remove #ifdef + HAVE_MACROS. Don't call me_execute_string if already + executing_string. - * makeinfo/index.c, - * makeinfo/insertion.c: Menu is special to Info. - * makeinfo/node.c: Top is a special name, don't translate it. - * info/session.c (info_top_node): Top is a special name, don't - translate it. - From: "Oleg S. Tihonov" <tihonov@ffke-campus.mipt.ru>. + * makeinfo/toc.c (toc_add_entry): Expand macros in TOCNAME right + here, since the macro can be later redefined. + (contents_update_html, contents_update_info, + shortcontents_update_html, shortcontents_update_info): Use stdio + functions for output instead of add_word etc. + (rewrite_top, contents_update, shortcontents_update, toc_update): + New functions, replace the TOC placebo with the actual TOC. + (cm_contents): Output a placebo instead of writing the TOC. + (cm_shortcontents): Output a placebo instead of writing the short + TOC. -Fri Nov 6 17:18:43 1998 Karl Berry <karl@gnu.org> + * makeinfo/makeinfo.c (convert_from_loaded_file): Call toc_update + if appropriate. - * configure.in: Version 3.12b. + * makeinfo/sectioning.c (cm_top): Don't output the HTML header + here, since the Top node might be preceeded by other commands, + like @contents. - * util/texi2dvi: Fixes from Eli and Christoph Martin. + * makeinfo/cmds.c (cm_settitle): Output the HTML header here. - Mon Oct 5 13:58:53 1998 Dave Glowacki <dglo@ssec.wisc.edu> - * util/install-info.c: Fix off-by-one error in findlines() + * makeinfo/node.c (set_current_output_filename): New function, + saves the name of the actual file we are now writing, including in + the case of split-HTML output. + (cm_node): Call it to record the name of output file. - * util/texindex.c (usage): avoid trigraph until Ulrich fixes - po2tbl.sed.in. From Paul Eggert. + * makeinfo/footnote.c (free_pending_notes): Re-initialize + current_footnote_number to 1. -1998-11-03 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/index.c (index_add_arg): Remove redundant xstrdup. + (cm_printindex): Don't free index->entry: it is freed in + free_index, if, e.g., there's more than one file to convert. - * makeinfo/makeinfo.c (cm_xref): Don't bypass the test that an - xref ends with a period or a comma if the reference has a single - argument. + * makeinfo/makeinfo.c (init_internals): Call toc_free. -1998-10-31 Eli Zaretskii <eliz@is.elta.co.il> +Mon Apr 5 16:53:33 1999 Karl Berry <karl@gnu.org> - * makeinfo/insertion.c (end_insertion): Don't decrement - in_fixed_width_font when leaving a menu, the previous value is - restored by pop_insertion. + * doc/Makefile.am: Texmf_{texinfo,dvips}: dirs not files. From + Kurt Hornik. - * makeinfo/makeinfo.c (add_char): Don't increment output_column - twice when a newline is inserted into the output. +Wed Mar 31 13:50:09 1999 Karl Berry <karl@gnu.org> - * doc/texinfo.txi (emph & strong): Document the use of underscores - for @emph in the Info output. + * Pretest 3.12h. -1998-10-30 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/node.c (last_node_p): new fn. + (split_file): call it, instead of assuming no more entries means + no more nodes. (Loses with anchors.) + Report from: "Oleg S. Tihonov" <ost@benetnash.ffke-campus.mipt.ru>. - * djgpp/config.bat: Make sure intl/po2tblsed.in exists before we - begin the configure boogie. - * djgpp/config.sed: Sed script, to be run by config.bat. + * makeinfo/index.c (sort_index): whether an entry is @code or not + depends on the element, not the index, because of synindex. - * doc/info-stnd.texi (Node Commands): Document the new G command. + * doc/Makefile.am (install-tex): Must use $(TEXMF), do + $(mkinstalldirs) on tex dirs. + From: Nathan Sidwell <nathan@acm.org>. - * info/session.c (info_follow_menus): Step over a possible leading - space in a menu entry in menus[]. - (split_list_of_nodenames): Renamed from split_words. Split the - string on commas, not on spaces, since a menu entry can have - embedded whitespace. Get past the null byte after inserting it. - (info_menu_sequence): Don't crash if there's no DIR node; try - using Top of the current Info file, and if that doesn't work - either, throw an error. + * doc/texinfo.txi: Document need for blank line before @image if + you want space. - * util/texi2dvi: Use $path_sep in TEXINPUTS. Don't include any - dots in $tmpdir, 8+3 filesystems won't like that. + * Install changes from Eli: - * makeinfo/makeinfo.c (reader_loop): Expand any macros in a menu - entry when creating a <menu> item for HTML. Fix an off-by-one - error in counting input lines. + 1999-03-09 Eli Zaretskii <eliz@is.elta.co.il> - * makeinfo/files.c (expand_filename): Don't treat .foo/bar as - absolute file name. + * info/infodoc.c (info_internal_help_text): Remove hard-wired key + names, use %-10s instead. + (info_help_keys_text): New variable, holds two variants of keys + that invoke basic commands, indexed by vi_keys_p. + (create_internal_info_help_node): Use info_help_keys_text[]. - * makeinfo/makeinfo.c (add_char): Use strncpy instead of memcpy, - since the buffers overlap. If the line being refilled includes - nothing but the indentation and the word being added, do NOT add - an extra newline. + * info/window.c (build_message_buffer): Support more general + format strings, like %-10.15s, %+4d etc. - * util/install-info.c (strip_info_suffix, menu_item_equal, - open_possibly_compressed_file) [__MSDOS__]: Allow .inz and .igz as - suffuxes for compressed files. - (open_possibly_compressed_file): Return an indication whether we - opened a file or a pipe. Use FOPEN_RBIN from system.h. - [STRIP_DOT_EXE]: Use gzip.exe with an explicit .exe extension. - [O_BINARY]: If the file is not compressed, switch its stream to - text mode. - (readfile): Close the file or the pipe. - (output_dirfile): Call pclose to actually run the compressor. + * info/infomap.c (initialize_vi_like_keymaps): Bind ESC-h, ESC-t, + C-x LFD and C-x RET. -Thu Nov 5 08:33:06 1998 Karl Berry <karl@gnu.org> + 1999-03-08 Eli Zaretskii <eliz@is.elta.co.il> - * doc/texinfo.txi: effect -> affect - From: Eric Hanchrow <offby1@blarg.net> + * util/install-info.c (output_dirfile): Sort the entries and + output them in alphabetic order. Output each entry only in those + sections where it belongs. + (parse_input): New function, code moved from main. Process + sections and entries in a single loop, and record with each entry + the list of sections where that entry belongs. Record each entry + separately, not all of them together as a single block. + (parse_dir_file): New function, code moved from main. + (main): Move code to parse_input and parse_dir_file. Put the new + entries only into sections where they belong. + (compare_entries_text): New function, called when sorting new + entries. -Tue Nov 3 14:26:59 1998 Karl Berry <karl@gnu.org> + * info/infomap.c (initialize_vi_like_keymaps): New function. Bind + keys a-la Less, including new functions from session.c below. + (initialize_emacs_like_keymaps): New function, with the guts of + initialize_info_keymaps. - * makeinfo/makeinfo.c (cm_image): Allocate enough space for the - zero byte. + * info/session.c (info_scroll_forward, info_scroll_backward): If + default_window_size is non-negative, use it as the default number + of lines to scroll. + (info_scroll_forward_set_window, info_scroll_backward_set_window, + info_down_line, info_up_line, info_scroll_half_screen_down, + info_scroll_half_screen_up, info_search_backward): New functions, + for Less-like look and feel. - * doc/texinfo.txi: Document epsf.tex standard location. +Tue Mar 30 16:44:53 UTC 1999 Karl Heinz Marbaise <kama@hippo.fido.de> -Tue Oct 27 10:45:47 1998 Karl Berry <karl@gnu.org> + * doc/txi-de.tex: + - added additional putwordin + * doc/texinfo.txi: + - changed defivar into deftypeivar + * makeinfo/sectioning.c: + - changed output of anchors based on problems with ie. + * makeinfo/defun.c: + - output in HTML mode changed to be on previous state. + * makeinfo/insertion.c: + - fixed up HTML output for deftypeivar. - * Makefile.am (TEXINFO_TEX): add definition. +1999-03-30 Akim Demaille <demaille@inf.enst.fr> - * doc/info-stnd.texi: Avoid unnecessary overfull boxes from - examples. + * texi2dvi ($tmpdir): Avoid security holes. - * doc/Makefile.am (install-data-local): missing ". +Fri Mar 26 17:06:55 1999 Karl Berry <karl@gnu.org> - * doc/Makefile.am: Don't try to run help2man in distribution. + * makeinfo/cmds.c (cm_exdent): rewrite to preserve blank lines. + Bug from: "Oleg S. Tihonov" <ost@benetnash.ffke-campus.mipt.ru>. -Mon Oct 26 13:43:53 1998 Karl Berry <karl@gnu.org> + * makeinfo/cmds.c (cm_exdent): arg is in `roman'. - * configure.in (TEXMF): lose this whole block. It is too painful - to maintain with the different tex installations out there. +Thu Mar 25 16:21:27 1999 Karl Berry <karl@gnu.org> - * util/Makefile.am (EXTRA_DIST): update-info renamed to - fix-info-dir. + * makeinfo/insertion.c, + * makeinfo/defun.c, + * makeinfo/insertion.h (insertion_type): add deftypeivar. + * makeinfo/defun.h (cm_defun): declare here. + * makeinfo/cmds.c (defun.h): include. + * doc/texinfo.txi (deftypeivar[x]): new commands. + * makeinfo/cmds.c (deftypeivar[x]): new commands. - * makeinfo/footnote.h: Doc fix. + * makeinfo/cmds.c (cm_exdent): save, set and restore + in_fixed_width_font. - * makeinfo/multi.c: #include "insertion.h" - * makeinfo/cmds.c: #include "node.h" - * makeinfo/makeinfo.h, - * makeinfo/makeinfo.c: Move globals, functions for insertions and - nodes. - * makeinfo/defun.c: #include "insertion.h" - * makeinfo/Makefile.am: Add insertion.[ch], node.[ch]. - * node.[ch], insertion.[ch]: New files. + * doc/texinfo.txi (uref): rewrite. - * makeinfo/makeinfo.c, - * makeinfo/makeinfo.h: Move globals for cmds.h. - * makeinfo/index.h: Include cmds.h. - * makeinfo/Makefile.am (makeinfo_SOURCES): Add cmds.h, cmds.c. - * cmds.c, cmds.h: New files. + * info/info.c (info_short_help): more spaces for new help2man. -Sat Oct 24 17:28:14 1998 Karl Berry <karl@gnu.org> + * makeinfo/node.c (cm_node): output node name in html, change + navbar punctuation. - * makeinfo/makeinfo.c, - * makeinfo/makeinfo.h: Globals for files.c. - * makeinfo/Makefile.am (makeinfo_SOURCES): add files.[ch]. + * doc/texinfo.5: Fix URL. -Tue Oct 20 17:03:10 1998 Karl Berry <karl@gnu.org> + * Finally installed this: + 1998-05-01 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + * makeinfo/makeinfo.c (convert_from_loaded_file): When the file + contains no @setfilename then always look for \input (not + \include) in the first line and skip that. Don't skip the first + line if no \input was found. - * makeinfo/Makefile.am (makeinfo_SOURCES): add macro.c and - macro.h. - * makeinfo/makeinfo.c: Move macro code to macro.h and macro.c. - * makeinfo/makeinfo.h: Move macro stuff to macro.h, expose global - last_char_was_newline for macro.c. - * makeinfo/index.c, - * makeinfo/footnote.c: #include macro.h. +1999-03-24 Akim Demaille <demaille@inf.enst.fr> -Wed Oct 7 16:24:07 1998 Karl Berry <karl@gnu.org> + * configure.in (AC_HEADER_STAT): Added. + * util/texindex.c (main): Check infiles are not directories. - * doc/info-stnd.texi: For now don't include version.texi due to - automake error. +1999-03-24 Akim Demaille <demaille@inf.enst.fr> - * makeinfo/index.h: #include makeinfo.h for sake of COMMAND type. - * makeinfo/index.c: No need to include makeinfo.h, index.h does - now. + * texi2dvi (index_files): Don't use `!' to run sed -e "s!foo$!!" + since the shell will interpret `$!'. - * makeinfo/makeinfo.c: Move footnote code to footnote.c. - * makeinfo/makeinfo.h: Globals for footnote.c. - * makeinfo/Makefile.am (makeinfo_SOURCES): add footnote.[ch]. +Tue Mar 23 16:41:08 1999 Karl Berry <karl@gnu.org> - * makeinfo/makeinfo.c: Move defun code to defun.c, necessary - global to makeinfo.h. - * makeinfo/makeinfo.h (default_indentation_increment): move here - for defun.c. - * makeinfo/Makefile.am (makeinfo_SOURCES): add defun.c. + * doc/texinfo.txi (uref): rewrite to make HTML output read more + nicely. From Tim S. - * Makefile.am: Doc fix. + * info/info.c (info_short_help): include examples. - * configure.in (AC_OUTPUT): generate makeinfo/tests/Makefile. + * makeinfo/makeinfo.c (close_paragraph_with_lines): move earlier + so can be static. - * makeinfo/makeinfo.c, + * makeinfo/sectioning.c, + * makeinfo/node.c, * makeinfo/makeinfo.h, - * makeinfo/Makefile.am (makeinfo_SOURCES): add index.[ch]. + * makeinfo/makeinfo.c, + * makeinfo/macro.c, + * makeinfo/insertion.c, + * makeinfo/cmds.c, + * makeinfo/files.c, + * makeinfo/footnote.c (size_of_input_text): rename to + input_text_length. -Fri Oct 2 17:42:26 1998 Karl Berry <karl@gnu.org> + * makeinfo/makeinfo.c (cm_xref): make wrong-char-following a warning. + (replace_with_expansion): remove bogus conditional that was duplicated + unconditionally. + From: Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de> - * lib/system.h (STREQ): new macro. +Mon Mar 22 14:39:59 1999 Karl Berry <karl@gnu.org> -Thu Oct 1 09:26:57 1998 Karl Berry <karl@gnu.org> + * doc/Makefile.am (install-tex): parenthesize. - * doc/texinfo.txi: Delete spare copy since out of date, - add makeinfo html to menu, - detailmenu doesn't take braces in summary. + * Makefile.am (dist-hook): remove, it uses hard links so we chmod + all our sources. -Wed Sep 30 14:38:21 1998 Karl Berry <karl@gnu.org> + * makeinfo/toc.c, + * makeinfo/defun.c, + * makeinfo/sectioning.c: Use _, not N_. - * makeinfo/makeinfo.c: Remove != NULL comparisons, - xmalloc/xrealloc casts, assignments in if statements. + * info/Makefile.am (ginfo_SOURCES): include $(BUILT_SOURCES) + explicitly. -Wed Sep 30 14:16:01 1998 Karl Berry <karl@cs.umb.edu> + * makeinfo/lang.c, + * makeinfo/lang.h: ISO-639 updates. - * makeinfo/makeinfo.c: Remove NULL casts and parentheses in return - statements. + * makeinfo/cmds.c: exampleindent changes. - * makeinfo/makeinfo.c (add_link): Don't add a link if the node is null. - (reader_loop): don't glean_node_from_menu if detailmenu, even if html. - Various formatting changes. + * info/info.c (info_short_help): reformat somewhat, and don't say + info info options any more. - * doc/help2man: Always exit successfully. + * doc/info-stnd.texi (Invoking): make description format somewhat + more standard. - * makeinfo/Makefile.am (SUBDIRS): add. - (makeinfo_SOURCES): no more html.h. + * info/infomap.c (Initialize_info_keymaps): do ea_insert bindings + first so subsequent bindings (e.g., for ESC) override. -Fri Sep 11 18:47:15 1998 Karl Berry <karl@cs.umb.edu> +Sun Mar 21 17:31:00 1999 Karl Berry <karl@gnu.org> - * makeinfo/makeinfo.c: Fiddle with html output. + * makeinfo/multi.c (output_multitable_row): remove unnecessary + trailing whitespace from output, output blank row for blank @item. -1998-09-07 Eli Zaretskii <eliz@is.elta.co.il> + * doc/texinfo.txi: Remove extra @item in language multitable. - * makeinfo/makeinfo.c (maybe_update_execution_strings): Only - reallocate TEXT if the existing storage is too small, otherwise - leave TEXT alone. - (replace_with_expansion): Call maybe_update_execution_strings to - reallocate input_text if we are executing_string, since storage - for execution_string is assumed to be large enough to hold every - possible string. - (me_execute_string): xstrdup the argument, so callees could freely - relocate it as needed. +Sat Mar 20 12:30:25 1999 Karl Berry <karl@gnu.org> -1998-09-06 Eli Zaretskii <eliz@is.elta.co.il> + * doc/texinfo.txi: Update language table from ISO 639: + http://www.iro.umontreal.ca/contrib/po/iso-639. From kama. - * makeinfo/makeinfo.c (replace_with_expansion): Don't remember - macro-expansion pointers if we are executing_string. + * doc/texinfo.txi (exampleindent): document. -1998-09-05 Eli Zaretskii <eliz@is.elta.co.il> + * doc/texinfo.txi (Creating an Info File): use this for the node name. - * info/filesys.c (info_suffixes): Put the empty suffix last in the - list, so that `foo.info' is found before `foo', if both exist. + * doc/info.texi: Make Texinfo references consistent, etc. -1998-09-05 Eli Zaretskii <eliz@is.elta.co.il> +1999-03-18 Yoshiki Hayashi <g740685@komaba.ecc.u-tokyo.ac.jp> - * makeinfo/makeinfo.c (maybe_update_execution_strings): New - function, updates an entry in execution_strings[] array after - input_text is relocated by replace_with_expansion. - (replace_with_expansion): Call it. + * makeinfo/makeinfo.c (set_default_indentation_increment): new + routine. + * makeinfo/insertion.c (cm_exampleindent): new routine. + Call set_default_indentation_increment. -1998-09-04 Eli Zaretskii <eliz@is.elta.co.il> +Mon Mar 15 17:06:15 1999 Karl Berry <karl@gnu.org> - * makeinfo/makeinfo.c (expand_macro): If a macro is called with - too many arguments, return NULL and print the line number where - the call begins. - (execute_macro): If expand_macro returns NULL, return - immediately. + * info/Makefile.am (ginfo_SOURCES): Remove doc.c and funs.h in + hopes they then won't be distributed. Report from Andreas. -Sun Sep 6 19:11:28 1998 Karl Berry <karl@cs.umb.edu> + * makeinfo/cmds.c (cm_sp): close paragraph and disable filling to + produce blank lines in info. + Report from: Michael Vanier <mvanier@bbb.caltech.edu>. - * makeinfo/makeinfo.c, - * makeinfo/makeinfo.h, - * makeinfo/multi.c: Html output. Specifically, these changes: + * doc/texinfo.txi: Attempt to get Edition info on one line. - Fri Jul 4 22:58:29 1997 Dave Love <d.love@dl.ac.uk> + * makeinfo/makeinfo.h (cr_or_whitespace): use whitespace and check + for \r. (skip_whitespace_and_newlines, command_char): use it. + Report from bonzini@gnu.org. - * doc/makeinfo.texi: Document HTML output. - - * makeinfo/makeinfo.c: Wrap strings in _() in bits changed for - HTML. - (cm_image): Generate <img> for HTML. + * makeinfo/cmds.c (cm_center): save and restore filling_enabled, + so @center can be used inside an @example. Bug from kama. - Sun Jun 22 22:50:07 1997 Dave Love <d.love@dl.ac.uk> +1999-03-13 Eli Zaretskii <eliz@is.elta.co.il> - * makeinfo/makeinfo.c (NAMED_NODE_ANCHORS): New define. - (title, outstanding_node, node_number, node_node_references, - escape_html, ifinfo_as_html): New variables. - (tentry.number, node_ref.number, fn.number): New fields. - (CommandTable): Various additions and alterations for HTML. - (long_options): Add html and no-info-as-html. - (main): Extra code for HTML. - (usage): Add HTML stuff. - (expand_filename): Deal with .html. - (escape_string): New procedure. - (convert_from_loaded_file): Extra code for HTML. - (init_internals): Call free_node_references, initialize - node_number. - (reader_loop): Process menu items for HTML hyperlinks. Escape - HTML special characters. - (add_char): Code for line breaks and paragraph insertions in - HTML. - (flush_output): Don't UNMETA for HTML. - (indent): Do nothing for HTML. - (current_item_function): Case for ifhtml. - (begin_insertion): Deal with HTML in various cases. - (insert_html_tag): new procedure. - (cm_asterisk, cm_copyright, cm_accent, cm_code, cm_kbd, - cm_angle_brackets, cm_var, cm_defn, cm_var, cm_emph, cm_string, - cm_cite, cm_top, cm_xref, cm_inforef, cm_uref, cm_direntry, - cm_ifinfo, cm_item, process_defun_args, defun_internal, cm_sp, - cm_dircategory, cm_center, cm_result, cm_expansion, cm_error, - cm_exdent, index_add_arg, make_index_entries_unique, - cm_printindex, cm_footnote, output_pending_notes, - me_execute_string): Code for HTML. - (cm_shyph): New procedure. - (cm_special_char): Add start, end args. Code for HTML. - (cm_email, cm_url, cm_i, cm_b, cm_r): New procedures. - (sectioning_html): New procedure. - (sectioning_underscore): Use it. - (add_link): New procedure. - (remember_node): Add number field and update node_number. Note - next, etc. nodes for HTML. - (add_escaped_anchor_name, add_anchor_name): New procedures. - (cm_node): New code for HTML. Move some other code to more - useful place. - (remember_node_reference): Add number field and update - node_number. - (remember_node_node_reference, free_node_node_references, - number_of_node): New procedures. - (cm_ifhtml, cm_html): New procedures. - (expansion): Take care of HTML escaping. - (cm_settitle): New procedure. - (remember_note): Set number field. + * makeinfo/footnote.c (cm_footnote): In separate footnote style, + generate a reference to "foo-Footnote-NN" for each footnote. + (output_pending_notes): In separate footnote style, generate an + anchor "foo-Footnote-NN" for each footnote, so that the link in + the parent node would lead directly to the footnote. - Declare various procedures in advance. + * info/footnotes.c (make_footnotes_node): Recognize the new + "foo-Footnote-NN" style of footnote references. - * doc/texinfo.txi: Makeinfo --html documentation from Dave Love. - Typo fixes from: Paul DuBois <dubois@primate.wisc.edu>. +1999-03-09 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> -Thu Sep 3 11:11:01 1998 Karl Berry <karl@cs.umb.edu> + * configure.in (AC_OUTPUT): Remove command to create po/Makefile, + already done by AM_GNU_GETTEXT. - * makeinfo/Makefile.am (makeinfo_SOURCES): add html.[ch]. +Tue Mar 9 17:48:46 1999 Karl Berry <karl@gnu.org> -1998-08-28 Eli Zaretskii <eliz@is.elta.co.il> + * Makefile.am (dist-hook): make distribution directory writable. - * makeinfo/makeinfo.c (cm_uref, cm_email): Use get_xref_token to - gather arguments. - (get_xref_token): Keep track of input line number when expanding - xref arguments. + * Installed these changes: -Tue Aug 25 14:36:44 1998 Karl Berry <karl@cs.umb.edu> + 1999-03-04 Akim Demaille <demaille@inf.enst.fr> - * util/texi2dvi: Exit the script if TeX exits with bad status. + * texi2dvi (bibtex): Allow several runs of bibtex, this can be + used if bibentries reference other bibentries. Moreover, looking + for `Citation' in the LOG should be enough to avoid uneless runs. -1998-08-16 Eli Zaretskii <eliz@is.elta.co.il> + Sun Mar 7 15:15:00 1999 UTC Karl Heinz Marbaise <kama@hippo.fido.de> - * info/indices.c (info_index_apropos): In the *Apropos* - menu, print the label first, then the Info file name and - the node name. Make the Info file name part of the menu - entry, so that all entries are distinct. - (apropos_in_all_indices): Scan each Info file only once, thus - avoiding multiple identical entries in the *Apropos* menu. - Free xstrdup'ed buffer, to avoid leaking memory. + * makeinfo/sectioning.{c,h}: + - using defines instead of literals. + - cleaned up some stylistic matters like Karl Berry + suggested. Handling of things like: + @unnumbered .. + @section ... + now it works correct. -Thu Aug 13 12:54:58 1998 Karl Berry <karl@cs.umb.edu> + * makeinfo/toc.{c,h} + - addTocEntry, freeToc changed into toc_add_entry + toc_free. stylistics changed. - * configure.in: Set version to 3.12a. + * makeinfo/iso2cht.pl,iso-639: script, table from the web. + - perl script converting the iso-639 table from the web + into the appropiate files (isoenum.h, isotab.c and + iso.texi) which can be inserted directly into + lang.c, lang.h and texinfo.txi. - * Makefile.am (AUTOMAKE_OPTIONS): bump required version to 1.3, - add readme-alpha option. +Tue Mar 9 17:47:59 1999 Karl Berry <karl@gnu.org> - * util/texindex.c (program_name), - * util/install-info.c (progname), - * info/info.c (program_name), - * makeinfo/makeinfo.c (progname): hardwire per coding standards. - * doc/help2man: Remove ginfo special case. + * configure.in: Bump to 3.12g. -Tue Aug 11 17:41:15 1998 Karl Berry <karl@cs.umb.edu> +Sun Mar 7 07:01:19 1999 Karl Berry <karl@gnu.org> - * util/gen-dir-node: New version from drk@sgi.com. + * info/infomap.c: Don't do isprint, just bind everything. -Mon Aug 10 13:55:37 1998 Karl Berry <karl@cs.umb.edu> +Fri Mar 5 14:31:42 1999 Karl Berry <karl@gnu.org> - * dir-example: Add entries from Linux. + * doc/texinfo.txi, + * makeinfo/makeinfo.c: Document that --no-headers writes to stdout + by default. - * info/info-utils.c (get_window_of_node): New fn. - * info/info-utils.h (get_window_of_node): New fn. - * (strchr,...) [!HAVE_STRCHR]: remove these #defines. - * info/infodoc.c (info_find_or_create_help_window): Call - get_window_of_node instead of get_internal_info_window. - This is so pressing ? repeatedly will always get to the same Help - window instead of popping up new ones. - From: "Brian J. Fox" <bfox@prospero.datawave.net> + * doc/texinfo.txi: @setchapternewpage doesn't change + \bindingoffset, just headers. Recommend not including it in the + manual source at all. - * info/signals.c: Ignore SIGWINCH if we're in the midst of it. - We might get a whole lot of them. Noticed on Afterstep. - From: "Brian J. Fox" <bfox@prospero.datawave.net> + * makeinfo/node.c (write_tag_table_internal): set + in_fixed_width_font while constructing this so --- doesn't + collapse to --, etc. Bug report from Sergio. -1998-07-25 Bruno Haible <bruno@linuix.math.u-bordeaux.fr> + * dir-example: Add a2ps stuff. - * install-info.c (findlines): Allocate room for one more line, - to avoid crash if dir file has exactly 512 lines. + * info/session.c: Allow any character in search string. -Tue Aug 4 07:14:35 1998 Karl Berry <karl@cs.umb.edu> + * info/infodoc.c (describe_key): don't assume non-latin1 + characters are undefined. - * info/info.c: Improve help message. + * info/infomap.c (initialize_info_keymaps): make all characters + insertable by default in echo area. From Eli. - * dir-example: Add mtools. + * Installed these changes: -Fri Jul 31 13:29:52 1998 Karl Berry <karl@cs.umb.edu> + Wed Feb 23 22:00:00 1999 Karl Heinz Marbaise <kama@hippo.fido.de> - * doc/help2man: Various hacks for texinfo. + * makeinfo/sectioning.{c,h}: + - added to hold complete handling of sectioning + a little step towards modularization ;-) - * doc/texinfo.txi: Make dir entries more consistent. + * makeinfo/cmds.c: + - sectioning_alist moved to sectioning.c and + added information about enumerated chapter, + section ..., appendix or not. Everything + which has any relationship with sectioning + moved to sectioning.{c,h} I hope I have found + all. - * doc/Makefile.am: Generate man pages with help2man. + * makeinfo/toc.{c,h}: + - added for complete handling of "table of contents" + "short contents". Better ASCII only support + (--no-headers) so no Text "Menu" is printed. + May be we can do more. - * util/texi2dvi, - * util/install-info.c, - * makeinfo/makeinfo.c, - * util/texindex.c: Improve help message. + * makeinfo/makeinfo.{c,h}: + - added new command line switch --number to enumerate + chapter, sections etc. - * doc/info.5: Initial. - * doc/texinfo.5: Section 5. + * doc/texinfo.txi: + - --number option documented. -Thu Jul 30 17:31:42 1998 Karl Berry <karl@cs.umb.edu> + 1999-02-28 Yoshiki Hayashi <g740685@komaba.ecc.u-tokyo.ac.jp> - * doc/info-stnd.texi, - * doc/texinfo.txi: Use Automake-standard VERSION and UPDATED. + * makeinfo/insertion.c (in_paragraph): New variable. + (cm_item): Add </p> only if <p> is open. + * makeinfo/makeinfo.c (handle_menu_entry): Ditto. -Wed Jul 29 17:34:41 1998 Karl Berry <karl@cs.umb.edu> + * makeinfo/insertion.c (begin_insertion), + * makeinfo/makeinfo.c (handle_menu_entry): If commentary + precedes first menu item, put them outside of <ul>. + Put <p> and </p> correctly. - * doc/texinfo.txi: Describe macro limitations a bit more. + 1999-02-27 Eli Zaretskii <eliz@is.elta.co.il> - * dir-example: Correct makeinfo link. + * info/info.c (info_short_help): Document --show-options and + --usage. -Tue Jul 28 16:44:06 1998 Karl Berry <karl@cs.umb.edu> + 1999-02-26 Eli Zaretskii <eliz@is.elta.co.il> - * makeinfo/makeinfo.c (remember_brace_1): xstrdup command, since - we free it later. + * info/makedoc.c (main) [STRIP_DOT_EXE]: Strip the .exe suffix, so + that doc.c says "./makedoc.c", not "./makedoc.exe.c". -Mon Jul 27 16:27:30 1998 Karl Berry <karl@cs.umb.edu> + * info/info.c (goto_invocation_p): New variable. + (long_options): New options --show-options and its alias --usage. + (main): Don't update the display until we find the first node to + be displayed, to avoid flushing incorrect display. If user wants + to see the command-line options node right away, display whatever + info_intuit_options_node finds. - * info/session.c (node_printed_rep): New fn. - Change calls. + * info/session.c (info_intuit_options_node): New function, uses + heuristics to find the node which describes program's invocation. + (info_goto_invocation_node): New command, asks for a program's + name and displays the invocation node of that program. + (entry_in_menu): New function, fuzzily looks for a menu entry in a + node's menu. + (program_name_from_file_name): New function, suggests a program + name given a name of its Info file. + (info_search_in_node): Accept an additional argument: a flag to + search case-sensitively; all callers changed. If case-sensitive + search is required, don't turn on the case-fold flag in the search + binding. + (info_search_internal): Accept an additional argument: a flag to + search case-sensitively; all callers changed. Share the last + search string between normal and case-sensitive search commands. + (info_search_1): New function, with the guts that previously + belonged to info_search. If the search is case-sensitive, + mentions that in the prompt for the search string. If the search + string includes upper-case characters, searches case-sensitively. + (info_search): Calls info_search_1 with zero case-sensitivity + flag. + (info_search_case_sensitively): New command, calls info_search_1 + with non-zero case-sensitivity flag. + (incremental_search): If the search + string includes upper-case characters, searches case-sensitively. - * info/session.c (info_set_node_of_window): Simplify by taking new - argument to say whether to call - set_remembered_pagetop_and_point. Change calls. - * info/indices.c: Change call. + * info/search.c (search_backward): Fix bug in case-sensitive + search. - * info/info.c: Rewrite initial menu-sequence following stuff as a - function in session.c, and call it. + * info/infomap.c (initialize_info_keymaps): `-' in info window map + produces negative arguments. `S' invokes case-sensitive search. + `O' and `I' invoke goto-invocation. - * info/infomap.c: Define `G' as info_menu_sequence. - * info/session.h (info_menu_sequence, info_follow_menus): declare - new fns. - * info/session.c (info_follow_menus, split_words, - * info_menu_sequence): New functions for new command. + * doc/info-stnd.texi (Invoking Info): Document --show-options. + (Node Commands): Document `O', goto-invocation. + (Searching Commands): Document `S' and the case-sensitive search + when the search string includes upper-case letters. Document `/' + as a synonym for `s'. + (Miscellaneous Commands): Document `M--' and `-'. -Thu Jul 23 16:44:42 1998 Karl Berry <karl@cs.umb.edu> + 1999-02-25 Eli Zaretskii <eliz@is.elta.co.il> - * info/session.c (info_scroll_other_window_backward): new command. - * info/infomap.c (initialize_info_keymaps): bind M-DEL and M-prior to - scroll-other-window-backward. - Report from: Vladimir Alexiev <vladimir@cs.ualberta.ca> - Date: Tue, 2 Dec 1997 14:54:30 -0700 + * info/info.c (main): Under --index-search, search indices *after* + following menus, so that we don't look for an index in DIR. - * info/info-utils.c (printed_representation): If ISO_Latin_p, show - characters as-is. Don't assume iscntrl(x) returns false - for meta characters. - Report from: Francois Pinard <pinard@iro.umontreal.ca> - Date: 15 Jan 1998 17:48:51 -0500 - * info/pcterm.c (pc_initialize_terminal): now no need to set it - here. - * info/info-utils.c (ISO_Latin_p): set to 1 by default. +Wed Mar 3 17:20:07 1999 Karl Berry <karl@gnu.org> - * doc/info-stnd.texi: Document SPC, add goto-node anchor. + * makeinfo/cmds.c: Do not output <small> in info mode. + From: Eli Zaretskii <eliz@is.elta.co.il>. -Wed Jul 22 18:58:38 1998 Karl Berry <karl@cs.umb.edu> + * makeinfo/insertion.c (enum_html): Remove unused var temp. + From: Yoshiki Hayashi <g740685@komaba.ecc.u-tokyo.ac.jp> - * info/window.c (message_buffer_to_node), - * info/session.c (kill_node), - * info/nodes.c (info_get_node_of_file_buffer, - info_node_of_file_buffer_tags), - * info/man.c (manpage_node_of_file_buffer), - * info/footnotes.c (make_footnotes_node): set display_pos member - in new node. + * info/infodoc.c: Avoid translation of blank lines. -Tue Jul 21 14:04:52 1998 Karl Berry <karl@cs.umb.edu> + * info/tilde.c, + * info/man.c, + * makeinfo/index.c (index_add_arg): avoid use of alloca. - (all of this is to make SPC/DEL not move outside the current - document, i.e., not up through dir) - * info/info-utils.h (info_label_was_found): Move from here. - * (info_prev_label_of_node): Don't use it any more. - * info/session.c (INFO_LABEL_WAS_FOUND): Move to here, add test - for filename not dir. - (forward_move_node_structure): Change calls, notice if no more nodes. - (backward_move_node_structure): Check for moving outside current - document to dir. - * info/filesys.c (compression_suffixes): Add bz2 for bunzip2. - (is_dir_name): New fn. - * info/filesys.h: Declare it. - * info/nodes.c (info_get_node, info_find_file_internal): Use it. + * info/echo-area.c: Don't pause for an additional 75 microseconds. + Noted by Eli. + + * configure.in: Bump to 3.12f. - * makeinfo/makeinfo.c: Set in_fixed_width_font to avoid munging - node names. + * doc/texinfo.txi: findex enddots. From Eli. -Sat Jul 18 17:14:10 1998 Karl Berry <karl@cs.umb.edu> +1999-03-01 Yoshiki Hayashi <g740685@komaba.ecc.u-tokyo.ac.jp> - * info/man.c (reap_children): Call wait (NULL), since we don't - actually use the return status for anything. NEXTSTEP 3.3 - doesn't like an int * even though that is the POSIX - specification. - Date: Fri, 22 Aug 1997 13:55:42 +0200 - From: "Felix H. Gatzemeier" <fxg@imib.rwth-aachen.de> - Via: Thomas Esser <te@informatik.uni-hannover.de> + * makeinfo/makeinfo.c (insert_html_tag): Add <p> when + paragraph is not opened. + (sectioning_html): Call close_paragraph so that paragraph + will be started. - * info/session.c (kill_node): Restore point when we go back. +1999-02-26 Akim Demaille <demaille@inf.enst.fr> -Thu Jul 16 18:54:04 1998 Karl Berry <karl@cs.umb.edu> + * texi2dvi (get_xref_files): Take $filename_noext as $1. + (get_xref_files): Look for $1.idx only, not *.idx. + (get_xref_files): Look for $1.cb files (\usepackage{changebar}). + * texi2dvi: Look for rerun requests in LOG files in addition to + xref files comparison. + (bibtex): Remove useless `./' (already added in + command_line_filename). + (filename_dir): Smarter sed expression that handles file names + with no directory part. + (txiversion): Removed useless () (`` already guarantee a subshell). - * makeinfo/makeinfo.c (BRACE_ELEMENT): Add `command' to the save - stack. - (MAYBE_BRACE_ARGS): New possibility, somewhat like TeX's - next-token-as-argument. - (command_table): Use cm_accent and MAYBE_BRACE_ARGS for all accents. - (read_command): Implement MAYBE_BRACE_ARGS. - (init_brace_stack): save current command. - (pop_and_call_brace): restore current command. - (cm_accent): move almost all accent characters to after the argument. - Suggested by Fran,cois. +1999-02-25 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> - * info/info.c (version_string): Remove defn. - Change call for --version option. - * info/session.c (display_startup_message_and_start): Just use - VERSION. - * info/info.h (version_string): Remove decl. + * makeinfo/multi.c (find_template_width): Fix operator precedence. -Tue Jul 14 16:46:58 1998 Karl Berry <karl@cs.umb.edu> +Tue Feb 23 10:35:53 1999 Karl Berry <karl@gnu.org> - * makeinfo/makeinfo.h: Doc fix. + * dir-example: ccmode not cc-mode. From hds. - * makeinfo/makeinfo.c (validate_file): Don't complain about - unreferenced anchors. +Mon Feb 22 07:34:00 1999 Karl Berry <karl@gnu.org> - * doc/texinfo.txi: Document @anchor. + * makeinfo/lang.c, + * doc/texinfo.txi: Fix kazakhkh typo. -Sun Jul 12 14:14:50 1998 Karl Berry <karl@cs.umb.edu> +1999-02-21 Eli Zaretskii <eliz@is.elta.co.il> - * makeinfo/makeinfo.c (remember_node): Only set `current_node' if - this is not an anchor. + * djgpp/config.sed: Add pcterm.c to terminal.o dependencies. - * info/nodes.c (get_tags_of_indirect_tags_table): Don't set - nodelen to -1 when fixing up the subfile entries, it might be 0 - from an anchor. +1999-02-21 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> - * info/nodes.c (find_node_of_anchor): Offset display_pos for - anchor tags by the amount that node references are off by (- 1). + * makeinfo/lang.c (cm_accent_generic): Emit the accent character + only once, after the argument. -Sat Jul 11 17:37:18 1998 Karl Berry <karl@cs.umb.edu> +Sun Feb 21 16:36:14 1999 Karl Berry <karl@gnu.org> - * makeinfo/makeinfo.c (cm_anchor): Add output_column for anchors - embedded in a line. + * makeinfo/makeinfo.c (handle_menu_entry): new routine. + (reader_loop): call it, allowing for comments in menus. -Fri Jul 10 16:28:21 1998 Karl Berry <karl@cs.umb.edu> + * makeinfo/node.c: Rearrange functions to make static, etc. - * info/session.c (info_menu_or_ref_item): Don't search for the - xref text if it's an anchor. - * info/nodes.h (N_FromAnchor): New NODE flag. - * info/nodes.c (find_node_of_anchor): New fn. - (info_node_of_file_buffer_tags): Handle anchor case. + * doc/Makefile.am (EXTRA_DIST, install-tex): Add txi-cs and txi-no. -Wed Jul 8 17:48:59 1998 Karl Berry <karl@cs.umb.edu> +1999-02-20 Eli Zaretskii <eliz@is.elta.co.il> - * info/window.c (window_set_node_of_window): Set window->point to - node->display_pos. - Remove unneeded casts. + * util/install-info.c (open_possibly_compressed_file): Output + explicit message about empty input files. + (insert_entry_here): Insert multiple entries in alphabetical order. -Tue Jul 7 08:06:14 1998 Karl Berry <karl@cs.umb.edu> +Fri Feb 19 09:13:28 1999 Karl Berry <karl@gnu.org> - * makeinfo/makeinfo.c (add_word_args) [!VA_SPRINTF]: Use buffer, - not the undeclared temp_string. - From: Tobias Naehring <naehring@eeetw3.et.tu-dresden.de> - To: egcs-bugs@cygnus.com - Date: Mon, 6 Jul 98 13:51:55 +0200 + * makeinfo/insertion.c (enum_html): new routine. + (begin_insertion): call it. + Based on code from: Yoshiki Hayashi <g740685@komaba.ecc.u-tokyo.ac.jp>. -Mon Jul 6 17:43:25 1998 Karl Berry <karl@cs.umb.edu> + * lib/xexit.c (EXIT_FAILURE) [!defined EXIT_SUCCESS && VMS]: weird + long value. + From: Lars Hecking <lhecking@nmrc.ucc.ie> - * info/nodes.h (NODE): Add display_pos member. +Thu Feb 18 16:42:10 1999 Karl Berry <karl@gnu.org> -Sun Jul 5 08:17:43 1998 Karl Berry <karl@cs.umb.edu> + * makeinfo/node.h (remember_node_reference): decl. + * makeinfo/makeinfo.c (find_unused_reference): dump unused decl. - * info/nodes.h (INFO_REF_LABEL): Define. +1999-02-18 Eli Zaretskii <eliz@is.elta.co.il> - * util/texi2dvi: Rationalize use of `index' vs. more general - `xref'. + * makeinfo/cmds.c (cm_dots, cm_enddots): Don't produce … for + HTML, as too many browsers don't support it; use "..." in a + smaller font. + (cm_top): Output the lang= attribute inside <html>. -Thu Jul 2 18:53:43 1998 Karl Berry <karl@cs.umb.edu> + * makeinfo/node.c (cm_node): Output the lang= attribute inside + <html>. - * makeinfo/makeinfo.c: Don't translate -Footnotes, it's a magic - cookie. From Eli. + * makeinfo/footnote.c (output_pending_notes): Generate <ol> + instead of <dl compact>. Make the text of each footnote start a + new paragraph. -Wed Jul 1 08:42:41 1998 Karl Berry <karl@cs.umb.edu> +1999-02-17 Eli Zaretskii <eliz@is.elta.co.il> - * doc/texinfo.txi (url): Missing word `command'. + * makeinfo/insertion.c (cm_item): Remove <dd> when immediately + followed by a <dt>. Add a <br> before every <dt>, except if we + are converting @itemx, or in the first item after <dl>. + (begin_insertion): Use <dl> for tables, to make it look closer to + the Info output. Don't output a newline after a <pre>. -Tue Jun 30 10:35:48 1998 Karl Berry <karl@cs.umb.edu> +1999-02-17 Eli Zaretskii <eliz@is.elta.co.il> - * info/info.c: Missing \n in try --help msg. + * makeinfo/makeinfo.c (handle_variable): Don't backup input + pointer if we hit the end of text (usually, inside + execute_string). + * makeinfo/insertion.c (get_item_function): Likewise. - * makeinfo/makeinfo.c (cm_anchor): New fn for new cmd. - (TAG_FLAG_ANCHOR): New flag for tag entries. - (write_tag_table_internal): Handle anchor case. - (TAG_FLAG_{{PREV,NEXT,UP}_ERROR,NO_WARN,IS_TOP}): Add TAG_FLAG_ prefix - for clarity, change uses. +Wed Feb 17 15:09:06 1999 Karl Berry <karl@gnu.org> - * doc/texinfo.txi: Remove warning about footnotes with @item, that - works now. + * doc/texinfo.txi: Better indexing of space entries. -Mon Jun 29 10:17:50 1998 Karl Berry <karl@cs.umb.edu> + * makeinfo/multi.c (find_template_width): new routine to really + parse @multitable {...} templates. + (setup_multitable_parameters): call it. + Bug report from: Sergio Pokrovskij <pok@nbsp.nsk.su>. - * configure.in (AM_CONFIG_HEADER): Use second argument to be 8.3 - compliant. - * config.h.in: Rename to config.in. + * lib/system.h (substring): declare. - * info/Makefile.am (EXTRA_DIST), - * info/terminal.c [__MSDOS__]: Change #include to pcterm.c and - rename file. + * lib/Makefile.am (libtxi_a_SOURCES): add substring.c. -Sun Jun 28 14:29:27 1998 Karl Berry <karl@cs.umb.edu> + * makeinfo/defun.c: Move substring to lib. - * info/Makefile.am (EXTRA_DIST): Add pc_term.c. + * util/texindex.c (tempcopy): no longer used. + (maketempname): make static. - * makeinfo/makeinfo.c (HAVE_MACROS): Remove this conditional, we - always want macros now. + * Installed these changes: - * info/indices.c: Copyright. +1999-02-13 Eli Zaretskii <eliz@is.elta.co.il> -1998-06-26 Eli Zaretskii <eliz@is.elta.co.il> + * makeinfo/cmds.c (cm_acronym): New function, makes @acronym + produce a smaller font size in HTML mode. + (cm_sc): Produce smaller font size in HTML mode. - * makeinfo/makeinfo.c: (only_macro_expansion): New variable, - suppresses all expansions except macros. - (replace_with_expansion): New function, replaces a portion of - input text with its expansion. Avoids moving the text around if - we are positive it will expand into itself. If the length of the - expanded text is the same as the length of the original text, just - replaces the original text without moving the rest. Resyncs the - remembered text pointers with the realloc'ed input_text, when it - is realloc'ed. - (reader_loop): When only_macro_expansion is non-zero, only handle + * makeinfo/footnote.c (cm_footnote): In HTML output, make the + footnote number be a superscript; remove [] around the link. + + * makeinfo/cmds.c (cm_var_sc): Separated into two functions: + cm_var and cm_sc, since @var and @sc have different effects in + HTML output. + + * makeinfo/makeinfo.c (cm_xref, cm_inforef): Don't put "[]" around + HTML links. + + * info/pcterm.c (DJGPP_keytab): Add translation for Alt-PgUp and + Alt-PgDn, to support the new M-prior key. + +Wed Feb 17 11:50:46 1999 Karl Berry <karl@gnu.org> + + * doc/texinfo.txi: Don't mention texi2roff so prominently. + + * makeinfo/makeinfo.c: Pass enclose_expand to remember_brace + rather than enclose_command. From Eli. + + * makeinfo/macro.c (cm_alias, cm_definfoenclose): Expand macros in + first call to get_until_in_line. From Eli. + + * info/makedoc.c, + * info/session.c, + * info/man.c, + * info/tilde.c, + * info/info.c, + * makeinfo/files.c, + * makeinfo/multi.c, + * makeinfo/node.c, + * makeinfo/makeinfo.c: Use xexit. + * makeinfo/makeinfo.h (NO_ERROR, FATAL, SYNTAX): remove. + + * info/terminal.c: Avoid sleep unless on sun-cmd terminal. + + * lib/xexit.c (EXIT_FAILURE) [!EXIT_FAILURE]: #define to 1 to fix + Sony NEWS-OS 4.0C lossage. From Akim. + + * info/infodoc.c: Translate where is doc string, underline lines + in help. + From: Trond Endrestol <trond@agamemnon.gtf.ol.no> + + * makeinfo/cmds.c (cm_dots, cm_enddots): go back to ... and ...., + … apparently doesn't work widely enough. + +Tue Feb 16 07:37:54 1999 Karl Berry <karl@gnu.org> + + * configure.in (ALL_LINGUAS): add de_AT. + + * util/texi2dvi: Redirect cd output to /dev/null when determining + txiversion. + +Mon Feb 15 13:43:37 1999 Karl Berry <karl@gnu.org> + + * util/install-info.c, + * util/texindex.c: Call xexit instead of exit. + + * lib/system.h (xexit): Declare. + + * lib/Makefile.am (libtxi_a_SOURCES): Add xexit.c. + + * doc/texinfo.txi: Document that @documentencoding is used in the + HTML output. + + * makeinfo/cmds.c (cm_top): use document_encoding if set. + (command_table): call cm_documentencoding instead of no-op. + * makeinfo/lang.c (document_encoding, cm_documentencoding): define. + * makeinfo/lang.h (document_encoding, cm_documentencoding): declare. + + * makeinfo/insertion.c: Restore </p> before <li>. + + * util/texi2dvi: If texinfo.tex version is too low for macros, use + makeinfo. + + * makeinfo/cmds.c (cm_center): save and restore value of + indented_fill, otherwise @center within an @enumerate (say) + also closes the indentation. + Bug from: Sergio Pokrovskij <pok@nbsp.nsk.su>. + +Sun Feb 14 15:25:02 1999 Karl Berry <karl@gnu.org> + + * makeinfo/makeinfo.c: Doc fix. + + * doc/texinfo.txi: Be enthusiastic if people want to implement + more output formats, but use makeinfo to do the job. + + * makeinfo/index.c (index_element_compare): Use strcoll if it's + available. + * configure.in: Call AC_FUNC_STRCOLL. + * makeinfo/makeinfo.c (main): Use LC_CTYPE and LC_COLLATE + categories. Suggestion from Oleg. + + * lib/system.h (setlocale) [!HAVE_SETLOCALE]: #define away. + Suggestion from Akim. + + * doc/texinfo.txi: Document @paragraphindent working in TeX now. + + * doc/texinfo.txi, + * makeinfo/lang.c, + * makeinfo/lang.h (language_code_type): abbrev changes from Oleg. + + * makeinfo/cmds.c, + * makeinfo/node.c: Only translate `Next:', `Previous:', and `Up:', + not the whole href. From Eli. + + * doc/texinfo.txi: Document that only unsplit html output is + supported in this release. + +Sat Feb 13 17:55:30 1999 Karl Berry <karl@gnu.org> + + * configure.in: Check for termlib before termcap for sake of + Solaris (judging from less-332 configure.in) and maybe + HP-UX 11. + + * doc/texinfo.txi (Footnote commands): incoherency reported by Aharon. + Language vs country fixes from Oleg. + +1999-02-13 Karl Eichwalder <ke@gnu.franken.de> + + * makeinfo/node.c (cm_node): Tag navigation links as translatable. + * makeinfo/cmds.c (cm_top): Ditto. + +Wed Feb 10 22:00:00 1999 Karl Heinz Marbaise <kama@hippo.fido.de> + + * makeinfo/defun.h: + - new because we need get_base_type-function + accessible in insertion.c + + * makeinfo/defun.c: + - complete HTML handling of the @def... things. + + * makeinfo/Makefile.am: + - defun.h added as part of makeinfo. + + * makeinfo/makeinfo.c: + - define looking_at moved into header-file, because + we need it in defun.c + + * makeinfo/insertion.c: + - some minor changes made to support the @def... + things in HTML. + + * makeinfo/lang.c: (cm_accent_generic) + - bug fixed. Using umlaut (accent ...) + would produce &A only if an umlaut follows + an empty line. + - bug fixed. Because things like ˜ ` + and ˆ do not exist as standalone characters + in HTML. + - cm_special_char now produce correct HTML for + @O{} and @o{}. + - warning using _("Text") instead "Text" (gettext). + + * makeinfo/cmds.c: + - @url fixed. Display the given Text. + + * doc/texinfo.txi: + - corrected the references for @uref, because + they were given as "url" instead of "uref". + @uref has three arguments, so show them in + command list. + +Wed Feb 10 17:27:58 1999 Karl Berry <karl@gnu.org> + + * doc/texinfo.txi: Rewrite for overfull box. + +Tue Feb 9 19:03:16 1999 Karl Berry <karl@gnu.org> + + * doc/texinfo.txi: Document more HTML output stuff. Based on esr + changes. + * makeinfo/macro.c, + * makeinfo/macro.h, + * makeinfo/makeinfo.c: Do alias and definfoenclose expansion. + From esr. + +Mon Feb 8 14:41:07 1999 Karl Berry <karl@gnu.org> + + * makeinfo/cmds.c: New commands @alias and @definfoenclose. + From: "Eric S. Raymond" <esr@snark.thyrsus.com>. + + * doc/texinfo.txi: Document @documentlanguage and + @documentencoding. + + * makeinfo/cmds.c: Move accent support to lang.c. + + * makeinfo/makeinfo.c (add_char): add   rather than an 8-bit + char for html. + + * makeinfo/Makefile.am (makeinfo_SOURCES): add lang.[ch]. + + * doc/texinfo.txi: Be even more emphatic that @url is not + typically what you want. + * doc/texinfo.txi: Document that macro calls must use empty + braces. + + * info/session.c: Do not translate node pointers. From Karl E. + + * makeinfo/cmds.c (cm_dfn): Use <dfn>. Suggestion from Eli. + +Sun Feb 7 07:00:08 1999 Karl Berry <karl@gnu.org> + + * makeinfo/makeinfo.c: Make --html imply --no-split. + + * makeinfo/cmds.c (cm_top): don't core dump if the top node has no + next. + + * makeinfo/makeinfo.c (replace_with_expansion): compare length + after expansion with length of full input text before + expansion, not just the length of the expanded text. + Bug (contents2) reported by kama. + + * info/infodoc.c (create_internal_info_help_node): gettext calls + to help msg strings. From Ulrich. + +Fri Feb 5 17:35:13 1999 Karl Berry <karl@gnu.org> + + * util/texi2dvi: set makeinfo= for latex case. + + * doc/texinfo.txi (@deftp summary): ref Data Types node that + actually describes it. From kama. + +Thu Feb 4 07:39:10 1999 Karl Berry <karl@gnu.org> + + * makeinfo/makeinfo.c: Take it back. Emacs info needs that text + before the CTRL-_. + * makeinfo/makeinfo.c: Don't bother to output the header (This is + -, produced ...) to stdout. + + * doc/texinfo.txi (Other Info Directories): Mention that dir files + must be named dir. + + * makeinfo/makeinfo.c (cm_uref): implement optional third + argument. + * doc/texinfo.txi (uref): document it. + Suggestion from: Charles Karney <karney@pppl.gov> + + * doc/Makefile.am (info_TEXINFOS): put texinfo.txi first so + UPDATED reflects its modtime, rather than info-stnd's. + + * makeinfo/files.c (full_pathname) [!WIN32]: #endif in wrong place. + From: Yoshiki Hayashi <g740685@komaba.ecc.u-tokyo.ac.jp> + + * makeinfo/cmds.c (cm_url): Remove URL: from output. It's ugly. + +Wed Feb 3 16:05:03 1999 Karl Berry <karl@gnu.org> + + * info/infodoc.c: Doc fix, zero not oh. + + * makeinfo/makeinfo.c (add_char): don't ignore if + only_macro_expansion, even in no_headers case. + Otherwise menu items don't get remembered and defaulting + doesn't work. Macros suck! + + * util/texi2dvi (common): include orig_pwd. + (language): reguess for each file if not explicitly set. + +Tue Feb 2 16:22:32 1999 Karl Berry <karl@gnu.org> + + * configure.in: Bump to 3.12d now. + +Mon Feb 1 14:46:45 1999 Karl Berry <karl@gnu.org> + + * makeinfo/insertion.c (cm_item): For itemize and enumerate, do + </p> before the <li> for html. Bug from Eli. + + * makeinfo/index.c: Installed change in index.c: + Mon Dec 28 12:50:14 1998 Matthew Fredette <fredette@mit.edu> + * makeinfo.c (index_add_arg): Use xstrdup on input_filename + when saving it in the new index entry. + + * util/texi2dvi: cd / before cd $orig_pwd in case of DOS drive + change. + +Sun Jan 31 16:39:01 1999 Karl Berry <karl@gnu.org> + + * util/texi2dvi: Used sed to expand only the @{if,}tex parts of + the source since makeinfo's conditional options aren't ready yet + (from Akim). + Also use ${1+"$@"} for Digital Unix "$@" expansion bug (from Noah). + + * util/install-info.c: Doc fix from Eli. + + * doc/texinfo.txi: Oops, said we looked for .png twice. + +Sat Jan 30 17:18:14 1999 Karl Berry <karl@gnu.org> + + * info/session.c (forward_move_node_structure): remove tangled + code to merely print words instead of numbers; too hard to translate. + + * info/session.c: Missing _'s for more i18n. From Trond. + + * doc/Makefile.am (EXTRA_DIST): Include txi-no.tex from Trond. + +Sun Jan 24 09:28:12 1999 Karl Berry <karl@gnu.org> + + * Makefile.am (EXTRA_DIST): Use djgpp by itself instead of listing + each file separately (new feature in automake 1.4). + + * makeinfo/insertion.c (begin_insertion): for quotation, always + increment current_indent even if html output, why not. + (Otherwise must not decrement current_indent in end_insertion.) + + * doc/texinfo.txi: More overfull box fixes. + + * makeinfo/insertion.c: Add some assertions and the beginnings of + handling @tex. + + * doc/texinfo.txi: Fix overfull boxes, but tables of contents at + the front. + + * util/texi2dvi: Can't pass --no-ifinfo --iftex to makeinfo yet, + it's not ready. + +Sat Jan 23 10:22:16 1999 Karl Berry <karl@gnu.org> + + * util/texi2dvi: Pass --no-ifinfo --iftex to makeinfo. + +Fri Jan 22 19:09:49 1999 Karl Berry <karl@gnu.org> + + * doc/texinfo.txi: Include version.texi before @settitle so + @value{VERSION} gets expanded in the html title. From kama. + + * These patches from Tim Singletary <talon@clark.net>. + * makeinfo/makeinfo.c: Simplify and improve html menus. + * makeinfo/insertion.c (begin_insertion): simplify html menu case + and set had_menu_commentary. + * makeinfo/insertion.h (had_menu_commentary): declare new global. + * makeinfo/node.h (glean_node_from_menu): declare. + * makeinfo/node.c (glean_node_from_menu): new arg to specify what + type of reference to remember as. + + Date: Sun, 29 Nov 1998 09:21:01 -0500 (EST) + From: Tim Singletary <tsingle@talon.clark.net> + To: texinfo-pretest@tug.org + Subject: explanation of previous patches + + > These diffs introduce some non-trivial changes into very + > sensitive parts of makeinfo, and it is hard to judge them without + > knowing what exactly do they solve. + + At a high level, these patches fix (or at least significantly improve) + the html conversion of menus. Specifically, they fix bugs in the + conversion of menu commentary and detailmenu entries. + + The menu commentary fixes require some justification: The unpatched + makeinfo attempts, with many bugs, to place menu commentary outside + the <menu> by adding </ul> and <ul> tags. While I understand the + motivation for this, that there might be browsers that don't support + <p> within <menu>, I'm not aware of any such browser and don't see any + compelling reason to continue the </ul> kludge. + + Certainly + <menu> + <li>First paragraph. + <p>Second paragraph. + <li>Second item. + </menu> + is valid html! + + Anyway, here's what my patches do: + + 1) Deleted the `<h4>Menu</h4>' at the beginning of each menu. Using + `<h4>' is wrong since menus don't usually come after an `h3' + header. `<b>' looks the same on most browsers, but my opinion is + that there's no need for any header at all! + + 2) Deleted the `<li>' kludge at the begining of each menu. It's no + longer needed since I'm deleting the </ul> kludge. + + 3) Replace `in_menu_para', declared static in makeinfo.c:add_char() + with `had_menu_commentary', declared globally. Modified + insertion.c:begin_insertion() to initialize had_menu_commentary to + 1 when beginning a menu. Now there's enough state information for + menu commentary to be processed within <menu> ... </menu>; the + commentary can be seperated from the rest of the menu by bracketing + it between <p>'s. + + Note that the first patch had a bug initializing + had_menu_commentary; the second patch fixes this bug. + + 4) Changed the semantics of the argument to + node.c:glean_node_from_menu(). Previously, glean_node_from_menu() + only called remember_node_reference() when the argument was + non-zero. But add_char() didn't call `glean_node_from_menu(1)' + when processing detailmenu entries. In other words, detailmenu + entries didn't get registered as references, which lead to the html + conversion of detailmenu entries not producing proper hrefs! + + The new semantics are that glean_node_from_menu always calls + remember_node_reference(), but calls it with `menu_reference' when + the first arg to glean_node_from_menu() is 1 and with + `followed_reference' otherwise. Now, detailmenu entries get + registered as `followed_reference' (normal menu entries still get + registered as `menu_reference') and the html conversion produces + proper hrefs. + + 5) The above changes made it possible to streamline the section of + add_char() that deals with html menu text. + + 6) In an otherwise unrelated change, rewrote a section of + glean_node_from_menu to no longer use `goto save_node;'. + + +Thu Jan 21 12:55:42 1999 Karl Berry <karl@gnu.org> + + * doc/info-stnd.texi: OK, let's try restoring the @include + version.texi with the new automake. + + * makeinfo/cmds.c: Improve HTML @pounds, @bullet, etc. + + * doc/Makefile.am (install-tex): new target. + (EXTRA_DIST): Include txi-??.tex. + txi-de.tex: new file from kama. + + * Makefile.am (AUTOMAKE_OPTIONS): Bump to 1.4. + (install-tex): new target. + + * util/texi2dvi: Restore "$@" for explicitness in main loop. + + * doc/Makefile.am (*.1) [TEXINFO_MAINT]: Conditionalize. + + * configure.in (AC_PREREQ): Bump to 2.13. + (TEXINFO_MAINT): Define this AM_CONDITIONAL. + + * doc/texinfo.txi: Document that the HTML output name is derived + from @setfilename. + + * makeinfo/makeinfo.c (convert_from_loaded_file): Use @setfilename + for basename of html output. + + * doc/texinfo.txi (url): Use example.org for the example. + + * makeinfo/cmds.c (cm_url): @url should not produce a link, sorry + to say. + +Wed Jan 20 16:31:55 1999 Karl Berry <karl@gnu.org> + + * util/texindex.c, + * util/install-info.c, + * makeinfo/makeinfo.c, + * info/info.c: It's 1999. + + * doc/info.texi (Advanced info commands): Fix typos from Gildea. + + * makeinfo/makeinfo.c (end_of_sentence_p): don't check negative + array offset. + From: Enrico Scholz <enrico.scholz@wirtschaft.tu-chemnitz.de> + +Sun Jan 17 16:42:16 1999 Karl Berry <karl@gnu.org> + + * util/texi2dvi: Restore --batch, handle changing escape character + more cleanly. From Akim (as always). + +Thu Jan 14 16:47:41 1999 Karl Berry <karl@gnu.org> + + * configure.in (ALL_LINGUAS): Add no. + From: Trond Endrestol <trond@agamemnon.gtf.ol.no> + + * util/texi2dvi: Doc fix from Akim and do not always exit 1 from trap. + And it's 1999. + + * doc/texinfo.txi (image): Document imagename.pdf. + + * Apply this change from Eli: + + 1998-11-20 Eli Zaretskii <eliz@is.elta.co.il> + + * makeinfo/makeinfo.h (meta_char_pos): New variable. + * makeinfo/makeinfo.c (init_paragraph): Initialize it. + (add_char): Use META to create a non-breakable space character. + (add_meta_char): New function. + (end_of_sentence_p): Don't handle characters at meta_char_pos as + normal sentence enders. + (flush_output): Only unMETA the non-breaking space character. + Reset meta_char_pos to zero. + (do_flush_right_indentation): Call adjust_braces_following. + (indent): Likewise. + (cm_value): Save and restore the value of meta_char_pos. + (expansion): Likewise. + * makeinfo/macro.c (me_execute_string_keep_state): Save and + restore the value of meta_char_pos. + * makeinfo/node.c (cm_node): Save and restore the value of + meta_char_pos. + * makeinfo/cmds.c (cm_accent): Make the dot we add due to + @dotaccent be a meta-character. + (cm_code, cm_dfn): Call add_meta_char to insert the closing + quote. + (cm_cite): Call add_char instead of add_word. + +Thu Jan 7 18:04:26 1999 Karl Berry <karl@gnu.org> + + * util/texi2dvi: Handle pdf files more cleanly. From Akim. + +Wed Jan 6 17:49:11 1999 Karl Berry <karl@gnu.org> + + * makeinfo/makeinfo.c (cm_image): Check for .png also. + +Sun Dec 20 07:54:47 1998 Karl Berry <karl@gnu.org> + + * util/texi2dvi: Add --pdf. + + * util/texi2dvi: New option -@ to use @input and @nonstopmode, in + case texinfo is preloaded. + From: Khimenko Victor <khim@sch57.msk.ru> + Date: Sun, 20 Dec 1998 02:04:12 +0300 (EET) + +Sat Dec 19 17:37:37 1998 Karl Berry <karl@gnu.org> + + * doc/texinfo.txi (Multitable Column Widths): leading zero ok for + @columnfractions. + + * util/texi2dvi: New version from Akim, plus --quiet is like + --batch, etc. + +Fri Dec 18 17:22:44 1998 Karl Berry <karl@gnu.org> + + * doc/texinfo.txi: Document that the Texinfo source can't be + arbitrarily ordered (for print) even if all pointers are supplied. + + * makeinfo/insertion.c (end_insertion): In itemize case, + close_insertion_paragraph so @end itemize cause a line break. + Report from: Sergei Pokrovsky <pok@nbsp.nsk.su> + Date: Sun, 22 Nov 1998 19:45:21 +0700 (GMT) + +Tue Dec 15 16:21:51 1998 Karl Berry <karl@gnu.org> + + * doc/texinfo.txi: More fixes from Oleg. + + * configure.in: Bump version to 3.12c for next pretest. + + * util/install-info.c (open_possibly_compressed_file) + [STRIP_DOT_EXE]: logic for compression_program assignment + was reversed. + From: wlestes@wlestes.uncg.edu + +Sat Dec 12 18:02:48 1998 Karl Berry <karl@gnu.org> + + * Merged these changes from Andreas: + +1998-12-06 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> + + * makeinfo/node.c (cm_node): When searching for @menu don't + require a space after it. + +1998-12-06 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> + + * makeinfo/cmds.c (cm_top): free top_name only after done using it. + +Sat Dec 12 15:40:13 1998 Karl Berry <karl@gnu.org> + + * doc/texinfo.txi: Various typos and fixes from Oleg. + + * doc/texinfo.txi: Move @node's outside of @ifinfo for the sake of + HTML processing. + + * doc/texinfo.txi (titlepage): @pxref was not in parens. From Oleg. + +Sun Dec 6 16:49:09 1998 Karl Berry <karl@gnu.org> + + * dir-example: Amd is now am-utils. + + * doc/Makefile.am: Reinstate help2man invocations for development. + + * doc/texinfo.txi: Document @set...contentsaftertitlepage (from kama). + Fix incorrect sense for @image and Hungariam typo (from Oleg). + + * lib/system.h: #include libintl.h here instead of acconfig.h, so + the system include files have a chance to #define NULL + before it does. + * acconfig.h: Remove libintl.h and #defines from here. + From: "Philippe De Muyter" <phdm@macqel.be> + Date: Fri, 4 Dec 1998 00:56:25 +0100 (CET) + + * info/signals.c: Start #ifdef's in column one for cc on sysv68 + (m68k-motorola-sysv). + From: "Philippe De Muyter" <phdm@macqel.be> + Date: Fri, 4 Dec 1998 00:56:25 +0100 (CET) + + * info/filesys.c (is_dir_name): use strcpy instead of automatic + array initialization. + From: "Philippe De Muyter" <phdm@macqel.be> + Date: Fri, 4 Dec 1998 00:56:25 +0100 (CET) + + * configure.in (ALL_LINGUAS): add ru. + +Fri Dec 4 08:12:11 1998 Karl Berry <karl@gnu.org> + + * info/infodoc.c: Gettextize the help buffer string. + +Sun Nov 29 17:12:35 1998 Karl Berry <karl@gnu.org> + + * doc/texinfo.txi: Use @ifnottex rather than @ifinfo for @top. + (makeinfo top): document this. + + * doc/info-stnd.texi, + * doc/info.texi: Use @ifnottex rather than @ifinfo for @top. + + * makeinfo/insertion.c (cm_menu): Implicitly insert @top command + so we can construct the node tree as usual when we see @menu + before @node. Probably this is when the input uses + @ifinfo instead of @ifnottex, as virtually all existing + manuals do. + + * makeinfo/insertion.c (discard_insertions): Let any conditional + cross node boundary. (So the @top node can be wrapped + in @ifnottex, for example.) + + * Installed these: + +1998-11-21 Eli Zaretskii <eliz@is.elta.co.il> + + * makeinfo/makeinfo.c (expansion): Save and restore + last_inserted_character and last_char_was_newline. + + * makeinfo/cmds.c (cm_dircategory): Kill any indentation before + INFO-DIR-SECTION. install-info relies on this. + +1998-11-20 Eli Zaretskii <eliz@is.elta.co.il> + + * makeinfo/multi.c (struct env): Add meta_char_pos member. + (select_output_environment): Save and restore meta_char_pos. + (out_char): Output characters by switching environment to #0 and + calling insert. Call flush_output when a newline is output. + (output_multitable_row): Update the current environment's + output_paragraph_offset as well, after removing trailing + whitespace. Fix typo in loop index. + (do_multitable): Call close_single_paragraph. + (end_multitable): Call close_insertion_paragraph. Don't output + an extra newline. + +1998-11-20 Eli Zaretskii <eliz@is.elta.co.il> + + * makeinfo/makeinfo.h (meta_char_pos): New variable. + * makeinfo/makeinfo.c (init_paragraph): Initialize it. + (add_char): Use META to create a non-breakable space character. + (add_meta_char): New function. + (end_of_sentence_p): Don't handle characters at meta_char_pos as + normal sentence enders. + (flush_output): Only unMETA the non-breaking space character. + Reset meta_char_pos to zero. + (do_flush_right_indentation): Call adjust_braces_following. + (indent): Likewise. + (cm_value): Save and restore the value of meta_char_pos. + (expansion): Likewise. + * makeinfo/macro.c (me_execute_string_keep_state): Save and + restore the value of meta_char_pos. + * makeinfo/node.c (cm_node): Save and restore the value of + meta_char_pos. + * makeinfo/cmds.c (cm_accent): Make the dot we add due to + @dotaccent be a meta-character. + (cm_code, cm_dfn): Call add_meta_char to insert the closing + quote. + (cm_cite): Call add_char instead of add_word. + +Sun Nov 29 16:30:06 1998 Karl Berry <karl@gnu.org> + + * info/info.h, + * info/footnotes.h (FOOTNOTE_LABEL), + * info/indices.c (APROPOS_NONE): Use N_ rather than _. + + * info/infodoc.c (create_internal_info_help_node, + function_documentation): Do not translate the empty string. + Date: Fri, 25 Sep 1998 15:09:42 +0400 + From: "Oleg S. Tihonov" <tihonov@ffke-campus.mipt.ru> + + * doc/info-stnd.texi: Mention PRIOR as another alias for + PREVIOUS/PageUp. + + * doc/texinfo.txi: @emph produces _emph_ not *emph*. Spurious + junk before makeinfo bison example. + From: tihonov@ffke-campus.mipt.ru. + +1998-11-16 Eli Zaretskii <eliz@is.elta.co.il> + + * makeinfo/defun.c (defun_internal): Don't expand the arguments to + @defun and its ilk. + + * makeinfo/makeinfo.c (expansion): Copy the name of the currently- + executing command and restore it after expansion. + +Sun Nov 15 17:40:51 1998 Karl Berry <karl@gnu.org> + + * makeinfo/makeinfo.c: Rearrange usage, allow -v for verbose, only + output `Making' line when verbose. + * makeinfo/makeinfo.h (process_html, process_info, process_tex): + declare. + * makeinfo/cmds.c: Use conditional commands. + * makeinfo/insertion.c (find_type_from_name): Handle rawhtml and + rawtex. + (conditional commands): Allow individual switching on and off. + + * makeinfo/insertion.h: Declare conditionals. + +1998-11-14 Eli Zaretskii <eliz@is.elta.co.il> + + * makeinfo/insertion.c (begin_insertion, end_insertion): Use <pre> + to convert @display and @smalldisplay into HTML. + + * makeinfo/cmds.c (cm_asterisk): Don't insert an extra newline in + HTML mode, since input includes a newline right after the @*. + (cm_sp): Output "<br><p>\n" as many times as the argument says. + (cm_url): Don't include "<a href=" in the anchor text in HTML + output. + + * makeinfo/makeinfo.c (cm_pxref): Don't add a period after @pxref + if in HTML mode. + (get_rest_of_line): Accept an additional argument EXPAND, and + expand the rest of line if it's non-zero. All callers changed. + (close_paragraph): When in HTML mode, honor the formatting of the + source paragraphs by generating "<p>" for every closed paragraph; + follow it by as many "<p>"'s as paragraph_spacing specifies. + +Sat Nov 14 17:38:27 1998 Karl Berry <karl@gnu.org> + + * makeinfo/insertion.c: Use <ul compact> instead of deprecated <menu>. + Omit extra <li> after the menu beginning. + + * makeinfo/index.c: Use <ul compact> instead of deprecated <menu>. + +Thu Nov 12 16:33:09 1998 Karl Berry <karl@gnu.org> + + * Makefile.am (EXTRA_DIST): add djgpp/config.sed. + + * info/terminal.c: #include <sys/ioctl.h> to define TIOCGWINSZ + under LynxOS. From: Marius Groeger <mag@sysgo.de>. + +1998-11-06 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> + + * makeinfo/insertion.c (begin_insertion): Correctly handle + ifnottex and ifnothtml. + (end_insertion): Likewise. + +Sun Nov 8 17:30:23 1998 Karl Berry <karl@gnu.org> + + * makeinfo/index.c, + * makeinfo/insertion.c: Menu is special to Info. + * makeinfo/node.c: Top is a special name, don't translate it. + * info/session.c (info_top_node): Top is a special name, don't + translate it. + From: "Oleg S. Tihonov" <tihonov@ffke-campus.mipt.ru>. + +Fri Nov 6 17:18:43 1998 Karl Berry <karl@gnu.org> + + * configure.in: Version 3.12b. + + * util/texi2dvi: Fixes from Eli and Christoph Martin. + + Mon Oct 5 13:58:53 1998 Dave Glowacki <dglo@ssec.wisc.edu> + * util/install-info.c: Fix off-by-one error in findlines() + + * util/texindex.c (usage): avoid trigraph until Ulrich fixes + po2tbl.sed.in. From Paul Eggert. + +1998-11-03 Eli Zaretskii <eliz@is.elta.co.il> + + * makeinfo/makeinfo.c (cm_xref): Don't bypass the test that an + xref ends with a period or a comma if the reference has a single + argument. + +1998-10-31 Eli Zaretskii <eliz@is.elta.co.il> + + * makeinfo/insertion.c (end_insertion): Don't decrement + in_fixed_width_font when leaving a menu, the previous value is + restored by pop_insertion. + + * makeinfo/makeinfo.c (add_char): Don't increment output_column + twice when a newline is inserted into the output. + + * doc/texinfo.txi (emph & strong): Document the use of underscores + for @emph in the Info output. + +1998-10-30 Eli Zaretskii <eliz@is.elta.co.il> + + * djgpp/config.bat: Make sure intl/po2tblsed.in exists before we + begin the configure boogie. + * djgpp/config.sed: Sed script, to be run by config.bat. + + * doc/info-stnd.texi (Node Commands): Document the new G command. + + * info/session.c (info_follow_menus): Step over a possible leading + space in a menu entry in menus[]. + (split_list_of_nodenames): Renamed from split_words. Split the + string on commas, not on spaces, since a menu entry can have + embedded whitespace. Get past the null byte after inserting it. + (info_menu_sequence): Don't crash if there's no DIR node; try + using Top of the current Info file, and if that doesn't work + either, throw an error. + + * util/texi2dvi: Use $path_sep in TEXINPUTS. Don't include any + dots in $tmpdir, 8+3 filesystems won't like that. + + * makeinfo/makeinfo.c (reader_loop): Expand any macros in a menu + entry when creating a <menu> item for HTML. Fix an off-by-one + error in counting input lines. + + * makeinfo/files.c (expand_filename): Don't treat .foo/bar as + absolute file name. + + * makeinfo/makeinfo.c (add_char): Use strncpy instead of memcpy, + since the buffers overlap. If the line being refilled includes + nothing but the indentation and the word being added, do NOT add + an extra newline. + + * util/install-info.c (strip_info_suffix, menu_item_equal, + open_possibly_compressed_file) [__MSDOS__]: Allow .inz and .igz as + suffuxes for compressed files. + (open_possibly_compressed_file): Return an indication whether we + opened a file or a pipe. Use FOPEN_RBIN from system.h. + [STRIP_DOT_EXE]: Use gzip.exe with an explicit .exe extension. + [O_BINARY]: If the file is not compressed, switch its stream to + text mode. + (readfile): Close the file or the pipe. + (output_dirfile): Call pclose to actually run the compressor. + +Thu Nov 5 08:33:06 1998 Karl Berry <karl@gnu.org> + + * doc/texinfo.txi: effect -> affect + From: Eric Hanchrow <offby1@blarg.net> + +Tue Nov 3 14:26:59 1998 Karl Berry <karl@gnu.org> + + * makeinfo/makeinfo.c (cm_image): Allocate enough space for the + zero byte. + + * doc/texinfo.txi: Document epsf.tex standard location. + +Tue Oct 27 10:45:47 1998 Karl Berry <karl@gnu.org> + + * Makefile.am (TEXINFO_TEX): add definition. + + * doc/info-stnd.texi: Avoid unnecessary overfull boxes from + examples. + + * doc/Makefile.am (install-data-local): missing ". + + * doc/Makefile.am: Don't try to run help2man in distribution. + +Mon Oct 26 13:43:53 1998 Karl Berry <karl@gnu.org> + + * configure.in (TEXMF): lose this whole block. It is too painful + to maintain with the different tex installations out there. + + * util/Makefile.am (EXTRA_DIST): update-info renamed to + fix-info-dir. + + * makeinfo/footnote.h: Doc fix. + + * makeinfo/multi.c: #include "insertion.h" + * makeinfo/cmds.c: #include "node.h" + * makeinfo/makeinfo.h, + * makeinfo/makeinfo.c: Move globals, functions for insertions and + nodes. + * makeinfo/defun.c: #include "insertion.h" + * makeinfo/Makefile.am: Add insertion.[ch], node.[ch]. + * node.[ch], insertion.[ch]: New files. + + * makeinfo/makeinfo.c, + * makeinfo/makeinfo.h: Move globals for cmds.h. + * makeinfo/index.h: Include cmds.h. + * makeinfo/Makefile.am (makeinfo_SOURCES): Add cmds.h, cmds.c. + * cmds.c, cmds.h: New files. + +Sat Oct 24 17:28:14 1998 Karl Berry <karl@gnu.org> + + * makeinfo/makeinfo.c, + * makeinfo/makeinfo.h: Globals for files.c. + * makeinfo/Makefile.am (makeinfo_SOURCES): add files.[ch]. + +Tue Oct 20 17:03:10 1998 Karl Berry <karl@gnu.org> + + * makeinfo/Makefile.am (makeinfo_SOURCES): add macro.c and + macro.h. + * makeinfo/makeinfo.c: Move macro code to macro.h and macro.c. + * makeinfo/makeinfo.h: Move macro stuff to macro.h, expose global + last_char_was_newline for macro.c. + * makeinfo/index.c, + * makeinfo/footnote.c: #include macro.h. + +Wed Oct 7 16:24:07 1998 Karl Berry <karl@gnu.org> + + * doc/info-stnd.texi: For now don't include version.texi due to + automake error. + + * makeinfo/index.h: #include makeinfo.h for sake of COMMAND type. + * makeinfo/index.c: No need to include makeinfo.h, index.h does + now. + + * makeinfo/makeinfo.c: Move footnote code to footnote.c. + * makeinfo/makeinfo.h: Globals for footnote.c. + * makeinfo/Makefile.am (makeinfo_SOURCES): add footnote.[ch]. + + * makeinfo/makeinfo.c: Move defun code to defun.c, necessary + global to makeinfo.h. + * makeinfo/makeinfo.h (default_indentation_increment): move here + for defun.c. + * makeinfo/Makefile.am (makeinfo_SOURCES): add defun.c. + + * Makefile.am: Doc fix. + + * configure.in (AC_OUTPUT): generate makeinfo/tests/Makefile. + + * makeinfo/makeinfo.c, + * makeinfo/makeinfo.h, + * makeinfo/Makefile.am (makeinfo_SOURCES): add index.[ch]. + +Fri Oct 2 17:42:26 1998 Karl Berry <karl@gnu.org> + + * lib/system.h (STREQ): new macro. + +Thu Oct 1 09:26:57 1998 Karl Berry <karl@gnu.org> + + * doc/texinfo.txi: Delete spare copy since out of date, + add makeinfo html to menu, + detailmenu doesn't take braces in summary. + +Wed Sep 30 14:38:21 1998 Karl Berry <karl@gnu.org> + + * makeinfo/makeinfo.c: Remove != NULL comparisons, + xmalloc/xrealloc casts, assignments in if statements. + +Wed Sep 30 14:16:01 1998 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c: Remove NULL casts and parentheses in return + statements. + + * makeinfo/makeinfo.c (add_link): Don't add a link if the node is null. + (reader_loop): don't glean_node_from_menu if detailmenu, even if html. + Various formatting changes. + + * doc/help2man: Always exit successfully. + + * makeinfo/Makefile.am (SUBDIRS): add. + (makeinfo_SOURCES): no more html.h. + +Fri Sep 11 18:47:15 1998 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c: Fiddle with html output. + +1998-09-07 Eli Zaretskii <eliz@is.elta.co.il> + + * makeinfo/makeinfo.c (maybe_update_execution_strings): Only + reallocate TEXT if the existing storage is too small, otherwise + leave TEXT alone. + (replace_with_expansion): Call maybe_update_execution_strings to + reallocate input_text if we are executing_string, since storage + for execution_string is assumed to be large enough to hold every + possible string. + (me_execute_string): xstrdup the argument, so callees could freely + relocate it as needed. + +1998-09-06 Eli Zaretskii <eliz@is.elta.co.il> + + * makeinfo/makeinfo.c (replace_with_expansion): Don't remember + macro-expansion pointers if we are executing_string. + +1998-09-05 Eli Zaretskii <eliz@is.elta.co.il> + + * info/filesys.c (info_suffixes): Put the empty suffix last in the + list, so that `foo.info' is found before `foo', if both exist. + +1998-09-05 Eli Zaretskii <eliz@is.elta.co.il> + + * makeinfo/makeinfo.c (maybe_update_execution_strings): New + function, updates an entry in execution_strings[] array after + input_text is relocated by replace_with_expansion. + (replace_with_expansion): Call it. + +1998-09-04 Eli Zaretskii <eliz@is.elta.co.il> + + * makeinfo/makeinfo.c (expand_macro): If a macro is called with + too many arguments, return NULL and print the line number where + the call begins. + (execute_macro): If expand_macro returns NULL, return + immediately. + +Sun Sep 6 19:11:28 1998 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c, + * makeinfo/makeinfo.h, + * makeinfo/multi.c: Html output. Specifically, these changes: + + Fri Jul 4 22:58:29 1997 Dave Love <d.love@dl.ac.uk> + + * doc/makeinfo.texi: Document HTML output. + + * makeinfo/makeinfo.c: Wrap strings in _() in bits changed for + HTML. + (cm_image): Generate <img> for HTML. + + Sun Jun 22 22:50:07 1997 Dave Love <d.love@dl.ac.uk> + + * makeinfo/makeinfo.c (NAMED_NODE_ANCHORS): New define. + (title, outstanding_node, node_number, node_node_references, + escape_html, ifinfo_as_html): New variables. + (tentry.number, node_ref.number, fn.number): New fields. + (CommandTable): Various additions and alterations for HTML. + (long_options): Add html and no-info-as-html. + (main): Extra code for HTML. + (usage): Add HTML stuff. + (expand_filename): Deal with .html. + (escape_string): New procedure. + (convert_from_loaded_file): Extra code for HTML. + (init_internals): Call free_node_references, initialize + node_number. + (reader_loop): Process menu items for HTML hyperlinks. Escape + HTML special characters. + (add_char): Code for line breaks and paragraph insertions in + HTML. + (flush_output): Don't UNMETA for HTML. + (indent): Do nothing for HTML. + (current_item_function): Case for ifhtml. + (begin_insertion): Deal with HTML in various cases. + (insert_html_tag): new procedure. + (cm_asterisk, cm_copyright, cm_accent, cm_code, cm_kbd, + cm_angle_brackets, cm_var, cm_defn, cm_var, cm_emph, cm_string, + cm_cite, cm_top, cm_xref, cm_inforef, cm_uref, cm_direntry, + cm_ifinfo, cm_item, process_defun_args, defun_internal, cm_sp, + cm_dircategory, cm_center, cm_result, cm_expansion, cm_error, + cm_exdent, index_add_arg, make_index_entries_unique, + cm_printindex, cm_footnote, output_pending_notes, + me_execute_string): Code for HTML. + (cm_shyph): New procedure. + (cm_special_char): Add start, end args. Code for HTML. + (cm_email, cm_url, cm_i, cm_b, cm_r): New procedures. + (sectioning_html): New procedure. + (sectioning_underscore): Use it. + (add_link): New procedure. + (remember_node): Add number field and update node_number. Note + next, etc. nodes for HTML. + (add_escaped_anchor_name, add_anchor_name): New procedures. + (cm_node): New code for HTML. Move some other code to more + useful place. + (remember_node_reference): Add number field and update + node_number. + (remember_node_node_reference, free_node_node_references, + number_of_node): New procedures. + (cm_ifhtml, cm_html): New procedures. + (expansion): Take care of HTML escaping. + (cm_settitle): New procedure. + (remember_note): Set number field. + + Declare various procedures in advance. + + * doc/texinfo.txi: Makeinfo --html documentation from Dave Love. + Typo fixes from: Paul DuBois <dubois@primate.wisc.edu>. + +Thu Sep 3 11:11:01 1998 Karl Berry <karl@cs.umb.edu> + + * makeinfo/Makefile.am (makeinfo_SOURCES): add html.[ch]. + +1998-08-28 Eli Zaretskii <eliz@is.elta.co.il> + + * makeinfo/makeinfo.c (cm_uref, cm_email): Use get_xref_token to + gather arguments. + (get_xref_token): Keep track of input line number when expanding + xref arguments. + +Tue Aug 25 14:36:44 1998 Karl Berry <karl@cs.umb.edu> + + * util/texi2dvi: Exit the script if TeX exits with bad status. + +1998-08-16 Eli Zaretskii <eliz@is.elta.co.il> + + * info/indices.c (info_index_apropos): In the *Apropos* + menu, print the label first, then the Info file name and + the node name. Make the Info file name part of the menu + entry, so that all entries are distinct. + (apropos_in_all_indices): Scan each Info file only once, thus + avoiding multiple identical entries in the *Apropos* menu. + Free xstrdup'ed buffer, to avoid leaking memory. + +Thu Aug 13 12:54:58 1998 Karl Berry <karl@cs.umb.edu> + + * configure.in: Set version to 3.12a. + + * Makefile.am (AUTOMAKE_OPTIONS): bump required version to 1.3, + add readme-alpha option. + + * util/texindex.c (program_name), + * util/install-info.c (progname), + * info/info.c (program_name), + * makeinfo/makeinfo.c (progname): hardwire per coding standards. + * doc/help2man: Remove ginfo special case. + +Tue Aug 11 17:41:15 1998 Karl Berry <karl@cs.umb.edu> + + * util/gen-dir-node: New version from drk@sgi.com. + +Mon Aug 10 13:55:37 1998 Karl Berry <karl@cs.umb.edu> + + * dir-example: Add entries from Linux. + + * info/info-utils.c (get_window_of_node): New fn. + * info/info-utils.h (get_window_of_node): New fn. + * (strchr,...) [!HAVE_STRCHR]: remove these #defines. + * info/infodoc.c (info_find_or_create_help_window): Call + get_window_of_node instead of get_internal_info_window. + This is so pressing ? repeatedly will always get to the same Help + window instead of popping up new ones. + From: "Brian J. Fox" <bfox@prospero.datawave.net> + + * info/signals.c: Ignore SIGWINCH if we're in the midst of it. + We might get a whole lot of them. Noticed on Afterstep. + From: "Brian J. Fox" <bfox@prospero.datawave.net> + +1998-07-25 Bruno Haible <bruno@linuix.math.u-bordeaux.fr> + + * install-info.c (findlines): Allocate room for one more line, + to avoid crash if dir file has exactly 512 lines. + +Tue Aug 4 07:14:35 1998 Karl Berry <karl@cs.umb.edu> + + * info/info.c: Improve help message. + + * dir-example: Add mtools. + +Fri Jul 31 13:29:52 1998 Karl Berry <karl@cs.umb.edu> + + * doc/help2man: Various hacks for texinfo. + + * doc/texinfo.txi: Make dir entries more consistent. + + * doc/Makefile.am: Generate man pages with help2man. + + * util/texi2dvi, + * util/install-info.c, + * makeinfo/makeinfo.c, + * util/texindex.c: Improve help message. + + * doc/info.5: Initial. + * doc/texinfo.5: Section 5. + +Thu Jul 30 17:31:42 1998 Karl Berry <karl@cs.umb.edu> + + * doc/info-stnd.texi, + * doc/texinfo.txi: Use Automake-standard VERSION and UPDATED. + +Wed Jul 29 17:34:41 1998 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.txi: Describe macro limitations a bit more. + + * dir-example: Correct makeinfo link. + +Tue Jul 28 16:44:06 1998 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (remember_brace_1): xstrdup command, since + we free it later. + +Mon Jul 27 16:27:30 1998 Karl Berry <karl@cs.umb.edu> + + * info/session.c (node_printed_rep): New fn. + Change calls. + + * info/session.c (info_set_node_of_window): Simplify by taking new + argument to say whether to call + set_remembered_pagetop_and_point. Change calls. + * info/indices.c: Change call. + + * info/info.c: Rewrite initial menu-sequence following stuff as a + function in session.c, and call it. + + * info/infomap.c: Define `G' as info_menu_sequence. + * info/session.h (info_menu_sequence, info_follow_menus): declare + new fns. + * info/session.c (info_follow_menus, split_words, + * info_menu_sequence): New functions for new command. + +Thu Jul 23 16:44:42 1998 Karl Berry <karl@cs.umb.edu> + + * info/session.c (info_scroll_other_window_backward): new command. + * info/infomap.c (initialize_info_keymaps): bind M-DEL and M-prior to + scroll-other-window-backward. + Report from: Vladimir Alexiev <vladimir@cs.ualberta.ca> + Date: Tue, 2 Dec 1997 14:54:30 -0700 + + * info/info-utils.c (printed_representation): If ISO_Latin_p, show + characters as-is. Don't assume iscntrl(x) returns false + for meta characters. + Report from: Francois Pinard <pinard@iro.umontreal.ca> + Date: 15 Jan 1998 17:48:51 -0500 + + * info/pcterm.c (pc_initialize_terminal): now no need to set it + here. + * info/info-utils.c (ISO_Latin_p): set to 1 by default. + + * doc/info-stnd.texi: Document SPC, add goto-node anchor. + +Wed Jul 22 18:58:38 1998 Karl Berry <karl@cs.umb.edu> + + * info/window.c (message_buffer_to_node), + * info/session.c (kill_node), + * info/nodes.c (info_get_node_of_file_buffer, + info_node_of_file_buffer_tags), + * info/man.c (manpage_node_of_file_buffer), + * info/footnotes.c (make_footnotes_node): set display_pos member + in new node. + +Tue Jul 21 14:04:52 1998 Karl Berry <karl@cs.umb.edu> + + (all of this is to make SPC/DEL not move outside the current + document, i.e., not up through dir) + * info/info-utils.h (info_label_was_found): Move from here. + * (info_prev_label_of_node): Don't use it any more. + * info/session.c (INFO_LABEL_WAS_FOUND): Move to here, add test + for filename not dir. + (forward_move_node_structure): Change calls, notice if no more nodes. + (backward_move_node_structure): Check for moving outside current + document to dir. + * info/filesys.c (compression_suffixes): Add bz2 for bunzip2. + (is_dir_name): New fn. + * info/filesys.h: Declare it. + * info/nodes.c (info_get_node, info_find_file_internal): Use it. + + * makeinfo/makeinfo.c: Set in_fixed_width_font to avoid munging + node names. + +Sat Jul 18 17:14:10 1998 Karl Berry <karl@cs.umb.edu> + + * info/man.c (reap_children): Call wait (NULL), since we don't + actually use the return status for anything. NEXTSTEP 3.3 + doesn't like an int * even though that is the POSIX + specification. + Date: Fri, 22 Aug 1997 13:55:42 +0200 + From: "Felix H. Gatzemeier" <fxg@imib.rwth-aachen.de> + Via: Thomas Esser <te@informatik.uni-hannover.de> + + * info/session.c (kill_node): Restore point when we go back. + +Thu Jul 16 18:54:04 1998 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (BRACE_ELEMENT): Add `command' to the save + stack. + (MAYBE_BRACE_ARGS): New possibility, somewhat like TeX's + next-token-as-argument. + (command_table): Use cm_accent and MAYBE_BRACE_ARGS for all accents. + (read_command): Implement MAYBE_BRACE_ARGS. + (init_brace_stack): save current command. + (pop_and_call_brace): restore current command. + (cm_accent): move almost all accent characters to after the argument. + Suggested by Fran,cois. + + * info/info.c (version_string): Remove defn. + Change call for --version option. + * info/session.c (display_startup_message_and_start): Just use + VERSION. + * info/info.h (version_string): Remove decl. + +Tue Jul 14 16:46:58 1998 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.h: Doc fix. + + * makeinfo/makeinfo.c (validate_file): Don't complain about + unreferenced anchors. + + * doc/texinfo.txi: Document @anchor. + +Sun Jul 12 14:14:50 1998 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (remember_node): Only set `current_node' if + this is not an anchor. + + * info/nodes.c (get_tags_of_indirect_tags_table): Don't set + nodelen to -1 when fixing up the subfile entries, it might be 0 + from an anchor. + + * info/nodes.c (find_node_of_anchor): Offset display_pos for + anchor tags by the amount that node references are off by (- 1). + +Sat Jul 11 17:37:18 1998 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (cm_anchor): Add output_column for anchors + embedded in a line. + +Fri Jul 10 16:28:21 1998 Karl Berry <karl@cs.umb.edu> + + * info/session.c (info_menu_or_ref_item): Don't search for the + xref text if it's an anchor. + * info/nodes.h (N_FromAnchor): New NODE flag. + * info/nodes.c (find_node_of_anchor): New fn. + (info_node_of_file_buffer_tags): Handle anchor case. + +Wed Jul 8 17:48:59 1998 Karl Berry <karl@cs.umb.edu> + + * info/window.c (window_set_node_of_window): Set window->point to + node->display_pos. + Remove unneeded casts. + +Tue Jul 7 08:06:14 1998 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (add_word_args) [!VA_SPRINTF]: Use buffer, + not the undeclared temp_string. + From: Tobias Naehring <naehring@eeetw3.et.tu-dresden.de> + To: egcs-bugs@cygnus.com + Date: Mon, 6 Jul 98 13:51:55 +0200 + +Mon Jul 6 17:43:25 1998 Karl Berry <karl@cs.umb.edu> + + * info/nodes.h (NODE): Add display_pos member. + +Sun Jul 5 08:17:43 1998 Karl Berry <karl@cs.umb.edu> + + * info/nodes.h (INFO_REF_LABEL): Define. + + * util/texi2dvi: Rationalize use of `index' vs. more general + `xref'. + +Thu Jul 2 18:53:43 1998 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c: Don't translate -Footnotes, it's a magic + cookie. From Eli. + +Wed Jul 1 08:42:41 1998 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.txi (url): Missing word `command'. + +Tue Jun 30 10:35:48 1998 Karl Berry <karl@cs.umb.edu> + + * info/info.c: Missing \n in try --help msg. + + * makeinfo/makeinfo.c (cm_anchor): New fn for new cmd. + (TAG_FLAG_ANCHOR): New flag for tag entries. + (write_tag_table_internal): Handle anchor case. + (TAG_FLAG_{{PREV,NEXT,UP}_ERROR,NO_WARN,IS_TOP}): Add TAG_FLAG_ prefix + for clarity, change uses. + + * doc/texinfo.txi: Remove warning about footnotes with @item, that + works now. + +Mon Jun 29 10:17:50 1998 Karl Berry <karl@cs.umb.edu> + + * configure.in (AM_CONFIG_HEADER): Use second argument to be 8.3 + compliant. + * config.h.in: Rename to config.in. + + * info/Makefile.am (EXTRA_DIST), + * info/terminal.c [__MSDOS__]: Change #include to pcterm.c and + rename file. + +Sun Jun 28 14:29:27 1998 Karl Berry <karl@cs.umb.edu> + + * info/Makefile.am (EXTRA_DIST): Add pc_term.c. + + * makeinfo/makeinfo.c (HAVE_MACROS): Remove this conditional, we + always want macros now. + + * info/indices.c: Copyright. + +1998-06-26 Eli Zaretskii <eliz@is.elta.co.il> + + * makeinfo/makeinfo.c: (only_macro_expansion): New variable, + suppresses all expansions except macros. + (replace_with_expansion): New function, replaces a portion of + input text with its expansion. Avoids moving the text around if + we are positive it will expand into itself. If the length of the + expanded text is the same as the length of the original text, just + replaces the original text without moving the rest. Resyncs the + remembered text pointers with the realloc'ed input_text, when it + is realloc'ed. + (reader_loop): When only_macro_expansion is non-zero, only handle macros, but leave the rest of input intact. (read_command): Now returns an int, zero means no known command or macro is found after the prefix character; all callers changed. Support operation under non-zero only_macro_expansion. (cm_node): Expand only the macros in the @node line. Allocate and generate the macro-expanded @node line in one swell whoop. (glean_node_from_menu): Expand macros in menu entries. (get_xref_token): A new argument EXPAND, when non-zero, means expand macros in the entire brace-delimited argument before looking for the next comma; all callers changed. (expansion): Save and restore additional state variables important for output generation machinery. Disable indentation and filling during the recursive expansion, so that the output buffer offset is not invalidated by filling. (me_execute_string_keep_state): New function, calls me_execute_string, but saves and restores state variables important for output generation, so that -E doesn't change the generated Info output. (index_add_arg, cm_footnote): Call me_execute_string_keep_state. (expand_macro): New function, returns the macro expansion as a malloc'ed string. (execute_macro): Call expand_macro. (me_execute_string): Avoid memory leak by freeing input_filename. (get_until_in_braces, replace_with_expansion, add_char, cm_footnote, cm_macro, cm_unmacro, get_brace_args, extract_colon_unit): Use the faster memcpy/memmove instead of strncpy. -Sat Jun 27 14:18:54 1998 Karl Berry <karl@cs.umb.edu> +Sat Jun 27 14:18:54 1998 Karl Berry <karl@cs.umb.edu> + + * doc/info.texi: Use @subsubsection instead of + @unnumberedsubsubsection, since it's in a numbered chapter. + + * Started installation of following DOS patches from Eli. +>1998-05-16 Eli Zaretskii <eliz@is.elta.co.il> +> +> * info/session.c (info_goto_node): Don't show the nodes of the +> current Info file twice in *Completions*. +> * info/echo-area.c (ea_possible_completions): Actually pass the +> number of completions to printf_to_message_buffer. +> +> * info/man.c (manpage_node_of_file_buffer): xstrdup the nodename +> member of manpage nodes, since the tags are freed and recomputed +> when a new man page is added to *manpages* file_buffer. +> (get_manpage_node): Recompute info_windows[]->nodes[] for all +> windows showing the man pages after nodes[]->contents are +> invalidated by reallocation of file_buffer->contents. +> +>1998-05-15 Eli Zaretskii <eliz@is.elta.co.il> +> +> * lib/system.h (DEFAULT_INFO_PRINT_COMMAND) [__MSDOS__]: Define to +> ">PRN". +> * info/session.c (print_node): Support ">printer" in +> INFO_PRINT_COMMAND, to mean write to the named file/device insead +> of piping to it as a program. +> (kill_node): Compare window in addition to the nodename, when +> looking for the node to kill. +> +>1998-05-09 Eli Zaretskii <eliz@is.elta.co.il> +> +> * lib/system.h (SET_SCREEN_SIZE_HELPER) [__MSDOS__]: Define a new +> macro. +> * info/m-x.c (set_screen_height): Use SET_SCREEN_SIZE_HELPER, if +> defined. If the screen size did'n change, redisplay the previous +> screen contents. +> +> * info/infomap.c (initialize_info_keymaps) [__MSDOS__]: Bind DEL +> to ea_delete in the echo-area keymap. +> * info/session.c (incremental_search): If the key is +> isearch_terminate_search_key, but buffered input is pending, don't +> gobble the ESC key. +> +> * info/info.c (main): Switch the order thet terminal_prep_terminal +> and terminal_clear_screen are called, to make it consistent with +> what initialize_info_session does when called with non-zero second +> argument. Call terminal_unprep_terminal last, after moving the +> cursor to the bottom of the screen. If user_filename is of the +> form "d:foo", add "d:." to the INFOPATH, not "d:". +> +> * info/signals.c (initialize_info_signal_handler): Save old +> SIGUSR1 handler. +> (info_signal_handler): Handle SIGUSR1. +> +> * info/indices.c (info_apropos): Print the results to stdout. +> +>1998-05-02 Eli Zaretskii <eliz@is.elta.co.il> +> +> * makeinfo/makeinfo.c (ALSO_NULL_DEVICE): New macro, for alternate +> null device name. +> +> * info/man.c (get_manpage_contents): Redirect stderr of the man +> page formatter to the null device. +> (executable_file_in_path): Use IS_SLASH. +> +> * info/session.c (info_gather_typeahead) [__DJGPP__]: Call +> pc_term_chars_avail to get the number of pending characters. +> +> * info/filesys.c (convert_eols): New function, converts DOS-style +> EOLs to a single Newline. +> (filesys_read_info_file, filesys_read_compressed): Call it. +> (filesys_read_compressed) [STRIP_DOT_EXE]: Use explicit .exe +> suffix. +> (filesys_read_compressed): Check return status of `pclose'. +> +>1998-05-01 Eli Zaretskii <eliz@is.elta.co.il> +> +> * info/filesys.c (filesys_read_info_file): Add additional +> parameter: is_compressed. All callers changed. +> +> * makeinfo/makeinfo.c (convert_from_loaded_file): Compare file +> names with FILENAME_CMP. Use NULL_DEVICE. +> (cm_node): Compare file names with FILENAME_CMP. +> * info/tilde.c (tilde_find_suffix, tilde_expand_word): Use +> IS_SLASH. +> +> * info/pc_term.c: New file, handles the PC terminal on MS-DOS and +> MS-Windows. +> * info/terminal.c [__MSDOS__]: Include pc_term.c. +> * info/Makefile.in (ginfo_SOURCES): Add pc_term.c +> Add pc_term.c to dependencies of terminal.o. +> +> * info/session.c (info_get_input_char): Reassign tty after EOF +> from a non-stdin input stream. +> +>1998-04-30 Eli Zaretskii <eliz@is.elta.co.il> +> +> * info/session.c (info_set_input_from_file): Use binary input. +> (info_gc_file_buffers): Compare file names with FILENAME_CMP. +> * info/search.c (skip_whitespace_and_newlines): Use +> whitespace_or_newline macro instead of reinventing the wheel. +> * info/nodes.c (info_find_file_internal): Use IS_ABSOLUTE and +> FILENAME_CMP. +> (info_load_file_internal): Call filename_non_directory to find out +> where the basename begins. +> (get_tags_of_indirect_tags_table): Call filename_non_directory. +> containing_dir of "d:foo" is "d:.", not "d:". +> (forget_info_file): Compare file names with FILENAME_CMP. +> * info/nodemenu.c (get_visited_nodes): Use FILENAME_CMP to find +> duplicate lines. +> +> * lib/system.h (PIPE_USE_FORK): New macro. +> * info/man.c (get_manpage_contents): Use it to determine whether +> to call pipe/fork/exec or popen/pclose to run the man page +> formatter. +> (executable_file_in_path): Search for the file with several known +> extensions such as .exe, where appropriate. +> +> * lib/system.h (NULL_DEVICE): A new macro. +> * info/makedoc.c (main): Use it. +> (maybe_dump_tags): Switch output strem to binary mode when +> appropriate. +> (process_one_file): Update file_size after reading the file. +> +> * info/infodoc.c: Add TAB, RET, and `i' to the list of important +> commands in info_internal_help_text. +> +> * info/info.c (main): Support the --speech-friendly option. Use +> PATH_SEP to separate directories. +> (info_short_help) [__MSDOS__]: Mention the --speech-friendly +> option. +> +> * info/info-utils.c (filename_non_directory): Use HAVE_DRIVE and +> IS_SLASH. +> * info/indices.c (do_info_index_search, index_entry_exists): Use +> FILENAME_CMP to compare file names. +> * info/filesys.c: Add ".inf" to the list of known extensions. +> Look for .z before .Z, for the sake of case-insensitive +> filesystems. Add DOS-specific extensions to work around 8+3 +> namespace restrictions. +> (info_absolute_file): New function. +> (info_find_fullpath): Call it for candidates which are absolute +> file names. Use IS_SLASH and IS_ABSOLUTE. +> (info_file_in_path): Use IS_SLASH. +> (extract_colon_unit, info_add_path): Use PATH_SEP instead of ":". +> (lookup_info_filename): Compare file names with FILENAME_CMP. +> (filesys_read_info_file): Read Info files in binary mode. +> (filesys_decompressor_for_file): Read Info files in binary mode. +> Compare file names with FILENAME_CMP. On MS-DOS, allow files +> whose names end with a `z' be decompressed with gunzip. +> * info/dribble.c (open_dribble_file): Open dribble file in +> FOPEN_WBIN mode. +> * info/dir.c (maybe_build_dir_node): Use IS_SLASH. +> * util/texindex.c (maketempname): Put the numeric suffix after the +> dot, to salvage 3 more characters on 8+3 filesystems. +> +>1998-04-29 Eli Zaretskii <eliz@is.elta.co.il> +> +> * util/texindex.c (main): Use IS_SLASH to find the basename of +> argv[0]. Lose the .exe suffix, if any. +> (decode_command): Look at $TEMP and $TMP in addition to $TMPDIR. +> Use DEFAULT_TMPDIR. +> * util/texi2dvi: Use either `:' or `;' as directory separator in +> TEXINPUTS, computed at run time. Save previous versions of index +> files in a separate backup directory. +> * util/install-info.c (main): Support backslashes in file names by +> using IS_SLASH. Avoid recomputing length of infile_basename +> unnecessarily. Use FILENAME_CMP for comparing file names +> case-insensitively, where appropriate. Allow foo.inf as well as +> foo.info to be an Info file name. +> * lib/system.h (PATH_SEP, STRIP_DOT_EXE, FILENAME_CMPN, +> DEFAULT_TMPDIR): New macros. +> +>1998-04-25 Eli Zaretskii <eliz@is.elta.co.il> +> +> * lib/system.h (O_BINARY, SET_BINARY, FOPEN_RBIN, FOPEN_WBIN, +> IS_SLASH, HAVE_DRIVE, IS_ABSOLUTE, FILENAME_CMP, PATH_SEP, +> HAVE_LONG_FILENAMES): New macros. +> * makeinfo/makeinfo.c (find_and_load): Use O_BINARY to decide when +> read returning a value different from what st_size says is not an +> error. Realloc the buffer after we've read the file. +> (skip_directory_part): New function, skips leading directory in a +> way that works on DOSISH systems. +> (filename_non_directory, pathname_part): Call it. +> (filename_part): Call filename_non_directory. +> (expand_filename, full_pathname): Use IS_ABSOLUTE and IS_SLASH. +> (convert_from_file): Check .txi extension first. +> (split_file): Support splitting output files on 8+3 filesystems. +> (main, extract_colon_unit): Use PATH_SEP instead of ':'. +> (get_file_info_in_path): Use IS_ABSOLUTE and IS_SLASH. + + + * doc/texinfo.txi: Changes from Eli for MS-DOS stuff. + * doc/info-stnd.texi: Fixes from Eli: he documented all the + missing keys and command-line options, corrected + inaccuracies (probably left-overs from previous versions), + and added some clarifications where I thought the manual + was not clear enough. + * Makefile.am (EXTRA_DIST): Add djgpp files. + + * makeinfo/makeinfo.c: New no-op commands @setcontentsaftertitlepage + and @setshortcontentsaftertitlepage. + * doc/texinfo.txi: Document the new @set{,short}contentsaftertitlepage + commands and the possibility of putting @contents and + @shortcontents after @end titlepage. + + * util/texi2dvi: Check that the toc file has not changed (as well + as .aux and .??). + +Thu Jun 25 16:58:46 1998 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.txi: Document new commands @env, @command, @option. + + * makeinfo/makeinfo.c (option, command, env): New markup commands, same + as @code in info. + +Wed Jun 24 15:39:38 1998 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c: New no-op command @acronym. + + * doc/texinfo.txi: Document new command @acronym. + + * util/install-info.c (strip_info_suffix, menu_item_equal): New fns. + (main): Call them instead of doing the filename test inline; all the + .info variations are too confusing to write out twice. + +Tue Jun 23 18:01:40 1998 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.txi: Fix some overfull boxes. + +Mon Jun 22 19:22:17 1998 Karl Berry <karl@north> + + * configure.in: Remove AC_LINK_FILES call, that was an old gettext + thing, no longer necessary, and causes problems with Autoconf. + +Sun Jun 14 07:00:15 1998 Karl Berry <karl@cs.umb.edu> + + * util/texi2dvi: Indent options so help2man will work. From Akim. + +Sat Jun 13 10:45:25 1998 Karl Berry <karl@cs.umb.edu> + + * configure.in (ALL_LINGUAS): Add nl. + + * util/texi2dvi: Avoid tabs. + +Wed Jun 10 17:38:21 1998 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (gen_defindex): Use xmalloc instead of alloca. + This was our only use of alloca, so also remove all the #if junk + at the beginning to define it. + + * makeinfo/makeinfo.c: Fix grammar in multiply-defined-node error + message. + +Tue Jun 9 17:53:54 1998 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.txi: Document new commands @smallformat, + @smalldisplay. + + * makeinfo/makeinfo.c: New commands @smalldisplay and @smallformat. + Suggestion from: Eli Zaretskii <eliz@is.elta.co.il>. + + * makeinfo/makeinfo.h (insertion_type, insertion_type_names): + Declare smalldisplay and smallformat. + +Mon Jun 8 07:57:52 1998 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.txi: Document possibility of combining @titlefont + and @title. From Eli. + + * util/texi2dvi: Set verbose to : instead of false by default. + + * util/texi2dvi: Missing \\ for sed with -t text. From Akim. + +Sun Jun 7 13:02:13 1998 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.txi: Document @pagesizes and texidvi -t. + + * makeinfo/makeinfo.c: Define no-op @pagesizes and @afourpaper. + (major_version, minor_version): Remove these globals, just use the + Texinfo package version. + (print_version_info): Ditto. + +Fri Jun 5 17:54:16 1998 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.txi: Change texi2dvi documentation a bit. + + * util/texi2dvi: Handle --option=argument style of specifying + arguments. + +Sat May 30 14:01:37 1998 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.txi: More. + + * util/install-info.c (open_possibly_compressed_file): Finish + implementation. + + * doc/texinfo.txi: Document install-info compression support. + +Fri May 29 08:01:43 1998 Karl Berry <karl@cs.umb.edu> + + * util/install-info.c (open_possibly_compressed_file): Initial + implementation. + + * util/install-info.c (output_dirfile): Attempt to write dir.gz if + that's what we read. + (readfile): Pass back the actual opened filename, too. + + * info/indices.c: Check in Eli's patch. + +Thu May 28 17:09:45 1998 Karl Berry <karl@cs.umb.edu> + + * util/install-info.c (readfile): Set up to handle compressed + input (and output) files. Change callers. + Rearrange function order to avoid forward declarations. + + * configure.in: Remove check for libz, we'll fork gzip instead. + +Tue May 26 18:01:13 1998 Karl Berry <karl@cs.umb.edu> + + * util/install-info.c (print_help): Missing \n\ in help string. + + * makeinfo/makeinfo.c (POST_SENTENCE): Rename from post_sentence. + Change calls. + (flush_output): Strip 8th bit if post_sentence char as well as space. + (cm_code, etc.): Change add_char calls for post_sentence chars to set + 8th bit. + +1998-05-23 Eli Zaretskii <eliz@is.elta.co.il> + + * info/indices.c (info_next_index_match): Call + info_set_node_of_window to display the node, so that footnotes are + displayed as well. + +Thu May 21 11:05:50 1998 Karl Berry <karl@cs.umb.edu> + + * util/install-info.c (output_dirfile): New function, extracted + from the end of main. + + * makeinfo/makeinfo.c (begin_insertion): Ignore @group in all the + example-like environments, not just @example. Otherwise the first + line in the environment is not indented correctly. Reported by rms. + +Wed May 20 17:44:38 1998 Karl Berry <karl@cs.umb.edu> + + * util/install-info.c: Doc fixes. + + * util/install-info.c: Handle XEmacs-style dir entries: + * FILENAME::PROGRAM DESCRIPTION. + Date: Wed, 13 May 1998 13:58:28 +0900 + From: KIRIYAMA Kazuhiko <kiri@kiri.toba-cmt.ac.jp> + + Also, do not set something_deleted on continuation lines; they are only + deleted if the entry was deleted. + +Tue May 19 17:22:50 1998 Karl Berry <karl@cs.umb.edu> + + * util/install-info.c: Do not read the dir file if we are only + deleting -- it might not exist, and we don't actually need it. + From: David Kaelbling <drk@sgi.com> + Date: Tue, 12 May 1998 11:05:26 -0400 + + * util/gen-dir-node: + From: David Kaelbling <drk@sgi.com> + Date: Tue, 12 May 1998 16:05:16 -0400 - + - The "dir" moobler header is slightly different from the default + dir file. + - If all files in ${infofiles} appear in the skeleton the last one + is processed twice. + - INFO-DIR-SECTION data is ignored. + - Don't generate entries for directories. + +Sat May 16 17:16:56 1998 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (cm_novalidate): New fn for new command + @novalidate, like --no-validate. + +Thu May 14 18:02:31 1998 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.txi: Document the @novalidate command. + +Wed May 13 17:47:20 1998 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.txi: Document limitation on @set/@value names in + index commands. + +Fri May 1 14:12:15 1998 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.txi (Command List): @deftypevar out of order. + + * configure.in (ALL_LINGUAS): Add cs. + +Tue Apr 28 09:33:41 1998 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (strcasecmp): This is in lib now. + +1998-04-26 Richard Stallman <rms@psilocin.gnu.org> + + * util/install-info.c (print_help): Doc clarifications. + +Sun Apr 19 15:55:10 1998 Karl Berry <karl@cs.umb.edu> + + * lib/system.h (strcasecmp, strncasecmp) [!HAVE_STR[N]CASECMP]: + Declare these. + + * info/search.h (str[n]casecmp): Remove decl from here. + + * configure.in (AC_REPLACE_FUNCS): Check for strcasecmp and + strncasecmp here. + (AC_CHECK_FUNCS): Instead of just strcasecmp here. + + * configure.in (texconfig): Use TEXMFMAIN in preference to TEXMF + for post-0.4 teTeX. + +Wed Apr 15 17:20:31 1998 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.txi (Reporting Bugs): New section. + Suggestion from: Andrew Shapira <shapiraa@cs.rpi.edu> + Date: Mon, 4 Aug 1997 19:06:06 -0400 (EDT) + + * info/infomap.c: Define / to be info_search. + Suggestion from: Egil Kvaleberg <egil@kvaleberg.no> + Date: Fri, 1 Aug 1997 08:16:45 +0200 (MET DST) + + * doc/texinfo.txi (uref): Document reason for not using <URL: format. + Also use ftp.gnu.org instead of ftp.gnu.ai.mit.edu throughout. + +Tue Apr 14 10:43:39 1998 Karl Berry <karl@cs.umb.edu> + + 1998-04-05 Karl Eichwalder <ke@suse.de> + * makeinfo/makeinfo.c (begin_insertion): No need to + gettext; it's a keyword. From carl-friedriech.spilcke-liss@ensae.fr. + (cm_printindex): ditto. + + * util/texi2dvi: Always remove the $tmp_dir's. + From: Dean Gaudet <dgaudet@arctic.org> + Date: Tue, 14 Apr 1998 00:55:36 -0700 (PDT) + +Mon Apr 13 18:02:57 1998 Karl Berry <karl@cs.umb.edu> + + * configure.in: Include + AM_SYS_POSIX_TERMIOS + AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL + to avoid window resizing being ignored under glibc2 systems, + e.g., Red Hat Linux 5.0. Actually any system where the ioctls are not + defined in <termios.h>. + See also http://www-gnats.gnu.org:8080/cgi-bin/wwwgnats.pl/full/206. + * acconfig.h (GWINSZ_IN_SYS_IOCTL): New #undef for autoheader. + * info/termdep.h [GWINSZ_IN_SYSIOCTL]: #include <sys/ioctl> if + this is defined. + From: Mark Jefferys <mjeffery@cse.ogi.edu> + Date: Thu, 9 Apr 1998 12:38:27 -0700 (PDT) + +Fri Apr 3 01:18:22 1998 Philippe De Muyter <phdm@macqel.be> + + * info/info.c (main): Use 0, not NULL, as ? : alternative. + +Tue Mar 3 13:29:17 1998 Karl Berry <karl@cs.umb.edu> + + * configure.in: Version 3.12. + + * po/de.po: New version. + + * po/POTFILES.in: Do not include doc.c; that gets built at + runtime, thus causing texinfo.pot to try to get rebuilt. Besides, + it doesn't have any translatable strings. + +Sun Mar 1 10:38:47 1998 Karl Berry <karl@cs.umb.edu> + + * util/install-info.c: No need for i18n on version message. From + ke@suse.de. + +Fri Feb 27 16:06:23 1998 Karl Berry <karl@cs.umb.edu> + + * configure.in: Run texconfig conf instead of confall. + + * doc/Makefile.am (INSTALL_INFO): New variable. + (install-info-am): Use install-info from our distribution. + + * info/info.c (info_minor_version): Increment. + * (info_patch_level), + * info/info.h (info_patch_level): Remove. + + * info/info.c (program_name): Move decl. + + * util/install-info.c (ensure_dirfile_exists): Use commas and \t + instead of an explicit tab, which make dist expands. + + * doc/texinfo.txi: @prep.ai.mit.edu -> @gnu.org. + + * info/info.c: Make help messages consistent with others. + + * util/install-info.c (print_help): Format consistently. + + (readfile): Support gzipped files via libz. + From: Elliot Lee <sopwith@redhat.com> + Date: Mon, 1 Sep 1997 23:37:14 -0400 (EDT) + +Thu Feb 26 16:13:14 1998 Karl Berry <karl@cs.umb.edu> + + * info/echo-area.c: Whoops, _ might not start with parens. + + * configure.in: Check for libz. + Do not output emacs/Makefile. + + * Makefile.am (AUTOMAKE_OPTIONS): Set to 1.2f. + + * util/texi2dvi: Always remove temporary directories. (From Akim.) + Formatting changes. + +Wed Feb 25 15:26:26 1998 Karl Berry <karl@cs.umb.edu> + + * util/texi2dvi: New options --batch, --clean. + From: Akim Demaille <demaille@inf.enst.fr> + Date: 15 Aug 1997 18:05:33 +0200 + * doc/texinfo.txi (Format with texi2dvi): Mention --help. + + Applied this: +1997-08-09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * makeinfo/makeinfo.c (me_executing_string): New variable. + (me_execute_string): Use it instead of executing_string. + (popfile): Check for me_executing_string as well as + executing_string. + (get_until_in_line): Likewise. + (insert_and_underscore): Do not write any expansion output if + executing a string. + (cm_node, cm_include, index_add_arg, cm_footnote, execute_macro, + cm_macro, cm_unmacro): Likewise. + (cm_footnote): Include the footnote marker in the expansion + output. + (append_to_expansion_output): Do nothing if the input_text wasn't + a remembered text. + (defun_internal): Make the index entry even if expanding macros. + (expansion): Don't reset macro_expansion_output_stream around call + to execute_string. + (apply): Fix typo. + +Tue Feb 24 17:33:44 1998 Karl Berry <karl@cs.umb.edu> + + 1997-11-10 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + * makeinfo/makeinfo.c (get_until_in_line): Don't use xstrdup on + the unterminated input_text. + + * makeinfo/makeinfo.c: Don't assume all \'s in macro bodies are + arguments. + From: Mathias.Herberts@irisa.fr (Mathias Herberts) + Date: Tue, 6 Jan 1998 18:54:26 +0100 + + * configure.in: Check for sigblock in libc before libbsd. + * From: hjl@lucon.org (H.J. Lu) + * Date: Fri, 23 Jan 1998 21:50:25 -0800 (PST) + +Mon Feb 23 16:26:31 1998 Karl Berry <karl@cs.umb.edu> + + * info/window.c (character_width): If ISO_Latin_p is set, make + printable_limit 255, not 160. ISO Latin 1 uses + essentially all of the 256 characters. + Reported by: Marius Groeger <mag@sysgo.de> + Date: Wed, 17 Dec 1997 16:05:27 +0100 + + * info/info.c: Improve help message. + +Sun Feb 22 17:38:32 1998 Karl Berry <karl@cs.umb.edu> + + * Makefile.am (SUBDIRS): Remove emacs; we'll just distribute the + Elisp files with Emacs. + + * doc/Makefile.am (info_TEXINFOS, texinfo): Rename manual to + texinfo.txi to avoid DOS filename clash with texinfo.tex. + + * info/tilde.c: Copy slightly updated alloca stuff from makeinfo. + + * util/texindex.c (main): Declare as returning int to placate + warnings. + + * info/Makefile.am: Uncomment BUILT_SOURCES stuff and add missing _. + From: "Joel N. Weber II" <devnull@gnu.org> + Date: Fri, 30 Jan 1998 17:21:38 -1000 + + * util/texindex.c, + * util/install-info.c, + * makeinfo/makeinfo.c, + * info/info.c: Change help address to @gnu.org. + + 1998-01-22 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + * makeinfo/makeinfo.c (usage): Fix order of arguments to help + format string. + + * makeinfo/makeinfo.c (cm_top): Error message wording. + + * doc/texinfo.texi (Functions in Typed Languages): Remove + duplicate description of @deftypemethod. + From: KHMarbaise@p69.ks.fido.de (Karl Heinz Marbaise) + Date: Wed, 07 Jan 1998 11:11:50 +0100 + + * info/session.c (info_get_input_char) [EINTR]: Keep reading if we + get EINTR. + From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + Date: 22 Dec 1997 10:32:53 +0100 + +Sat Feb 21 17:41:26 1998 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (find_and_load): Malloc enough room for the + null as well as the newline. + From: "John W. Eaton" <jwe@bevo.che.wisc.edu> + Date: Tue, 30 Sep 1997 21:12:01 -0500 + + * util/texindex.c (--version), + * makeinfo/makeinfo.c (cm_today), + * makeinfo/makeinfo.c (print_version_info): Version strings etc. do not + need translation. + From: Karl Eichwalder <ke@suse.de> + Date: 13 Sep 1997 16:20:02 +0200 + + * info/echo-area.c: Rewrite pluralization to be translatable. + From: Karl Eichwalder <ke@suse.de> + Date: 13 Sep 1997 16:20:02 +0200 + + * util/texindex.c, + * info/info.c, + * makeinfo/makeinfo.c, + * util/install-info.c: --version: Give year as argument to printf, + to reduce the number of translations needed. + From: Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de> + Date: 02 Sep 1997 18:01:26 +0200 + + * util/texindex.c: Remove the fnctl.h and sys/file.h conditional #includes, they are + already in lib/system.h. + From: "Philippe De Muyter" <phdm@macqel.be> + Date: Thu, 21 Aug 1997 20:16:49 +0200 (MET DST) + + * info/terminal.c (terminal_begin_using_terminal, + terminal_end_using_terminal): #ifdef SIGWINCH settings for + m68k-motorola-sysv. + From: "Philippe De Muyter" <phdm@macqel.be> + Date: Thu, 21 Aug 1997 20:16:49 +0200 (MET DST) + + * info/filesys.c (info_suffixes): Add /index as a possibility for + subdirectories. + From: Matthew Wilcox <willy@odie.barnet.ac.uk> + Date: Wed, 6 Aug 1997 15:55:16 +0100 (BST) + + * configure.in: Redirect texconfig input from /dev/null to avoid + stoppage. + From: Thomas Esser <te@informatik.uni-hannover.de> + Date: Mon, 4 Aug 1997 18:15:49 +0200 + + * makeinfo/makeinfo.c (find_and_load): Null-terminate the input text. + From: Kenneth Stailey <kstailey@disclosure.com>. + + * info/Makefile.am (INCLUDES): Add -I.. -I$(srcdir). + +Fri Aug 22 16:24:59 1997 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.texi: Adjust ISBN, edition number for print run. + +Mon Aug 4 16:12:42 1997 Karl Berry <karl@cs.umb.edu> + + * info/info.c (main) [INFODIR]: Add this to infopath, if set. + * info/Makefile.am (DEFS): New define, include -DINFODIR. + From: Larry Schwimmer <rosebud@cyclone.Stanford.EDU>. + + * util/install-info.c (ensure_dirfile_exists): Use tabs instead of + spaces on the File: dir line. + Bug from: Dave Love <d.love@dl.ac.uk>. + +Sat Aug 2 12:43:57 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (cm_value, cm_email, cm_uref): Have to cast + from unsigned char * to char * or IRIX cc complains. + From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>. + +Fri Aug 1 14:05:10 1997 Karl Berry <karl@cs.umb.edu> + + * Makefile.am (EXTRA_DIST): Remove README-alpha. + From: "ir. Mark M._Kettenis" <kettenis@phys.uva.nl>. + +1997-07-31 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * configure.in: Use AC_CHECK_HEADERS, not AC_CHECK_HEADER. + +Thu Jul 31 11:57:46 1997 Karl Berry <karl@cs.umb.edu> + + * Version 3.11. + + * info/man.c (reap_children): Declare status as int, not unsigned, + since that's what POSIX says the arg to wait should be. + + * makeinfo/makeinfo.c (cm_uref, cm_email): Rewrite to do macro + expansion in the arguments. + + * makeinfo/makeinfo.c (main): setlocale LC_MESSAGES and LC_TIME, + instead of LC_ALL. + From: Akim Demaille <demaille@inf.enst.fr>. + + * makeinfo/makeinfo.c (cm_today): Let the %d %s %d be translated, + so other languages can change the order of day/month/year. + From: Akim Demaille <demaille@inf.enst.fr>. + + * info/infomap.c: Doc fix. + + * lib/system.h [!O_RDONLY]: Prefer <fcntl.h> to <sys/fcntl.h>. + + * configure.in (AC_CHECK_HEADERS): Check for fcntl.h. + + * doc/Makefile.am (install-data-local): Suggest tex/generic/dvips + for epsf.tex. + From: Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>. + + * configure.in (TEXMF): Move check to block with other program + checks. + +Wed Jul 30 11:20:37 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (defun_internal): Allow extra text after + most @def... commands, for tzname[2] in libc.texinfo. + + * info/info.c: Include indices.h. + * configure.in (AC_CHECK_HEADERS): Test for sys/wait.h, info/man.c + uses it. + From: Erick Branderhorst <Erick.Branderhorst@asml.nl>. + +Tue Jul 29 15:55:19 1997 Karl Berry <karl@cs.umb.edu> + + * configure.in: Version 3.9j. + + * info/terminal.c (output_character_function): Return int (the + arg), not void. + + * info/infomap.c: Don't define term_kP as 'v', since that's undefined. + From: Tom Hageman <tom@basil.icce.rug.nl>. + + * makeinfo/makeinfo.c: Parameterize some messages to avoid + duplicate translations. + + * info/terminal.c: Only try to declare ospeed, PC, tputs, etc. if + we don't have <ncurses.h/termcap.h> or <termcap.h>. + + * makeinfo/makeinfo.c (cm_email): New function, like cm_uref. + +Sun Jul 27 17:09:20 1997 Karl Berry <karl@cs.umb.edu> + + * configure.in: Only check for <ncurses/termcap.h> if we're using + -lncurses. + From: Bo Johansson <bo.johansson@mbox2.swipnet.se>. + + * info/dir.c (new_dir_file_p): Avoid automatic struct + initialization, SunOS 4 etc. cc can't handle it. + From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>. + +Sat Jul 26 15:08:13 1997 Karl Berry <karl@cs.umb.edu> + + * Version 3.9i. + + * configure.in: Check for termcap.h and ncurses/termcap.h. + From: bo.johansson@mbox2.swipnet.se. + +Fri Jul 25 14:09:05 1997 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.texi: Document new second optional arg to email. + + * info/infodoc.c: Document CTRL-x 0 as the way to get out of help. + + * info/dir.c (maybe_build_dir_node): Really check for the same dir + file twice, not just by name. + (new_dir_file_p): New function. + + * util/install-info.c: Tell them about --help in doc strings. + +Thu Jul 24 14:25:44 1997 Karl Berry <karl@cs.umb.edu> + + * util/texindex.c (memory_error): Move to avoid incorrect implicit + decl. + + * makeinfo/makeinfo.c, + * makeinfo/multi.c, + * util/install-info.c, + * util/texindex.c, + * info/tilde.c, + * info/man.c, + * info/gc.c, + * info/session.c (info_replace_key_to_typeahead): Remove unused + function, + * info/nodemenu.c, + * info/man.c, + * info/m-x.c, + * info/footnotes.c + * info/info.c + * info/indices.c, + * info/filesys.c: Parenthesize to avoid -Wall warnings + remove unused variables, + make return types explicit, + printf type corrections. + + * lib/system.h: <ctype.h>: Include this. + * util/texindex.c, + * makeinfo/makeinfo.c, + * info/echo-area.c, + * info/display.c: ctype.h: Included in system.h now. + + * info/echo-area.c: Parenthesize to avoid -Wall warnings. + (ctype.h): #include for isprint. + (echo_area_stack_depth): Remove unused function. + * info/display.c: Parenthesize to avoid -Wall warnings. + (ctype.h): #include for isprint. + * info/dir.c: Parenthesize to avoid -Wall warnings. + (build_dir_node_internal): Remove declaration of nonexistent function. + From: Erick Branderhorst <Erick.Branderhorst@asml.nl>. + + * configure.in (TEXMF): Call texconfig to discover the default value, + for the sake of the warning in doc/Makefile. + From: Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>. + + * doc/Makefile.am (TEXMF): New variable. + (install-data-local): Use it in warning. + From: Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>. + + * info/session.c (initialize_info_session): Only call + terminal_prep_terminal if clear_screen is true. Otherwise, failed + --index-searches prep the terminal but do not unprep it. + From: William Edward Webber <wew@yallara.cs.rmit.EDU.AU>. + + * info/nodemenu.c: Doc fix. + +Mon Jul 21 17:11:09 1997 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.texi: Comment out @smallbook and @set smallbook so + people at other sites can print it the way they want. + From: Thomas Walter <walter@pctc.chemie.uni-erlangen.de> + +Sun Jul 20 07:52:25 1997 Karl Berry <karl@cs.umb.edu> + + * configure.in: 3.9h. + + * doc/Makefile.am (install-info-am, distclean-aminfo): New targets + to avoid assuming info files are in srcdir. + + * lib/system.h (xstrdup): Returns char *, not void *. + + * doc/Makefile.am (.texi.info), + * doc/Makefile.am (texinfo): Don't run in $(srcdir). + + * util/install-info.c (main): Remove unnecessary decl of strrchr. + + * info/tilde.c: Include info.h (for config.h) before alloca stuff. + + * makeinfo/makeinfo.c (validate_file): Rename `valid' to `valid_p' + to avoid conflict with SunOS 4 header files. + From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>. + + * info/session.c (initialize_info_session): Call + terminal_prep_terminal here (before calling terminal_clear_screen). + (info_session): Instead of here. + From: William Edward Webber <wew@yallara.cs.rmit.EDU.AU>. + + * Makefile.am (EXTRA_DIST): Add README-alpha. + +Sat Jul 19 13:50:27 1997 Karl Berry <karl@cs.umb.edu> + + * info/terminal.c: Use `keypad transmit' sequence if it's defined: + (term_keypad_on, term_keypad_off): New statics. + (terminal_begin_using_terminal): If term_keypad_on, send it. + (terminal_end_using_terminal): If term_keypad_off, send it. + (terminal_initialize_terminal): Look up ks and ke termcap strings. + From: William Edward Webber <wew@yallara.cs.rmit.EDU.AU>. + + * info/infomap.c (initialize_info_keymaps): Initialize hardwired + cases for arrow keys a la readline. Found by John Eaton, + jwe@bevo.che.wisc.edu. + + * makeinfo/makeinfo.c (output_pending_notes): Remove footnote + macro expansion code I #if 0'd out some time ago. And doc fixes. + + * Applied this patch: + +Sat Jul 19 16:29:01 1997 Karl Eichwalder <ke@suse.de> + + * info/info.c (main): setlocale, bindtextdomain, and textdomain. + +Fri Jul 18 10:02:18 1997 Karl Berry <karl@cs.umb.edu> + + * doc/Makefile.am (install-data-local), + * emacs/Makefile.am (install-data-local): Give subdir in warning. + + * configure.in: Version 3.9f. + + * doc/texinfo.texi: Correct \^ to @^. + From Andreas S. + + * Merged these changes: + +1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * info/display.c (display_cursor_at_point): Flush ouput. + +1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * info/session.c (remember_window_and_node): Don't crash when the + current window has no current node. + +1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * util/texindex.c (usage): Translate the doc strings. + * makeinfo/makeinfo.c (cm_today): Translate the month names. + * info/variables.c (describe_variable): Translate the doc strings. + * info/nodes.h: Don't translate the strings defining the info format. + +1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * makeinfo/makeinfo.c (get_item_function): Remove superfluous call + to canon_white after get_rest_of_line. + (cm_end): Likewise. + (handle_variable): Likewise. + (cm_item): Likewise. + (cm_unmacro): Likewise. + +1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * info/nodemenu.c (list_visited_nodes): Don't clear the internal + flag, this and other functions depend on it. Don't insist on + displaying the menu below the current window. + +1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * makeinfo/makeinfo.c (cm_uref): Fix memory leaks. + (cm_inforef): Likewise. Handle empty cross reference name. + +1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * info/echo-area.c (ea_possible_completions): Check that the + current window can actually be split. + +Thu Jul 17 17:19:34 1997 Karl Berry <karl@cs.umb.edu> + + + * emacs/Makefile.am (*clean-lisp): Define, as Automake didn't. + From: Kenneth Stailey <kstailey@disclosure.com>. + + * doc/Makefile.am: Do not distribute info.1. + * makeinfo/macros: Do not distribute this directory, it's merged + into the main documentation. + * doc/makeinfo.texi: Don't distribute this either, it's in the + main manual. + + * util/install-info.c: Use \n\ for multiline string constant. + From: Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>. + +Wed Jul 16 15:29:50 1997 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.texi: @set must be after @setfilename, I guess. + Noted by Erick Branderhorst. + + * Applied this change: + +Tue Nov 12 22:20:22 1996 John Eaton <jwe@bevo.che.wisc.edu> + + * makeinfo.c (INDEX_ALIST): Use two indices, read_index and + write_index, instead of just one. + (find_index_offset): If a match is found, return index to the + current INDEX_ALIST struct, not the index pointing to the list of + index entries. + (translate_index): Return read_index from the matching + INDEX_ALIST. + (undefindex): Delete the list of index elements pointed to by + read_index from the INDEX_ALIST that matches name. + (defindex): Initialize read_index and write_index. + (index_add_arg): Add entries to the list pointed to by write_index + from the INDEX_ALIST matching name. + (index_append): Delete unused function. + (cm_synindex): Don't merge indcies, just make the write_index for + redirectee the same as the write_index for redirector. + +Tue Jul 15 09:32:04 1997 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.texi: Bump edition number for 2.24. + + * util/Makefile.am (localedir): Define. + + * info/window.h: Rename __window__ to window_struct. + + * info/window.h, + * info/variables.h, + * info/search.h, + * info/man.h, + * info/info-utils.h, + * info/gc.h, + * info/footnotes.h, + * info/filesys.h, + * info/echo-area.h, + * info/display.h: Avoid leading _ in #define for #include protection. + + * makeinfo/makeinfo.c: Version 1.68. + * info/info.c: Version 2.17. + + * Most all files: Untabify. + + * doc/Makefile.am (texinfo): Add explicit target. + + * emacs/Makefile.am (noinst_LISP): Remove the obsolete + detexinfo.el (makeinfo --no-headers is better) and + texnfo-tex.el (now handled by TeX modes in general). + +Mon Jul 14 15:21:03 1997 Karl Berry <karl@cs.umb.edu> + + * util/texi2dvi: Update RCS file from 3.9 distribution. + + * util/Makefile.am (EXTRA_DIST): Add update-info, from + rhawes@dmapub.dma.org + +Sun Jul 13 17:05:03 1997 Karl Berry <karl@cs.umb.edu> + + * info/signals.c: Use RETSIGTYPE instead of hardwiring void. + From: "Jeffery L. JT Vogt" <lfm@atw.earthreach.com>. + + * info/session.c (info_history_node): Rewrite as + info_kill_node (current_node). + (kill_node, read_nodename_to_kill): New functions from info_kill_node. + (info_kill_node): Now this just calls them. + +Fri Jul 11 11:56:58 1997 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.texi: Fix `Conditionals' xref. + +Thu Jul 10 17:58:12 1997 Karl Berry <karl@cs.umb.edu> + + * doc/info.texi: Don't say SPC clears ? screen. + +Sun Jul 6 16:26:41 1997 Karl Berry <karl@cs.umb.edu> + + * doc/info-stnd.texi: Document --index-search. + + * info/tilde.c, + * info/session.c: Remove redundant getenv decl. + + * Installed following change: +Tue Nov 12 14:44:00 1996 John W. Eaton <jwe@bevo.che.wisc.edu> + + * info/info.c (main): Handle new option, --index-search STRING. + (index_search_p, index_search_string): New static variables, used + to handle --index-search option. + + * info/session.c (initialize_info_session): New arg, + clear_screen. Change all callers. + + * info/indices.h (do_info_index_search, index_intry_exists): + Provide declarations here. + + * info/indices.c (do_info_index_search): New function, extracted + from info_index_search. + (info_index_search): Simply call do_info_index_search() with + search_string set to NULL. + (index_entry_exists): New function. + +Sat Jul 5 17:17:14 1997 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.texi: Document @kbdinputstyle. + + * makeinfo/makeinfo.c (kbdinputstyle): New command. + (cm_no_op_line_arg): New function. + + * info/termdep.h (HAVE_TERMIOS_H) [NeXT]: #undef. + From: Gregor Hoffleit <flight@mathi.uni-heidelberg.de> et al. + +Fri Jul 4 14:18:08 1997 Karl Berry <karl@cs.umb.edu> + + * info/Makefile.am (EXTRA_DIST), + * util/Makefile.am (EXTRA_DIST), + * makeinfo/Makefile.am (EXTRA_DIST), + * lib/Makefile.am (EXTRA_DIST): Include README. + + * doc/texinfo.texi (makeinfo options): Document --paragraph-indent + values more completely. + * makeinfo/makeinfo.c (set_paragraph_indent): Allow translated + asis or none, improve doc. + From ke. + + * doc/Makefile.am (dist-info): New empty target so that we do not + distribute info files. + From Erick Branderhorst. + + * doc/texinfo.texi (Invoking install-info): Document that the dir + file is created now if need be. + * Makefile.am (EXTRA_DIST): No longer need dir. + * util/install-info.c (ensure_dirfile_exists): New routine. + (main): Call it before trying to open dirfile for reading. + + * doc/texinfo.texi: Document install-info --delete a little better. + * util/install-info.c: Set something_deleted when we delete a + normal line. + Bug from: Denis Kosygin <dkosygin@math.Princeton.EDU>. + + * util/install-info.c: If no info dir entry, give warning and exit 0. + +Wed Jul 2 06:35:17 1997 Karl Berry <karl@cs.umb.edu> + + * configure.in (ALL_LINGUAS): Add fr. + + * makeinfo/makeinfo.h (insertion_type, insertion_type_names): Add + ifnot... entries. Alphabetize. + +Tue Jul 1 17:21:54 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (sort_index): Set defining_line and + input_filename so errors in index entries are reported at + the correct location. From rms. + + * makeinfo/makeinfo.c (cm_ifnothtml, etc.): Routines for new + commands. + +Sun Jun 29 09:44:01 1997 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.texi: Document new @ifnot... commands, etc. + * doc/texinfo.texi: Document @image, etc. + +Thu Jun 26 17:57:37 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (cm_image): New routine for new command @image. + (cm_end): Move to better place, doesn't need its own page. + Doc fixes. + +Mon Jun 23 16:54:03 1997 Karl Berry <karl@cs.umb.edu> + + * Makefile.am (SUBDIRS): Do intl first. + + * doc/Makefile.am (EXTRA_DIST): Include epsf.tex. + (install-data-local): Suggest possible installation directory. + * epsf.tex: New file. + +Wed Jun 18 17:51:52 1997 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.texi: Document texinfo.cnf. + +Sun Jun 15 14:37:58 1997 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.texi (Command List): Various commands missing or + erroneous. + From: Karl_Heinz_Marbaise@p69.ks.fido.de. + + * makeinfo/makeinfo.c: Oops, failed to break out of loop. + + * util/texindex.c: Use <getopt.h> not "getopt.h". + + * All source files: Merge gettext changes from Karl E.; + his ChangeLog entries below. + +Sat Jun 14 17:04:28 1997 Karl Berry <karl@cs.umb.edu> + + * Makefile.am, + * makeinfo/Makefile.am: Doc fix. + * util/Makefile.am (EXTRA_DIST): Add texi2dvi. From Karl E. + +Fri Jun 13 17:39:34 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c [WIN32]: Handle read bogosity and c:\ + absolute paths. + From: Eric Hanchrow <erich@MICROSOFT.com>. + + * configure.in (AC_CHECK_HEADERS): Check for pwd.h. + * info/tilde.c (pwd.h): Move #include to system.h. + + * makeinfo/makeinfo.c (main): New option -P to prepend to search path. + From: Kenneth Stailey <kstailey@cvs.openbsd.org>. + + * doc/texinfo.texi (Invoking makeinfo), + * doc/makeinfo.texi: Mention -P. + +Thu Jun 12 16:25:40 1997 Karl Berry <karl@cs.umb.edu> + + * info/signals.h (SIGCHLD): #define as SIGCLD if undefined, for sysV68. + From: "Philippe De Muyter" <phdm%labauto1@ulb.ac.be>. + + * util/install-info.c (O_RDONLY): Remove this stuff, it's in system.h. + (main): Handle existing entry in dir file having .info extension. + From: "Bradley C. Kuszmaul" <bradley@GRANITE.SYSTEMSX.CS.YALE.EDU>. + + * makeinfo/makeinfo.c (get_char_len): Don't count 8-bit characters + as two chars in the output. + From: Sung-Hyun Nam <namsh@amuna.rms.lgic.co.kr>. + +Wed Jun 11 16:36:51 1997 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.texi (Other Info Directories): Document new trailing + : in INFOPATH feature. + + * info/info.c (main): Have trailing : in INFOPATH expand to the + default path. + +Fri Jun 6 13:22:02 1997 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.texi (uref): New node for new command. + +Thu Jun 5 18:13:48 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (cm_uref): New function to accept optional + second argument. Call it in command table. + +Sat Jun 14 10:54:16 1997 Karl Eichwalder <ke@suse.de> + + * mkinstalldirs: Update from automake-1.1p. + + * configure.in: Touch po/ChangeLog (gettext needs it). + +Thu Jun 12 08:37:52 1997 Karl Eichwalder <ke@ke.Central.DE> + + * util/texindex.c: Include system.h, remove config.h. + + * po/POTFILES.in: Fill it. + + * makeinfo/multi.c: Include system.h. + + * info/Makefile.am: + * makeinfo/Makefile.am: + * util/Makefile.am: + (localedir): Set. + (INCLUDES): Add intl/ and LOCALEDIR. + (LDADD): Add @INTLLIBS@. + + * makeinfo/makeinfo.c (main): + * util/texindex.c (main): + * util/install-info.c (main): + setlocale, bindtextdomain, and textdomain. + + * lib/system.h: Include locale.h and libintl.h. + + * acconfig.h: Include libintl.h. + (_, N_): Define. + Add ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_LC_MESSAGES, + HAVE_STPCPY for libintl. + Add @TOP@ and @BOTTOM@. + + * configure.in (AM_GNU_GETTEXT): Add. + (AC_OUTPUT): Process Makefiles in intl/ and po/. + (ALL_LINGUAS): Available languages. + + * Makefile.am (AUTOMAKE_OPTIONS): Now use 1.1p. + +Wed Jun 11 17:05:37 1997 Karl Eichwalder <ke@ke.Central.DE> + + * Makefile.am (SUBDIRS): Add intl/ and po/ for NLS. + + * run `gettextize -c' to get the i18n skeleton. + +Wed Jun 4 17:51:08 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (uref): New command, another alias for @code + for now. + +Wed Jun 4 02:02:33 1997 Miles Bader <miles@gnu.ai.mit.edu> + + * doc/texinfo.texi (email): { and } need @ escapes. + +Sun Jun 1 16:34:12 1997 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.texi (itemx): @itemx should always follow @item. + + * makeinfo/makeinfo.c (cm_item): Insert blank line if two + consecutive @item's. + From: Karl Eichwalder <ke@ke.central.de>. + Also various doc fixes. + +Tue May 27 17:20:44 1997 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.texi (various): Document @deftypemethod. + (email): @ should have been @@ in the example. + From: Mate Wierdl <mw@wierdlmpc.msci.memphis.edu> + +Mon May 26 16:56:26 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/multi.c (setup_multitable_parameters): Avoid use of %n + for sake of m68k-hp-bsd. + From: Derek L Davies <ddavies@world.std.com>. + + * info/terminal.c (terminal_begin_using_terminal, + terminal_end_using_terminal): Call fflush and sleep to handle + cmdtool/shelltool with scrollbars. Also ignore + SIGWINCH so we do not prematurely exit. Move call. + (terminal_prep_terminal): Disable LNEXT (CTRL-V). + From: strube@physik3.gwdg.de (Hans Werner Strube). + + * configure.in (AC_TYPE_SIGNAL): Check this. + +Sun May 25 16:49:58 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (discard_insertions): Take arg saying + whether ifinfo/ifset/etc. are ok. + (convert_from_loaded_file): At `finished', call discard_insertions. + (handle_variable_internal): Complain if we reach eof before the + @end for a false condition. + From: HERBERT@boevm4.vnet.ibm.com. + + * info/Makefile.am (ginfo_SOURCES): Add doc.h. + * lib/Makefile.am (libtxi_a_SOURCES): Add system.h. + +Sat May 24 18:08:27 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c: Check that we have macro_expansion_filename + before using strcmp. + +Thu May 22 17:59:46 1997 Karl Berry <karl@cs.umb.edu> + + * doc/makeinfo.texi: Minimally document --force. + + * makeinfo/makeinfo.c (--force): New option. + (-E): Allow stdout via `-'. + (convert_from_loaded_file): Unlink output files if errors and !force. + +Tue May 20 17:48:42 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c: Change all strdup calls to xstrdup. + (xmalloc, xrealloc, memory_error): Remove these functions, they're + in lib. + (set_paragraph_indent, cm_paragraph_indent): Move to misc page. + (cm_footnote): Expand macros in the arg for the macro expansion output. + +Fri May 16 17:26:59 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (cm_macro): Allocate an empty body if the + macro was empty. + (cm_unmacro): Allocate one more byte for the null. + From: Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>. + +Sun May 11 17:51:21 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + + * makeinfo/makeinfo.c (cm_printindex): Fix calculation of the + length of an index line. + +Sun May 11 14:47:42 1997 Tom Tromey <tromey@cygnus.com> + + * makeinfo/makeinfo.c (main): Don't unconditionally run usage when + -e specified. + +Sun May 11 17:47:42 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (init_indices): Free the source for an @synindex. + (undefindex): Do not go further if the target was already freed. + (free_index): Do not free the node names, as init_tags already did. + (cm_synindex, index_add_arg): Improve error message. + (program_index, function_index, etc.): Remove these unused #defines. + +Tue May 6 17:53:37 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (init_internals): Do not free current_node, + it already is, at least when multiple input files are specified. + From: Karl Eichwalder <ke@ke.central.de>. + +Mon May 5 16:14:39 1997 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.texi: Mention both alignment and non-alignment of + continuation description lines in menus (Arnold). + +Sun Apr 27 16:12:44 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (apply): Handle body being `\string'. + Also, avoid dereferencing a null pointer when a macro has no named + parameters. + From: Eli Zaretskii <eliz@is.elta.co.il>. + + * makeinfo/makeinfo.c: Wording changes/fixes in warnings. + + * info/session.c (info_get_input_char): Do not mix stdio with raw I/O. + From: Egil Kvaleberg <egilk@sn.no>. + + From Tom Hageman <tom@basil.icce.rug.nl>. These changes make + arrow keys work: + * info/infomap.c: Add arrow key bindings. + (keymap_bind_keyseq): New support function. + (initialize_info_keymaps): Use it. + (term_ku,term_kd,term_kl,term_kr): Remove explicit declarations; + use #include "terminal.h" instead. + * info/session.c (initialize_info_session): Unbuffer stdin. + (info_get_another_input_char): Fix bug in `ready' logic. + * info/terminal.h, + * info/terminal.c (term_kP, term_kN): New variables to hold + PageUp, PageDown key sequences. + (terminal_initialize_terminal): Set them. + + * util/texindex.c (main), + * util/install-info.c (main), + * makeinfo/makeinfo.c (print_version_info), + * info/info.c (main): Use PACKAGE and VERSION from Automake for + printing version number. + +Sat Apr 26 19:19:46 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (get_until_in_line): Do not expand if + executing_string. + Also, free temporary strings. + Also, untabify entire file. + + * doc/texinfo.texi: Many corrections from Arnold. + +Thu Apr 24 16:31:09 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/multi.c (draw_horizontal_separator): Account for indent + here also. From Ulrich. + +Wed Apr 23 15:15:34 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (cm_today): Use time_t instead of long; + everyone else does. + (LOCALTIME_CAST): Remove kludge, we'll always use time_t now. + + * info/Makefile.am (ginfo_SOURCES): Remove general.h, that got + merged into system.h. + +Mon Apr 21 17:13:25 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/multi.c (output_multitable_row): Account for + column_indent, both the global one and for each column. + (setup_multitable_parameters): Account for column_indent in the table + width in the columnfrac case, but don't bother with the template + case for now. + +Sun Apr 20 16:32:00 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (output_stream): Remove redundant + definition; it's in makeinfo.h, + and a vaxstation-ultrix4.3 fails to link because of the two defns. + From: Anders Olofsson <anders@kid025.ericsson.se>. + + * makeinfo/makeinfo.c (expansion): Inhibit appending to the macro + expansion stream. + (get_until_in_line): Possibly expand the text. + Change caller in get_node_token to do the expansion, + all other calls to remain the same. + + * makeinfo/makeinfo.c (cm_node): No need to call strlen to check + for the empty string. + + * doc/texinfo.texi: Restore missing @c for initial comment. + +Fri Apr 18 17:41:36 1997 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.texi: Mention that .info is unnecessary in the info + file name argument of an xref. + + * doc/texinfo.texi: Mention texi2dvi -t instead of embedding + @smallbook or @afourpaper in the document source. + +Sun Apr 13 15:19:08 1997 Karl Berry <karl@cs.umb.edu> + + * lib/system.h (_GNU_SOURCE): #define. + +Mon Apr 7 16:30:11 1997 Karl Berry <karl@cs.umb.edu> + + * doc/info.texi, + * doc/info-stnd.texi, + * doc/texinfo.texi: Do not make (dir) the previous ptr from the top node, + and tell people not to do that in the manual. + From: rmedina@kanojo.ivic.ve (Rodrigo Medina), + confirmed by rms. + +Fri Apr 4 16:30:33 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c: Move error page to top to avoid + prototypes, and do add prototypes for add_word_args and execute_string, + so we can use <stdarg.h>. + + * info/makedoc.c, + * info/nodemenu.c: Use %ld instead of %d for file offsets. + * makeinfo/makeinfo.c (delete_macro): Decrement macro_list_len. + (get_macro_args): Decrement line number if see \n. + * utils/texindex.c (indexify): Use fputs instead of fprintf + for constant string. + From: Eli Zaretskii <eliz@is.elta.co.il>. + +Thu Apr 3 17:40:52 1997 Karl Berry <karl@cs.umb.edu> + + * configure.in (AC_CHECK_HEADERS): No need to check for vararg.h + here, AC_FUNC_VPRINTF does it. + (AC_CHECK_FUNCS): Likewise for vsprintf and vfprintf. + * makeinfo/makeinfo.c (add_word_args, execute_string): Rewrite + like the error functions. + +Wed Apr 2 17:46:28 1997 Karl Berry <karl@cs.umb.edu> + + * configure.in: Add AC_FUNC_VPRINTF. + * makeinfo/makeinfo.c (error, line_error, warning): Rewrite a la + error.c from the *utils to use <stdarg.h> if available. + +Tue Apr 1 11:48:40 1997 Karl Berry <karl@cs.umb.edu> + + * doc/texinfo.texi: Tabs are a bad idea. + + * doc/userdoc.texi, + * doc/info.texi: Untabify. + +Sun Mar 30 17:36:47 1997 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (end_of_sentence_p): New function. + (add_char): Call it, instead of simply sentence_ender. + (post_sentence): New macro. + Also, remove some #include's now in system.h. + * lib/system.h [VMS]: #include <perror.h>, from makeinfo. + +Thu Mar 27 17:41:03 1997 Karl Berry <karl@cs.umb.edu> + + * info/search.c (skip_node_characters): Do not arbitrarily + strip trailing period from end of node name; this is valid. + +Mon Mar 24 16:44:42 1997 Karl Berry <karl@cs.umb.edu> + + * configure.in (AC_OUTPUT): Don't need to create stamp-h here, + tromey says AM_CONFIG_HEADER will do it. + + * info/Makefile.am, util/Makefile.am, makeinfo/Makefile.am (INCLUDES): + Don't need -I.. (for config.h) or -I$(srcdir), says tromey. + Automake includes those already. + +Fri Mar 14 15:05:17 1997 Karl Berry <karl@cs.umb.edu> + + * info/Makefile.am: Build as ginfo, install as info, + to avoid conflict with the standard info target. + + * lib/system.h: New file. + * makeinfo/makeinfo.c (strerror): Remove declaration, + include system.h, remove other redundant #if stuff. + * info/general.h: Include system.h instead of doing common stuff. + * util/install-info.c (my_strerror): Remove this, use strerror, + include system.h. + + * info/terminal.c (terminal_prep_terminal): Only use OCRNL and + ONLCR if they are defined. Reported by many people. + + * Installed: + + Sun Dec 1 19:23:54 1996 Karl Eichwalder <ke@ke.Central.DE> + + * configure.in (TERMLIBS): Add ncurses. + +Thu Mar 13 13:59:45 1997 Karl Berry <karl@cs.umb.edu> + + * lib/Makefile.am (libtxi_a_SOURCES): Add xstrdup.c. + * info/*.c: Use xstrdup instead of strdup everywhere. + + * info/tilde.c: Do not include clib.h, move stdlib.h include to + * info/general.h: here. + + * configure.in (AC_CONFIG_HEADER): Use this, + to avoid hugely long compile line with all the -D's. + * info/general.h: Include <config.h>. + + * emacs/Makefile.am (install, install-data): Do @echo + to tell the user to compile/install the elisp manually. + + * configure.in (AC_REPLACE_FUNCS): Move strerror check to here. + (AC_CHECK_FUNCS): From here. + + * lib/strerror.c: New file, from enscript (et al.) distribution. + +Tue Mar 11 16:36:25 1997 Karl Berry <karl@cs.umb.edu> + + * info/Makefile.am (info_SOURCES): Add doc.c, dribble.c, infodoc.c. + (LDADD): Add @TERMLIBS@. + + * info/info.h: HANDLE_MAN_PAGES, NAMED_FUNCTIONS: Define these. + + * info/filesys.h: Spurious ! when DEFAULT_INFOPATH is not defined. + + * configure.in (AC_OUTPUT): Do lib first and doc last. + + * info/echo-area.c, + * info/echo-area.h, + * info/info.h: Rename echo_area to echo-area. + +Mon Mar 10 17:59:05 1997 Karl Berry <karl@cs.umb.edu> + + * */Makefile.am: Write Makefile.am files for Automake. + * doc: New subdirectory, move all manuals and texinfo.tex there. + * AUTHORS, THANKS, config.guess, config.sub, mkinstalldirs: New files, + required by Automake. + * lib/xmalloc.c: Move from info/. + +Fri Oct 4 07:49:49 1996 Karl Berry <karl@cs.umb.edu> + + * 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 <schwab@issan.informatik.uni-dortmund.de>. + +Thu Oct 3 12:58:32 1996 Karl Berry <karl@cs.umb.edu> + + * 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 <gaylen@proaxis.com>, 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 <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * 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 <sys/fcntl.h> or <fnctl.h>, + according to HAVE_SYS_FCNTL_H, + and only include <sys/file.h> 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 <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * 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 <miles@gnu.ai.mit.edu> + + * 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 <termios.h>. + * configure.in: Add check for <termios.h>. + +Thu Sep 26 10:46:34 1996 Karl Berry <karl@cs.umb.edu> + + * 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 + <daves@gsms01.alcatel.com.au>. + +Tue Sep 24 14:43:03 1996 Karl Berry <karl@cs.umb.edu> + + * dir: Blank dir file for installation on new systems. + +Mon Sep 23 12:18:43 1996 Karl Berry <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (cm_xref): Do not seg fault if outside of + any node. From: Tom Tromey <tromey@creche.cygnus.com>. + (cm_ctrl): Make obsolete. + +Tue Sep 17 13:30:08 1996 Karl Berry <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * texinfo.texi: Document multitables, new ISBN number. + +Wed Sep 11 18:01:24 1996 Karl Berry <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (commandTable): Obsolete @setchapterstyle. + +Thu Sep 5 15:45:11 1996 Karl Berry <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (commandTable): Deprecate @ichapter and + @titlespec. + Move all the deprecated @i<section> 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 <karl@cs.umb.edu> + + * texinfo.texi: Document @<whitespace>, 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-<sentence-ender>. + +Fri Aug 30 18:55:30 1996 Karl Berry <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (commandTable): Remove @input, @medbreak, + @smallbreak, @overfullrule, @br. + +Sun Aug 25 17:25:48 1996 Karl Berry <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * texinfo.texi: Propagate change from rms. + +Tue Aug 13 11:33:27 1996 Karl Berry <karl@cs.umb.edu> + + * texinfo.texi: Propagate change from rms. + + * texinfo.texi: Document other @headings options. + +Sun Aug 11 13:19:42 1996 Karl Berry <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * 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 <karl@laurie> + + * util/texi2dvi: Format usage message to conform to the other *utils. + +Thu Jul 25 17:05:47 1996 Karl Berry <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * 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 <karl@cs.umb.edu> + + * 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 <bfox@nirvana.samsara.com> + + * 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 <bfox@nirvana.samsara.com> + + * 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 <bfox@nirvana.samsara.com> + + * 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 <karl@cs.umb.edu> + + * texinfo.texi (ftable vtable): Mention example. + +Sun Jun 30 14:59:51 1996 Karl Berry <karl@goldman.gnu.ai.mit.edu> + + * 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 <rms@mole.gnu.ai.mit.edu> + + * 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 <rms@mole.gnu.ai.mit.edu> + + * 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 <rms@mole.gnu.ai.mit.edu> + + * 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 <rms@mole.gnu.ai.mit.edu> + + * 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 <karl@spiff.gnu.ai.mit.edu> + + * makeinfo/makeinfo.c (cm_url): New function for new @url command. + +Fri Feb 23 21:14:40 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu> + + * info/Makefile.in (install, uninstall): Use manprefix. + +Fri Feb 23 19:50:18 1996 Richard Stallman <rms@whiz-bang.gnu.ai.mit.edu> + + * 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 <bfox@nirvana.datawave.net> + + * 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 <bfox@wizard.datawave.net> + + * 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 <bfox@albert.gnu.ai.mit.edu> + + * 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 <bfox@wizard.datawave.net> + + * info/man.c: (clean_manpage) Remove ^L's from page. + + * makeinfo/makeinfo.c (get_brace_args): Change some memcpy's to + memmoves. + + * info/info.c (main): Prefer caseless matches over partial + matches. + + * Makefile.in (All Subdir Targets): Change suggested by Debian + people which allows errors in recursive makes to kill the + top-level make. + + * makeinfo/Makefile.in (makeinfo.dvi): New target. + + * info/info.c (main): Print version of containing texinfo package. + + * makeinfo/makeinfo.c (flush_output): Don't strip high-bit from + sentence_enders. + Print the version number of the containing texinfo package. + + * info/man.c (locate_manpage_xref): Count the 0th entry. + + * makeinfo/makeinfo.c (cm_menu): If a menu is seen before a node + has been defined, warn, and create the node `Top'. + +Wed Jun 21 03:19:39 1995 Brian Fox <bfox@albert.gnu.ai.mit.edu> + + * makeinfo/makeinfo.c (cm_infoinclude): Clean up after printing + error if the file couldn't be included. + (discard_braces): Print errors only for those unmatched open + braces that belong to a texinfo command. + + * */Makefile.in: Use @CFLAGS@ and @LDFLAGS@. + + * makeinfo/makeinfo.c: End `node_search_string' and friends with a + terminating null character. + +Wed Jun 21 01:23:49 1995 Jim Meyering (meyering@comco.com) + + * makeinfo/makeinfo.c: Close comment after #endif. + +Tue Jun 20 04:58:26 1995 Brian Fox <bfox@albert.gnu.ai.mit.edu> + + * emacs/Makefile.in (install): Fix typo: "fle" -> "file". + + * Makefile.in (VERSION): Bump to 3.6 + + * info/clib.c: Include general.h for `info_toupper' and friends. + + * info/clib.h: strncmp and strncascmp return an int. What kind of + drugs was I on? + +Mon Jun 19 23:34:47 1995 Brian Fox <bfox@albert.gnu.ai.mit.edu> + + * makeinfo/makeinfo.c (make_index_entries_unique): Copy the last + index entry. + +Mon Jun 19 21:55:49 1995 Noah Friedman <friedman@prep.ai.mit.edu> + + * util/texi2dvi (--version): New option. + Cosmetic changes. + +Mon Jun 19 16:06:40 1995 Brian Fox <bfox@albert.gnu.ai.mit.edu> + + * makeinfo/makeinfo.c (cm_macro): Fix typo. `x != y' is not the + same as `x |= y'. + + * info/Makefile.in (exec_prefix): Use @exec_prefix@ not $(prefix). + * makeinfo/Makefile.in (exec_prefix): Use @exec_prefix@ not $(prefix). + * util/Makefile.in (exec_prefix): Use @exec_prefix@ not $(prefix). + * libtxi/Makefile.in (exec_prefix): Use @exec_prefix@ not $(prefix). + + * emacs/Makefile.in (uninstall): New target. + (install): Use the definition of $(lispdir), don't dynamically + find it. Use INSTALL_DATA not cp. + (exec_prefix): use @exec_prefix@ not $(prefix). + + * makeinfo/makeinfo.c (apply): If there isn't an actual argument + for a named argument, default it to "". + + * Makefile.in (VERSION): Now at 3.5. + (texinfo): Make ./makeinfo/makeinfo depend on sub-all for parallel + makes. + + * emacs/Makefile.in (ELISP_OBJS): Explictly declare .el and .elc + in the SUFFIXES list. + + * makeinfo/makeinfo.c (cm_today): Special case for losing alpha. + * (minor_version): Increase to 63. + + * info/info.c (version_string): Now at 2.14. + * info/tilde.c: Declare getenv to return (char *). + * info/window.c (build_message_buffer): Jump through hoops to keep + DEC Alpha's happy. + + * info/xmalloc.c: Declare malloc and realloc as (void *) returning + functions. + +Sun Jun 18 12:47:21 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu> + + * emacs/detexinfo.el (detexinfo-line-cmds-without-arg): + Handle ifhtml. + +Fri Jun 16 13:48:14 1995 Brian Fox <bfox@albert.gnu.ai.mit.edu> + + * util/texindex.c: Update TEXINDEX_VERSION_STRING for texinfo 3.4 + + * (All *.c *.h *.in): Change FSF old address to new. + * texinfo.texi (Obtaining TeX): Change FSF old address to new + address. Change Old phone numbers to new phone numbers. + + * Makefile.in (VERSION): Change to 3.4. + +Thu Jun 15 22:49:07 1995 Robert J. Chassell <bob@hill.gnu.ai.mit.edu> + + * texinfo.texi, emacs/=development/cover.texi: update + Texinfo distribution package version number + +Thu Jun 15 09:23:02 1995 Brian J. Fox <bfox@wizard.datawave.net> + + * info/info.c: (minor_version): Set to 13. + + * info/clib.c,h: New files gather together replacement functions + for those POSIX-style C library functions that are not present on + the target system. + + * info/Makefile.in (SRCS): Add clib.c and clib.h. makedoc now + needs clib.o to build on systems missing various string.h stuff. + + * info/variables.c (whole file): Call strdup, not savestring. + * info/tilde.c (whole file): Call strdup, not savestring. + * info/search.c (whole file): Call strdup, not savestring. + * info/nodes.c (whole file): Call strdup, not savestring. + * info/nodemenu.c (whole file): Call strdup, not savestring. + * info/man.c (whole file): Call strdup, not savestring. + * info/makedoc.c (whole file): Call strdup, not savestring. + * info/m-x.c (whole file): Call strdup, not savestring. + * info/info.c (whole file): Call strdup, not savestring. + * info/indices.c (whole file): Call strdup, not savestring. + * info/echo_area.c (whole file): Call strdup, not savestring. + * info/session.c (whole file): Call strdup, not savestring. + * info/filesys.c (whole file): Call strdup, not savestring. + + * makeinfo/makeinfo.c (minor_version): Change to 1.62. + * makeinfo/makeinfo.c (get_execution_string): Initialize `i' to 0 + in case there are no execution_strings. + +Wed Jun 14 17:48:06 1995 Brian J. Fox <bfox@wizard.datawave.net> + + * texinfo.texi: include "texinfo.tex", not "texinfo". + * info/session.c (forget_window_and_nodes): Place a sequence point + in between "info_windows[i] = info_windows[++i];" as per various + compiler experts. + + * makeinfo/makeinfo.c (strdup): Create this function if the system + doesn't have it. + (discard_insertions): Use the insertion's filename, not the + current input file. + (push_insertion): Remember the current input file with each + insertion. + (pop_insertion): Free storage used by remembered input file. + + * makeinfo/makeinfo.c (whole file): Use `strdup' instead of + `savestring'. + * configure.in: Check for `strdup'. + +Wed Jun 14 15:58:51 1995 Brian Fox <bfox@albert.gnu.ai.mit.edu> + + * libtxi/Makefile.in (prefix): Use @prefix@, not /usr/local/ + +Wed Jun 14 10:50:57 1995 Brian J. Fox <bfox@wizard.datawave.net> + + * Makefile.in (DISTFILES): Don't include *.elc files in the list + of files to distribute. + (installdirs): Include `emacs' in the list of sub-dirs with + Makefile.in's. + + * emacs/elisp-comp: Shell script which batch compiles the *.el files. + * emacs/Makefile.in: New file contains targets to build the elc files. + * configure.in: Add `emacs/Makefile' to the list of created makefiles. + * makeinfo/makeinfo.c (whole file): Give every function a return + type. All cm_xxx functions are now void. Add declarations for + functions to top of file. + +Mon Jun 12 12:00:57 1995 Brian J. Fox <bfox@wizard.datawave.net> + + * info/man.c (reference_section_starters): Add versions of "SEE + ALSO" and "RELATED INFORMATION" with tabs instead of spaces as + well. + + * util/texindex.c: Back out changes for OFF_T. Explicity coerce + the result of lseek to a long, and use longs everywhere. + + * texinfo.texi: Change "@end shorttitlepage" to "@end titlepage". + * makeinfo/makeinfo.c: Make @shorttitlepage ignore the rest of the + line. + + * util/texindex.c (strrchr): Create if not present. + Test for HAVE_STRCHR and HAVE_STRING_H. + (main): Make PROGRAM_NAME be just the last path componenet of argv[0]. + (decode_command): Rewrite. + (usage): Rewrite. Now texindex handles --version. + + * makeinfo/makeinfo.c (make_index_entries_unique): Rewrite from + scratch. + + * Don't distribute created info files with texinfo. After all, + the user will have the tools necessary to create them, yes? + + * Makefile.in (distclean): Remove *.log + + * info/man.c (read_from_fd): Change timeout value for select to 15 + seconds. Some systems (e.g., albert.ai.mit.edu) actually need + more than 10 seconds to format a man page. + + * info/tilde.c: Fix typo in declaration for + `tilde_expansion_failure_hook'. + +Wed Jun 7 13:36:53 1995 Brian Fox <bfox@albert.gnu.ai.mit.edu> + + * info/tilde.h: Change type of tilde_expansion_failure_hook to + a pointer to a function returning a (char *). + * info/tilde.c: Change type of tilde_expansion_failure_hook to a + pointer to function returning a (char *). + + * makeinfo/makeinfo.c (get_execution_string): Don't use `i' in the + latter assignment, use `execution_strings_index' instead. + + * info/man.c (read_from_fd): Change logic to avoid using FIONREAD. + + * info/xmalloc.c (xrealloc): Use (void *), not (caddr_t *). + * info/xmalloc.c (xmalloc): Use (void *), not (caddr_t *). + + * Makefile.in (DISTFILES): Don't find RCS no "=" directories. + + * util/Makefile.in (prefix): Use @prefix@ as the value. + * info/Makefile.in (prefix): Use @prefix@ as the value. + * makeinfo/Makefile.in (prefix): Use @prefix@ as the value. + +Wed Jun 7 12:29:28 1995 Robert J. Chassell <bob@hill.gnu.ai.mit.edu> + + * texinfo.texi: Correct minor typos. + + * emacs/texinfmt.el: Don't require @shorttitlepage to be inside + of @iftex ... @end iftex + +Mon May 8 18:33:52 1995 Brian J. Fox <bfox@wizard.datawave.net> + + * info/nodes.c: #include "man.h" if HANDLE_MAN_PAGES. + (info_get_node_of_file_buffer): If the file buffer is one + associated with manpages, call the manpage node finding + function instead. + (info_find_file_internal): If the file buffer is one associated + with manpages, avoid doing any file I/O. + (info_reload_file_buffer_contents): Ditto. + (info_find_file_internal): Call create_manpage_file_buffer instead + of info_load_file_internal. + + * info/info.c: #include "man.h" if HANDLE_MAN_PAGES. + (main): If the initial node cannot be found, perhaps find it as a + manpage. + * info/info-utils.c: #include "man.h" if HANDLE_MAN_PAGES. + (info_xrefs_of_node): If handling man pages, and this is a manpage + node, use xrefs_of_manpage. + + * info/session.c (info_set_input_from_file): Only fclose (stream) + if it is non-null and not stdin. + #include "man.h" if HANDLE_MAN_PAGES. + (info_menu_or_ref_item): If handling man pages, and this is a + manpage node, get the xrefs from manpage_xrefs_in_binding. + (info_man): Compile in for M-x man if handling man pages. + (info_move_to_xref): If handling man pages, and the current node + is a manpage node, use locate_manpage_xref to get xrefs. + +Thu May 4 08:55:23 1995 Brian J. Fox <bfox@wizard.datawave.net> + + * info/info.c (main): If the output device is not a terminal, and + no output filename has been specified, make user_output_filename + be "-", so that the info is written to stdout, and turn on the + dumping of subnodes. + +Thu Apr 13 18:05:06 1995 Daniel Hagerty <hag@churchy.gnu.ai.mit.edu> + + * texinfo.texi: Fixed @end titlepage/@end shorttitlepage + +Sat Apr 8 12:51:49 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + + * makeinfo/makeinfo.c [! HAVE_STRERROR] (strerror): New function, + snarfed from ../info/filesys.c. + (cm_infoinclude): Use strerror instead of sys_errlist. + +Tue Apr 4 18:44:00 1995 Brian J. Fox <bfox@wizard.datawave.net> + + * util/texindex.c (sort_offline): Change TOTAL to be an off_t. + * util/texindex.c (sort_in_core): Change TOTAL to be an off_t. + * util/texindex.c (MAX_IN_CORE_SORT): Cast to off_t. + +Sun Apr 2 16:20:13 1995 Brian J. Fox <bfox@wizard.datawave.net> + + * info/Makefile.in: Define DEFAULT_INFOPATH in case we are + compiling in the current directory. + * info/Makefile.in (info.o): Add filesys.h because of DEFAULT_INFOPATH. + * info/(search.c,h, nodes.c info-utils.c) Use strcasecmp and + strncasecmp instead of stricmp and strnicmp. Define strcasecmp + and strncasecmp in search.c if !HAVE_STRCASECMP. + * info/search.c: If HAVE_STRING_H include it. + * info/nodes.c: If HAVE_STRING_H include it. + * info/info-utils.c: If HAVE_STRING_H include it. + * info/info.h: If HAVE_STRING_H include it. + * configure.in (AC_HAVE_FUNCS): Check for strcasecmp. + * makeinfo/makeinfo.c (strcasecmp): Define if !HAVE_STRCASECMP. + * makeinfo/makeinfo.c (entire file): Use `strcasecmp' instead of + `stricmp'. + * makeinfo/makeinfo.c (cm_ifeq): New command takes three args. + Compares first two, executes remainder if the first two are + string-wise eq. + * makeinfo/makeinfo.c (ifhtml): Add to command list. Shouldn't be + used, but it is by people who don't want to hack macros. + +Sat Apr 1 09:20:14 1995 Brian J. Fox <bfox@wizard.datawave.net> + + * makeinfo/makeinfo.c (begin_insertion): Fix reversed arguments to + line_error. + + * info/info-stnd.texi: Use "end" footnote style instead of "separate". + + * info/Makefile.in: Change "rm -f" to $(RM). + + * info/general.h: Define zero_mem in terms of memset if we have + it, else in terms of bzero if we have that, else as inline code. + + * info/NEWS: Updated to reflect changes in 2.11. + +Fri Mar 31 22:38:31 1995 Brian J. Fox <bfox@wizard.datawave.net> + + * Makefile (DISTFILES): Don't include *.a, *orig, nor *.e + files. + (DISTFILES): + +Sat Mar 4 12:16:29 1995 Brian J. Fox <bfox@wizard.datawave.net> + + * Makefile.in: Use @prefix@ instead of hardwired `/usr/local'. + Clean up makefile rules which make in subdirs. + (ALL_SUBDIRS): Add makeinfo/macros to list of subdirectories. + + * configure.in (AC_CHECK_FUNCS): Add `bcopy' to list of things to + check for. + +Fri Mar 3 13:54:10 1995 Robert J. Chassell <bob@hill.gnu.ai.mit.edu> + + * texinfo.texi: Minor changes for incremental new edition 2.20. + +Fri Mar 3 19:01:36 1995 Brian J. Fox <bfox@wizard.datawave.net> + + * filesys.c (filesys_read_info_file): Local variable ST_SIZE is a + long which has the value of finfo->st_size casted to it. + * nodes.c (whole file): Similar changes. + + These changes and the following for makedoc.c were required for + proper operation on HPm68k NetBSD. + +Mon Feb 27 15:16:27 1995 Brian J. Fox <bfox@wizard.datawave.net> + + * makedoc.c (process_one_file): Local variable FILE_SIZE is a long + which has the value of finfo.st_size casted to it. + + +Fri Mar 3 18:58:38 1995 Brian J. Fox <bfox@wizard.datawave.net> + + * makeinfo.c (find_and_load): Cast fileinfo.st_size to a long for + internal use. This makes things work on NetBSD. + + +Fri Mar 3 13:54:10 1995 Robert J. Chassell <bob@hill.gnu.ai.mit.edu> + + * texinfo.texi: Minor changes for incremental new edition 2.20. + +Fri Mar 3 09:41:39 1995 Brian J. Fox <bfox@wizard.datawave.net> + + * configure.in (TERMLIBS): Use AC_CHECK_LIB instead of + AC_HAVE_LIBRARY. + +Mon Jan 9 16:55:31 1995 Brian Fox <bfox@churchy.gnu.ai.mit.edu> + + * Makefile.in (DISTFILES): Add the directory EMACS-BACKUPS to the + list of things to avoid distributing. + +Tue Nov 29 17:48:37 1994 David J. MacKenzie <djm@duality.gnu.ai.mit.edu> + + * configure.in: Check for off_t. + * util/texindex.c (main): Use it. + +Fri Nov 11 14:46:28 1994 David J. MacKenzie <djm@duality.gnu.ai.mit.edu> + + * configure.in: Update for Autoconf v2. + +Thu Oct 13 02:17:38 1994 Richard Stallman <rms@mole.gnu.ai.mit.edu> + + * emacs/detexinfo.el (detexinfo): Handle @!, @?, @^, @". + +Mon Aug 1 03:26:13 1994 Richard Stallman <rms@mole.gnu.ai.mit.edu> + + * texindex.c: Move the memset define down past string.h include. + +Tue Jun 28 14:21:43 1994 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) + + * makeinfo/makeinfo.c: Add --help option. + (usage): Take args for stream and error code. + Change callers. + (print_version_info): Write to stdout, not stderr. + +Wed May 18 18:55:24 1994 Brian J. Fox (bfox@ai.mit.edu) + + * info/session.c (forget_window_and_nodes): Negate test for + internal_info_node_p. We only want to free the text if it is + not an internal node. + +Thu Mar 10 03:07:18 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * texindex.c (memset): Fix invalid parm name (was 0). + +Thu Feb 10 12:56:52 1994 Noah Friedman (friedman@prep.ai.mit.edu) + + * makeinfo/makeinfo.c (current_item_function): Don't loop if elt + is NULL. + +Wed Feb 9 12:21:09 1994 Brian J. Fox (bfox@ai.mit.edu) + + * makeinfo/makeinfo.c (minor_version): Release now at 1.60. + + * makeinfo/makeinfo.c (expand_filename): Additional fixes. Now + when called with NULL filename, makes an output filename from the + input filename. + (convert_from_loaded_file): If REQUIRE_SETFILENAME is #defined (no + longer the default case) then error if no @setfilename was found + in the file. If REQUIRE_SETFILENAME is not #defined, the input + file starts either at the first line, or at the second line if the + first line contains the text "\input", and the output filename is + the input file name without directory and with ".info" replacing + any extension found. + (convert_from_loaded_file): Fixed bug in search for first + occurence of "@setfilename". + +Tue Feb 8 14:16:58 1994 Noah Friedman (friedman@prep.ai.mit.edu) + + * configure.in: Check for sys/file.h. + info/dir.c, info/filesys.c, info/makedoc.c, info/nodes.c, + info/session.c, info/termdep.h, makeinfo/makeinfo.c + [HAVE_SYS_FILE_H]: Include <sys/file.h>. + + * makeinfo/makeinfo.c (convert_from_loaded_file): Print + real_output_filename instead of output_filename, so user knows + exactly where output file is going. + + Fri Jun 11 14:34:30 1993 Ian Lance Taylor (ian@cygnus.com) + * configure.in: Check for sigprocmask and sigsetmask. + * info/signals.h (HAVE_SIGSETMASK): Don't define. + (HAVE_SIGPROCMASK): Use instead of _POSIX_VERSION. + (BLOCK_SIGNAL, UNBLOCK_SIGNAL): If neither HAVE_SIGPROCMASK nor + HAVE_SIGSETMASK is defined, define these to do nothing. + * info/signals.c (sigprocmask): Don't compile if HAVE_SIGSETMASK + is not defined. + + * info/terminal.c (terminal_prep_terminal): Don't clobber VINTR + and VQUIT in conditionals. + +Mon Feb 7 18:10:22 1994 Brian J. Fox (bfox@ai.mit.edu) + + * makeinfo/makeinfo.c (full_pathname): Correct to really return + the full pathname of the input argument. Now makeinfo + /foo/bar.texi, where /foo/bar.texi contains "@setfilename + bar.info", correctly leaves the output file in "./bar.info". + Note that "@setfilename ../bar.info" still works; this is already + an absolute pathname. + +Sat Feb 5 13:04:05 1994 Brian J. Fox (bfox@ai.mit.edu) + + * makeinfo/makeinfo.c: Version 1.59 released. + + * makeinfo/makeinfo.c (whole file): Large number of changes allow + the "-E filename" option to be used to write a macro expanded + output file. On a file which contains no @include's and no + @macro's, the output file is identical to the input file. + + * makeinfo/makeinfo.c (declarations): Remove cm_tex (). It is + never used since it is implemented with `command_name_condition'. + + * makeinfo/makeinfo.c (add_char): Shift braces following the + current break point if we have deleted any characters. + (adjust_braces_following): New function adjusts all of the markers + in the brace stack which follow HERE by AMOUNT. This fixes a bug + where (for example) @var{} immediately following a line break + which is the end of a sentence modified the output incorrectly. + +Wed Feb 2 14:14:03 1994 Brian J. Fox (bfox@ai.mit.edu) + + * makeinfo: Version 1.58. + + * makeinfo/makeinfo.c (cm_node): Add extra hair to allow + backtracking through execution strings. Add extra hair to allow + the first node seen after a @top node is seen to adjust the + sectioning level of the @top node and associated menus. + Fix a few typos. + Add facility for macros to invoke the original definition. This + works by not allowing a single macro to recurse. Mutual recursion + is also disallowed with this plan. + + * makeinfo/macros: New directory contains shippable macros. + * makeinfo/macros/simpledoc.texi: Macros which simplify the most + common uses of TeXinfo. See the example file. + Macros are now a reasonable way to get people started using + TeXinfo. + +Mon Jan 31 12:54:36 1994 Brian J. Fox (bfox@ai.mit.edu) + + * makeinfo/makeinfo.c (minor_version): Increase to 57. + + * makeinfo/makeinfo.c (cm_node): Call execute_string on the node, + next, prev, and up pointers. + (reader_loop): Change logic for `@bye'. No longer required at the + ends of executed strings. + (execute_string): Do not append `@bye' to the string to execute. + + * makeinfo/makeinfo.c (whole file): Use COMMAND_PREFIX instead of + hardcoding `@' character in strings and searches. + + * makeinfo/makeinfo.c (read_command): If HAVE_MACROS is defined, + then recognize and execute macros here. + (CommandTable): Add "macro" and "unmacro" to table if HAVE_MACROS + is defined. + + * makeinfo/makeinfo.c (cm_macro, cm_unmacro, execute_macro) + makeinfo/makeinfo.c (get_macro_args, find_macro, add_macro) + makeinfo/makeinfo.c (delete_macro, array_len, apply): + New functions implement macro facility if HAVE_MACROS is + defined. + + * makeinfo/macro.texi (new file): Examples of using the new macro + facility. + +Mon Jan 31 10:24:52 1994 Noah Friedman (friedman@prep.ai.mit.edu) + + * makeinfo/makeinfo.c (executing_string): Restore global + declaration. + +Mon Jan 24 23:48:26 1994 Noah Friedman (friedman@prep.ai.mit.edu) + + * texinfo.texi: Various typo fixes from Bob Chassell + <bob@gnu.ai.mit.edu>. + +Thu Jan 6 13:34:21 1994 Noah Friedman (friedman@prep.ai.mit.edu) + + * texinfo.texi: Turned on smallbook format and @set smallbook. + +Wed Dec 15 20:08:43 1993 Noah Friedman (friedman@prep.ai.mit.edu) + + * info/filesys.h (DEFAULT_INFOPATH): Added /usr/local/info, + /opt/gnu/info, /usr/share/info, and /usr/local/share/info. + +Tue Dec 14 19:10:20 1993 Noah Friedman (friedman@prep.ai.mit.edu) + + * libtxi/Makefile.in (ALLOCA): Define from configure. + +Fri Dec 10 04:33:12 1993 Noah Friedman (friedman@prep.ai.mit.edu) + + * util/texi2dvi: Put under RCS control. + +Sun Dec 26 11:55:46 1993 Brian J. Fox (bfox@ai.mit.edu) + + * info/session.c (info_numeric_digit_arg_loop): Fix doc string. + + * info/infodoc.c (create_internal_info_help_node): Print out list + of functions which have to keystroke equivalent if we support + NAMED_FUNCTIONS. + + * info/filesys.c (compress_suffixes): Add ".gz" for "gunzip" to + alist. + + * info/footnotes.c (make_footnotes_node): If refs[i] doesn't have + a nodename, then it couldn't be a reference to a footnote. + + * info/nodemenu.c (get_visited_nodes): Handle the case where + filter_func has left no possible buffers to select. + +Sat Dec 25 10:35:56 1993 Brian J. Fox (bfox@ai.mit.edu) + + * info/infodoc.c (create_internal_info_help_node): Conditionalize + generation of the help node based on the #define + HELP_NODE_GETS_REGENERATED. When this is not set (the default) + the help node is generated exactly once, and is not gc'able. + Otherwise, a new node is always created for the help window, and + the old node gets garbage collected by the gc system. + (info_find_or_create_help_window): Conditionalize window node + selected based on the #define HELP_NODE_GETS_REGENERATED. + + * info/dir.c (add_menu_to_file_buffer): Place exactly one blank + line between directory entries. + + * info/info.c (version_string): Update minor version to "11". + + * info/info.h: Update comment to "2.11". + + * info/dir.c (maybe_build_dir_node): Only add the contents of a + new file if it is not identical to the file of the DIR buffer. + + * info/nodes.c (info_get_node): Call `maybe_build_dir_node' on + "dir" as well as "localdir" to mimic emacs-19.22 "dir" merging + behaviour. + +Fri Dec 3 13:41:44 1993 Brian J. Fox (bfox@ai.mit.edu) + + * info/info-utils.c (canonicalize_whitespace): Suppress whitespace + found at the start of STRING. + +Sat Nov 20 14:00:50 1993 Brian J. Fox (bfox@hippie) - * doc/info.texi: Use @subsubsection instead of - @unnumberedsubsubsection, since it's in a numbered chapter. + * info/indices.c (DECLARE_INFO_COMMAND): Fix typo in assignment to + `old_offset' (= instead of ==). - * Started installation of following DOS patches from Eli. ->1998-05-16 Eli Zaretskii <eliz@is.elta.co.il> -> -> * info/session.c (info_goto_node): Don't show the nodes of the -> current Info file twice in *Completions*. -> * info/echo-area.c (ea_possible_completions): Actually pass the -> number of completions to printf_to_message_buffer. -> -> * info/man.c (manpage_node_of_file_buffer): xstrdup the nodename -> member of manpage nodes, since the tags are freed and recomputed -> when a new man page is added to *manpages* file_buffer. -> (get_manpage_node): Recompute info_windows[]->nodes[] for all -> windows showing the man pages after nodes[]->contents are -> invalidated by reallocation of file_buffer->contents. -> ->1998-05-15 Eli Zaretskii <eliz@is.elta.co.il> -> -> * lib/system.h (DEFAULT_INFO_PRINT_COMMAND) [__MSDOS__]: Define to -> ">PRN". -> * info/session.c (print_node): Support ">printer" in -> INFO_PRINT_COMMAND, to mean write to the named file/device insead -> of piping to it as a program. -> (kill_node): Compare window in addition to the nodename, when -> looking for the node to kill. -> ->1998-05-09 Eli Zaretskii <eliz@is.elta.co.il> -> -> * lib/system.h (SET_SCREEN_SIZE_HELPER) [__MSDOS__]: Define a new -> macro. -> * info/m-x.c (set_screen_height): Use SET_SCREEN_SIZE_HELPER, if -> defined. If the screen size did'n change, redisplay the previous -> screen contents. -> -> * info/infomap.c (initialize_info_keymaps) [__MSDOS__]: Bind DEL -> to ea_delete in the echo-area keymap. -> * info/session.c (incremental_search): If the key is -> isearch_terminate_search_key, but buffered input is pending, don't -> gobble the ESC key. -> -> * info/info.c (main): Switch the order thet terminal_prep_terminal -> and terminal_clear_screen are called, to make it consistent with -> what initialize_info_session does when called with non-zero second -> argument. Call terminal_unprep_terminal last, after moving the -> cursor to the bottom of the screen. If user_filename is of the -> form "d:foo", add "d:." to the INFOPATH, not "d:". -> -> * info/signals.c (initialize_info_signal_handler): Save old -> SIGUSR1 handler. -> (info_signal_handler): Handle SIGUSR1. -> -> * info/indices.c (info_apropos): Print the results to stdout. -> ->1998-05-02 Eli Zaretskii <eliz@is.elta.co.il> -> -> * makeinfo/makeinfo.c (ALSO_NULL_DEVICE): New macro, for alternate -> null device name. -> -> * info/man.c (get_manpage_contents): Redirect stderr of the man -> page formatter to the null device. -> (executable_file_in_path): Use IS_SLASH. -> -> * info/session.c (info_gather_typeahead) [__DJGPP__]: Call -> pc_term_chars_avail to get the number of pending characters. -> -> * info/filesys.c (convert_eols): New function, converts DOS-style -> EOLs to a single Newline. -> (filesys_read_info_file, filesys_read_compressed): Call it. -> (filesys_read_compressed) [STRIP_DOT_EXE]: Use explicit .exe -> suffix. -> (filesys_read_compressed): Check return status of `pclose'. -> ->1998-05-01 Eli Zaretskii <eliz@is.elta.co.il> -> -> * info/filesys.c (filesys_read_info_file): Add additional -> parameter: is_compressed. All callers changed. -> -> * makeinfo/makeinfo.c (convert_from_loaded_file): Compare file -> names with FILENAME_CMP. Use NULL_DEVICE. -> (cm_node): Compare file names with FILENAME_CMP. -> * info/tilde.c (tilde_find_suffix, tilde_expand_word): Use -> IS_SLASH. -> -> * info/pc_term.c: New file, handles the PC terminal on MS-DOS and -> MS-Windows. -> * info/terminal.c [__MSDOS__]: Include pc_term.c. -> * info/Makefile.in (ginfo_SOURCES): Add pc_term.c -> Add pc_term.c to dependencies of terminal.o. -> -> * info/session.c (info_get_input_char): Reassign tty after EOF -> from a non-stdin input stream. -> ->1998-04-30 Eli Zaretskii <eliz@is.elta.co.il> -> -> * info/session.c (info_set_input_from_file): Use binary input. -> (info_gc_file_buffers): Compare file names with FILENAME_CMP. -> * info/search.c (skip_whitespace_and_newlines): Use -> whitespace_or_newline macro instead of reinventing the wheel. -> * info/nodes.c (info_find_file_internal): Use IS_ABSOLUTE and -> FILENAME_CMP. -> (info_load_file_internal): Call filename_non_directory to find out -> where the basename begins. -> (get_tags_of_indirect_tags_table): Call filename_non_directory. -> containing_dir of "d:foo" is "d:.", not "d:". -> (forget_info_file): Compare file names with FILENAME_CMP. -> * info/nodemenu.c (get_visited_nodes): Use FILENAME_CMP to find -> duplicate lines. -> -> * lib/system.h (PIPE_USE_FORK): New macro. -> * info/man.c (get_manpage_contents): Use it to determine whether -> to call pipe/fork/exec or popen/pclose to run the man page -> formatter. -> (executable_file_in_path): Search for the file with several known -> extensions such as .exe, where appropriate. -> -> * lib/system.h (NULL_DEVICE): A new macro. -> * info/makedoc.c (main): Use it. -> (maybe_dump_tags): Switch output strem to binary mode when -> appropriate. -> (process_one_file): Update file_size after reading the file. -> -> * info/infodoc.c: Add TAB, RET, and `i' to the list of important -> commands in info_internal_help_text. -> -> * info/info.c (main): Support the --speech-friendly option. Use -> PATH_SEP to separate directories. -> (info_short_help) [__MSDOS__]: Mention the --speech-friendly -> option. -> -> * info/info-utils.c (filename_non_directory): Use HAVE_DRIVE and -> IS_SLASH. -> * info/indices.c (do_info_index_search, index_entry_exists): Use -> FILENAME_CMP to compare file names. -> * info/filesys.c: Add ".inf" to the list of known extensions. -> Look for .z before .Z, for the sake of case-insensitive -> filesystems. Add DOS-specific extensions to work around 8+3 -> namespace restrictions. -> (info_absolute_file): New function. -> (info_find_fullpath): Call it for candidates which are absolute -> file names. Use IS_SLASH and IS_ABSOLUTE. -> (info_file_in_path): Use IS_SLASH. -> (extract_colon_unit, info_add_path): Use PATH_SEP instead of ":". -> (lookup_info_filename): Compare file names with FILENAME_CMP. -> (filesys_read_info_file): Read Info files in binary mode. -> (filesys_decompressor_for_file): Read Info files in binary mode. -> Compare file names with FILENAME_CMP. On MS-DOS, allow files -> whose names end with a `z' be decompressed with gunzip. -> * info/dribble.c (open_dribble_file): Open dribble file in -> FOPEN_WBIN mode. -> * info/dir.c (maybe_build_dir_node): Use IS_SLASH. -> * util/texindex.c (maketempname): Put the numeric suffix after the -> dot, to salvage 3 more characters on 8+3 filesystems. -> ->1998-04-29 Eli Zaretskii <eliz@is.elta.co.il> -> -> * util/texindex.c (main): Use IS_SLASH to find the basename of -> argv[0]. Lose the .exe suffix, if any. -> (decode_command): Look at $TEMP and $TMP in addition to $TMPDIR. -> Use DEFAULT_TMPDIR. -> * util/texi2dvi: Use either `:' or `;' as directory separator in -> TEXINPUTS, computed at run time. Save previous versions of index -> files in a separate backup directory. -> * util/install-info.c (main): Support backslashes in file names by -> using IS_SLASH. Avoid recomputing length of infile_basename -> unnecessarily. Use FILENAME_CMP for comparing file names -> case-insensitively, where appropriate. Allow foo.inf as well as -> foo.info to be an Info file name. -> * lib/system.h (PATH_SEP, STRIP_DOT_EXE, FILENAME_CMPN, -> DEFAULT_TMPDIR): New macros. -> ->1998-04-25 Eli Zaretskii <eliz@is.elta.co.il> -> -> * lib/system.h (O_BINARY, SET_BINARY, FOPEN_RBIN, FOPEN_WBIN, -> IS_SLASH, HAVE_DRIVE, IS_ABSOLUTE, FILENAME_CMP, PATH_SEP, -> HAVE_LONG_FILENAMES): New macros. -> * makeinfo/makeinfo.c (find_and_load): Use O_BINARY to decide when -> read returning a value different from what st_size says is not an -> error. Realloc the buffer after we've read the file. -> (skip_directory_part): New function, skips leading directory in a -> way that works on DOSISH systems. -> (filename_non_directory, pathname_part): Call it. -> (filename_part): Call filename_non_directory. -> (expand_filename, full_pathname): Use IS_ABSOLUTE and IS_SLASH. -> (convert_from_file): Check .txi extension first. -> (split_file): Support splitting output files on 8+3 filesystems. -> (main, extract_colon_unit): Use PATH_SEP instead of ':'. -> (get_file_info_in_path): Use IS_ABSOLUTE and IS_SLASH. +Tue Nov 2 12:22:40 1993 Brian J. Fox (bfox@ai.mit.edu) + + * makeinfo/makeinfo.c (make_index_entries_unique): New function + makes a sorted array have all unique entries by appending numbers + to the ends of strings. + (sort_index): Call `make_index_entries_unique'. + +Mon Sep 20 12:04:05 1993 Brian J. Fox (bfox@ai.mit.edu) + + * makeinfo/makeinfo.c (get_execution_string): New Function returns + a pointer to an EXECUTION_STRING structure. + (execute_string): No longer uses a static string; call + `get_execution_string' instead in order to get a free buffer for + consing. + +Sun May 23 07:00:20 1993 Noah Friedman (friedman@prep.ai.mit.edu) + + * Texinfo 3.1 released. + +Sat May 22 18:21:27 1993 Noah Friedman (friedman@prep.ai.mit.edu) + + * info/info.c (info_patch_level): Increment constant to 1. + + * info/Makefile.in (DEFAULT_INFOPATH): Default definition deleted. + Makefile.in: Put it here instead. + * Makefile.in (MDEFINES): Add DEFAULT_INFOPATH. + + * configure.in: check for vfprintf and vsprintf. + + * makeinfo/makeinfo.c: Version 1.55. + + * makeinfo/makeinfo.c (add_word_args, execute_string) [HAVE_VARARGS_H]: + Don't use this definition unless HAVE_VSPRINTF is also defined. + (error, line_error, warning) [HAVE_VARARGS_H]: Don't use this + definition unless HAVE_VFPRINTF is also defined. + Remove indentation of all cpp directives, except for #pragma. + +Fri May 21 14:34:24 1993 Noah Friedman (friedman@prep.ai.mit.edu) + + * texinfo.texi: Rename to texi.texi. + Change @setfilenname and START-INFO-DIR-ENTRY to `texi.info'. + + * Makefile.in (MDEFINES): Pass LDFLAGS to sub-makes. + (realclean): Delete `configure'. + Changed all references to texinfo.info to texi.info + + * configure.in: Add AC_PROG_RANLIB, and AC_CONST. + Check for `rindex' function. + Check for varargs.h. + Clean up symbol names for header files so a single AC_HAVE_HEADERS + can be used. + (AC_INIT): Use texi.texi instead of makeinfo/makeinfo.c + + * info/info-utils.h: Copy definitions of bcopy, index, and rindex + (with appropriate #ifdef wrappers) from termdep.h. These are + included by a mutually exclusive set of files. + + * info/termdep.h [HAVE_SYS_PTEM]: Use HAVE_SYS_PTEM_H instead. + + * info/terminal.c, info/termdep.h [HAVE_TERMIO]: Use HAVE_TERMIO_H + instead. + + * info/makedoc.c, info/filesys.c [!O_RDONLY]: Include fcntl.h or + sys/fnctl.h, depending on whether HAVE_SYS_FCNTL_H is set. + * info/termdep.h: Remove all indentation in #-exprs. + Remove old assumptions about bcopy, index, and rindex. + [HAVE_BCOPY]: Define bcopy. + [HAVE_RINDEX]: Define index and rindex. - * doc/texinfo.txi: Changes from Eli for MS-DOS stuff. - * doc/info-stnd.texi: Fixes from Eli: he documented all the - missing keys and command-line options, corrected - inaccuracies (probably left-overs from previous versions), - and added some clarifications where I thought the manual - was not clear enough. - * Makefile.am (EXTRA_DIST): Add djgpp files. + * info/nodes.c (info_get_node): Don't call stricmp if nodename is + NULL. Remove indentation in #-exprs. - * makeinfo/makeinfo.c: New no-op commands @setcontentsaftertitlepage - and @setshortcontentsaftertitlepage. - * doc/texinfo.txi: Document the new @set{,short}contentsaftertitlepage - commands and the possibility of putting @contents and - @shortcontents after @end titlepage. + * info/echo_area.c (echo_area_stack_depth): Declare static. - * util/texi2dvi: Check that the toc file has not changed (as well - as .aux and .??). + * info/Makefile.in (DEFAULT_INFOPATH): Make separate Makefile + variable so it can be overridden more easily by the user. Add `.' + to beginning of path. + (clean): Delete core.* (386bsd core files). + (MAKEDOC): Variable removed. Refer to `makedoc' explicitly. + (funs.h): Add `:' commands after if, to avoid spurious nonzero + exit statuses. -Thu Jun 25 16:58:46 1998 Karl Berry <karl@cs.umb.edu> + * info/userdoc.texi: Improved comments explaining its purpose. - * doc/texinfo.txi: Document new commands @env, @command, @option. + * makeinfo/makeinfo.c [HAVE_VARARGS_H]: Include varargs.h. + (error, line_error, warning, add_word_args, + execute_string)[HAVE_VARARGS_H]: New versions that + use varargs. From bfox. - * makeinfo/makeinfo.c (option, command, env): New markup commands, same - as @code in info. + * makeinfo/Makefile.in (clean): Delete core.* (386bsd core files). -Wed Jun 24 15:39:38 1998 Karl Berry <karl@cs.umb.edu> + * util/Makefile.in (clean): Remove core.* (386bsd core files). - * makeinfo/makeinfo.c: New no-op command @acronym. + * libtxi/Makefile.in: Remove all references to $(common). + (RANLIB): New variable, set from autoconf. + (libtxi.a): Use $(RANLIB) instead of `ranlib' in target rules. + (clean): Delete core.* (386bsd core files). - * doc/texinfo.txi: Document new command @acronym. +Tue May 18 12:08:24 1993 Robert J. Chassell (bob at grackle.stockbridge.ma.us) - * util/install-info.c (strip_info_suffix, menu_item_equal): New fns. - (main): Call them instead of doing the filename test inline; all the - .info variations are too confusing to write out twice. + * emacs/texinfmt.el (texinfo-format-refill): Do not fill a section + title line with the asterisks, hyphens, etc. that underline + it in any circumstance. -Tue Jun 23 18:01:40 1998 Karl Berry <karl@cs.umb.edu> +Sun May 16 13:53:43 1993 Noah Friedman (friedman@prep.ai.mit.edu) - * doc/texinfo.txi: Fix some overfull boxes. + * util/mkinstalldirs: handle relative pathnames. -Mon Jun 22 19:22:17 1998 Karl Berry <karl@north> +Fri May 14 20:18:49 1993 Noah Friedman (friedman@prep.ai.mit.edu) - * configure.in: Remove AC_LINK_FILES call, that was an old gettext - thing, no longer necessary, and causes problems with Autoconf. + * util/mkinstalldirs: initialize IFS if unset. -Sun Jun 14 07:00:15 1998 Karl Berry <karl@cs.umb.edu> +Tue May 11 06:33:14 1993 Noah Friedman (friedman@prep.ai.mit.edu) - * util/texi2dvi: Indent options so help2man will work. From Akim. + * makeinfo/makeinfo.c (cm_item): don't dereference item_func if NULL. -Sat Jun 13 10:45:25 1998 Karl Berry <karl@cs.umb.edu> +Mon May 10 14:50:31 1993 Noah Friedman (friedman@prep.ai.mit.edu) - * configure.in (ALL_LINGUAS): Add nl. + * Texinfo 3.0 released. - * util/texi2dvi: Avoid tabs. + * Makefile.in (ALLOCA): Provide for substitution. -Wed Jun 10 17:38:21 1998 Karl Berry <karl@cs.umb.edu> +Mon May 10 10:12:53 1993 Noah Friedman (friedman@prep.ai.mit.edu) - * makeinfo/makeinfo.c (gen_defindex): Use xmalloc instead of alloca. - This was our only use of alloca, so also remove all the #if junk - at the beginning to define it. + * emacs/texinfmt.el (texinfmt-version): Updated year. - * makeinfo/makeinfo.c: Fix grammar in multiply-defined-node error - message. +Fri Apr 16 04:48:03 1993 Noah Friedman (friedman@prep.ai.mit.edu) -Tue Jun 9 17:53:54 1998 Karl Berry <karl@cs.umb.edu> + * makeinfo/makeinfo.c: Version 1.54 from bfox. - * doc/texinfo.txi: Document new commands @smallformat, - @smalldisplay. + * util/fixfonts: Replace instances of `[..]' with `test'. + Use more portable `test' arguments: `z$foo = z' instead of `! $foo'. + Robustify quoting in eval assignments. + (textfmdir, texpkdir, texgfdir): Don't override definition from + environment, if any. + Trap EXIT, SIGHUP, SIGINT, SIGQUIT, SIGTERM to delete temp files + instead of trying to remove them explicitly before calling exit. + When changing cwd, do so in subshell, in case various tex*dir + variables are relative. + Don't use `head', `dirname', or `basename'. These don't behave + consistently and/or don't even exist on some systems. They can + all be emulated with `sed' anyway. + (tempfile2_line1): New variable. Use it instead of running + process to extract first line out of tempfile2 multiple times. + Eliminate some gratuitous uses of $tempfile2, such as in for loops. - * makeinfo/makeinfo.c: New commands @smalldisplay and @smallformat. - Suggestion from: Eli Zaretskii <eliz@is.elta.co.il>. +Fri Mar 26 23:25:13 1993 Noah Friedman (friedman@prep.ai.mit.edu) - * makeinfo/makeinfo.h (insertion_type, insertion_type_names): - Declare smalldisplay and smallformat. + * texinfo.texi: @setfilename texinfo.info. -Mon Jun 8 07:57:52 1998 Karl Berry <karl@cs.umb.edu> + * makeinfo/makeinfo.c (reader_loop, end_insertion): Fix typos in + comments. + (handle_variable_internal): Handle the case that there further + menu text after a false ifset/ifclear. - * doc/texinfo.txi: Document possibility of combining @titlefont - and @title. From Eli. + * util/texi2dvi: Version 0.4 + Replace all instances of `[ ... ]' with `test'. + Updated bug-reporting address. - * util/texi2dvi: Set verbose to : instead of false by default. +Thu Mar 25 12:31:30 1993 Noah Friedman (friedman@prep.ai.mit.edu) + + * info/Makefile.in (install): Install info.1 man page. + (uninstall): Remove installed info.1 man page. + + * info/infoman.texi: Standalone manual renamed to info-stnd.texi. + Makefile.in: Targets updated appropriately. + + * info/Makefile.in (LDEFS): New variable. Use it for info-local + macros, since DEFS will be inherited from parent make and any + local definitions will get clobbered. + + * info/RELEASE: Renamed to info/NEWS. + + * README: New file. + + * Makefile.in (topclean): New target. + + * Getting-started: Renamed to INTRODUCTION. Former name is too + long (over 14 chars). + + * New-features: Renamed to NEWS. + + * Makefile.in (MDEFINES): Set it. + + * Makefile.in (dist): Use --gzip option to tar to make sure + resulting file is compressed with gzip. Change tar file + extension from `.Z' to `.z'. + + * Makefile.in (DISTFILES): Filter out any file or directory names + starting with `='. + + * fixfonts: Moved to util/fixfonts. + + * RELEASE: Deleted. + + * makeinfo/Makefile.in (VPATH): Use $(srcdir), not @srcdir@. + (common): Use ../libtxi, not ../common. + (makeinfo.in): Run makeinfo with --no-split. + + * makeinfo/makeinfo.texi: Changes from bob. + + * util/Makefile.in (VPATH): Use $(srcdir), not @srcdir@. + (common): Use ../libtxi, not ../common. + + * util/fixfonts: Moved from top-level directory. + +Wed Mar 24 10:21:31 1993 Robert J. Chassell (bob at grackle) + + * emacs/texinfmt.el (texinfo-format-region): Do not require + `@setfilename' line; delete `\input texinfo' line if part of + region. + + * emacs/texinfmt.el (texinfo-raise-lower-sections): Raise or lower the + hierarchical level of chapters, sections, etc. according to + `@raisesections' and `@lowersections' commands. + +Thu Mar 18 16:02:27 1993 Robert J. Chassell (bob at grackle) + + * emacs/texinfo.el (texinfo-show-structure): Indent *Occur* buffer + according to the structure of the file. + +Sat Mar 6 05:16:44 1993 Noah Friedman (friedman@prep.ai.mit.edu) + + * util/texi2dvi: use ${1+"$@"}, not just "$@". + +Tue Feb 2 08:38:06 1993 Noah Friedman (friedman@prep.ai.mit.edu) + + * info/Makefile.in: Replace all "--nosplit" arguments to makeinfo + with "--no-split" + +Sun Jan 31 18:16:58 1993 Noah Friedman (friedman@prep.ai.mit.edu) + + * util/texi2dvi: Don't put .dvi and related auxillary files in same + directory as source files. Put them in current directory instead. + (TEXINPUTS_orig): New variable. + (file_texi): Variable removed. + (filename_texi): New variable. + (command_line_filename): Use this wherever references to file_texi + occured except in setting filename_noext. + (TEXINPUTS): Current directory and source directory where input + file resides prepended to standard path before invoking TeX. + +Wed Jan 27 16:24:37 1993 Noah Friedman (friedman@prep.ai.mit.edu) + + * util/Makefile.in: overhauled. + +Tue Jan 26 21:04:23 1993 Noah Friedman (friedman@prep.ai.mit.edu) + + * Makefile.in, info/Makefile.in, makeinfo/Makefile.in: Overhauled. + + * configure.in: Renamed from texinfo.in. + Incorporated makeinfo/makeinfo.in, info/info.in, and + util/util.in. Create all child Makefiles. + + * makeinfo/makeinfo.in, info/info.in: Deleted (incorporated into + top configure.in). + + * util/util.in: Deleted (incorporated into ../configure.in). + +Mon Jan 25 10:59:49 1993 Brian Fox (bfox@cubit) + + * info/info.c: New version 2.9; new variable INFO_PATCH_LEVEL + appears in the version string if it is non-zero. New function + version_string () produces the current version string, as in 2.8-p1. + + * info/dir.c: New file implements Gillespies `localdir' hacks. + + * info/nodes.c (info_get_node): Now calls maybe_build_dir_node () + if the file name to look for is "dir". + + * info/nodes.h: New flag N_CannotGC unconditionally prevents garbage + collection of a file buffer's contents. Used when "dir" is made + from at least one "localdir". + +Fri Jan 22 11:36:42 1993 Brian Fox (bfox@cubit) + + * info/footnotes.c: Do not declare auto_footnotes_p as "extern" in + this file. + +Thu Jan 21 08:57:08 1993 Brian Fox (bfox@cubit) + + * info/info.c: New version 2.8. + + * info/userdoc.texi, info/infoman.texi, info/info.texi: Fully + document Info; create both online and printed manual versions. + "userdoc.texi" contains exactly the documentation for GNU Info 2.x. + "infoman.texi" is a wrapper for that file; it is meant to produce + printed documentation. "info.texi" has the user documentation as a + complete chapter within itself, but continues to contain the Info + tutorial. + + * info/makedoc.c: Convert "ea_" into "echo_area_" when creating the + command name. + +Fri Jan 15 16:50:35 1993 Brian Fox (bfox@cubit) + + * info/search.c (skip_node_characters): New argument NEWLINES_OKAY if + non-zero says that newlines should be skipped over during parsing. - * util/texi2dvi: Missing \\ for sed with -t text. From Akim. + * info/info-utils.c (info_parse_node): New argument NEWLINES_OKAY if + non-zero says that newlines should be skipped while parsing out + the nodename specification. -Sun Jun 7 13:02:13 1998 Karl Berry <karl@cs.umb.edu> +Wed Jan 13 14:42:33 1993 Brian Fox (bfox@cubit) - * doc/texinfo.txi: Document @pagesizes and texidvi -t. + * info/makedoc.c: Remove "info_" from the front of the command name + before installing it. - * makeinfo/makeinfo.c: Define no-op @pagesizes and @afourpaper. - (major_version, minor_version): Remove these globals, just use the - Texinfo package version. - (print_version_info): Ditto. + * info/session.c (info_menu_or_ref_item): A label of "Menu" is okay if + the builder is not info_menu_of_node (); -Fri Jun 5 17:54:16 1998 Karl Berry <karl@cs.umb.edu> + * info/m-x.c: New function replace_in_documentation () replaces \\[foo] + with the keystrokes you type to get that command. Now used in + indices.c, info.c, infodoc.c. - * doc/texinfo.txi: Change texi2dvi documentation a bit. +Mon Jan 11 10:27:41 1993 Brian Fox (bfox@cubit) - * util/texi2dvi: Handle --option=argument style of specifying - arguments. + * info/variables.c, h: New files contain describe-variable and stuff + moved out of m-x.c. -Sat May 30 14:01:37 1998 Karl Berry <karl@cs.umb.edu> + * info/m-x.c: Move VARIABLE_ALIST and variable functions into + variables.c. Add documentation string to variable definition. - * doc/texinfo.txi: More. + * info/echo_area.c (push_echo_area): Zero the contents of + echo_area_completion_items after pushing the vars. - * util/install-info.c (open_possibly_compressed_file): Finish - implementation. +Sat Jan 9 11:59:47 1993 Brian Fox (bfox@cubit) - * doc/texinfo.txi: Document install-info compression support. + * info/Makefile.in: Add footnotes.c,h,o to the appropriate Makefile + variables. -Fri May 29 08:01:43 1998 Karl Berry <karl@cs.umb.edu> + * info/window.c (window_tile_windows): New function divides the + available space among the visible windows. - * util/install-info.c (open_possibly_compressed_file): Initial - implementation. + * info/session.c (info_tile_windows): New function calls + window_tile_windows. - * util/install-info.c (output_dirfile): Attempt to write dir.gz if - that's what we read. - (readfile): Pass back the actual opened filename, too. + * info/footnotes.c, footnotes.h: New file implements functions for + aiding automatic footnote display when entering a node which has + footnotes. - * info/indices.c: Check in Eli's patch. + * info/m-x.c: New user-variable "automatic-footnotes". -Thu May 28 17:09:45 1998 Karl Berry <karl@cs.umb.edu> + * info/window.c (window_physical_lines) New function counts the + carriage returns found in NODE. - * util/install-info.c (readfile): Set up to handle compressed - input (and output) files. Change callers. - Rearrange function order to avoid forward declarations. +Wed Jan 6 11:24:19 1993 Brian Fox (bfox@cubit) - * configure.in: Remove check for libz, we'll fork gzip instead. + * info/general.h: #include <unistd.h> if we have it. -Tue May 26 18:01:13 1998 Karl Berry <karl@cs.umb.edu> +Tue Jan 5 11:12:33 1993 Brian Fox (bfox@cubit) - * util/install-info.c (print_help): Missing \n\ in help string. + * info/info-utils.c (info_concatenate_references): If either arg is + NULL, return the other arg. - * makeinfo/makeinfo.c (POST_SENTENCE): Rename from post_sentence. - Change calls. - (flush_output): Strip 8th bit if post_sentence char as well as space. - (cm_code, etc.): Change add_char calls for post_sentence chars to set - 8th bit. + * info/indices.c (info_indices_of_file_buffer): Simplified and + corrected loop through tags/nodes of file buffer looking for + indices. -1998-05-23 Eli Zaretskii <eliz@is.elta.co.il> + * info/search.c (skip_node_characters): Rewrite "if" statement for + clarification and conciseness. - * info/indices.c (info_next_index_match): Call - info_set_node_of_window to display the node, so that footnotes are - displayed as well. +Fri Jan 1 03:18:26 1993 Brian Fox (bfox@cubit) -Thu May 21 11:05:50 1998 Karl Berry <karl@cs.umb.edu> + * info/info.in: Check for setvbuf (), and check to see whether the args + are reversed. - * util/install-info.c (output_dirfile): New function, extracted - from the end of main. + * info/dribble.c (open_dribble_file) Check HAVE_SETVBUF and + SETVBUF_REVERSED when setting the buffering on info_dribble_file. - * makeinfo/makeinfo.c (begin_insertion): Ignore @group in all the - example-like environments, not just @example. Otherwise the first - line in the environment is not indented correctly. Reported by rms. +Thu Dec 31 20:14:13 1992 Brian Fox (bfox@cubit) -Wed May 20 17:44:38 1998 Karl Berry <karl@cs.umb.edu> + * info/session.c (info_select_reference) If the node couldn't be found, + look for the label as a filename (i.e., "(LABEL)Top"). - * util/install-info.c: Doc fixes. +Wed Dec 30 01:57:50 1992 Brian Fox (bfox@cubit) - * util/install-info.c: Handle XEmacs-style dir entries: - * FILENAME::PROGRAM DESCRIPTION. - Date: Wed, 13 May 1998 13:58:28 +0900 - From: KIRIYAMA Kazuhiko <kiri@kiri.toba-cmt.ac.jp> + * New Version 2.7 Beta. - Also, do not set something_deleted on continuation lines; they are only - deleted if the entry was deleted. + * info/echo_area.c: Numerous functions now do something with the + numeric argument. Kill ring implemented, as well as yank and + yank_pop. Also transpose-chars. -Tue May 19 17:22:50 1998 Karl Berry <karl@cs.umb.edu> + * info/window.c (window_make_modeline): Check node->flags for + N_IsCompressed and display "zz" in the modeline if the node comes + from a file which is compressed on disk. - * util/install-info.c: Do not read the dir file if we are only - deleting -- it might not exist, and we don't actually need it. - From: David Kaelbling <drk@sgi.com> - Date: Tue, 12 May 1998 11:05:26 -0400 +Mon Dec 28 17:33:12 1992 Brian Fox (bfox@cubit) - * util/gen-dir-node: - From: David Kaelbling <drk@sgi.com> - Date: Tue, 12 May 1998 16:05:16 -0400 - - - The "dir" moobler header is slightly different from the default - dir file. - - If all files in ${infofiles} appear in the skeleton the last one - is processed twice. - - INFO-DIR-SECTION data is ignored. - - Don't generate entries for directories. + * info/filesys.c, info/nodes.c: New member of FILE_BUFFER "FILESIZE" + contains the size of file_buffer->contents. finfo.st_size is no + longer relied upon to read the contents of files, since the new + function (filesys_read_info_file) can read compressed files. -Sat May 16 17:16:56 1998 Karl Berry <karl@cs.umb.edu> + * info/filesys.c (info_find_fullpath) If a file starts with a slash (or + tilde expansion causes it to start with a slash) still call + info_find_file_in_path () on it so that we can find files with + compression suffixes. - * makeinfo/makeinfo.c (cm_novalidate): New fn for new command - @novalidate, like --no-validate. + * info/m-x.c: New variable "gc-compressed-files". -Thu May 14 18:02:31 1998 Karl Berry <karl@cs.umb.edu> +Tue Dec 22 03:45:28 1992 Brian Fox (bfox@cubit) - * doc/texinfo.txi: Document the @novalidate command. + * info/info.c: Version 2.6 Beta. -Wed May 13 17:47:20 1998 Karl Berry <karl@cs.umb.edu> + * info/indices.c (info_index_next): Improve the final search for the + matched index entry. - * doc/texinfo.txi: Document limitation on @set/@value names in - index commands. + * info/session.c (move_to_screen_line): New function implements `M-r'. + Given a numeric argument, move point to the start of that line in + the current window; without an arg, move to the center line. + * infomap.c: Put move_to_screen_line () on `M-r'. -Fri May 1 14:12:15 1998 Karl Berry <karl@cs.umb.edu> + * info/nodes.c (adjust_nodestart): Don't set N_UpdateTags unless the + node came from a tags table. - * doc/texinfo.txi (Command List): @deftypevar out of order. + * info/nodes.c (info_find_file_internal): If the filename being looked + for doesn't start with a `/', then additionally compare the + filename against the fullpath of the file buffer sans the + directory name. This can happen when selecting nodemenu items. - * configure.in (ALL_LINGUAS): Add cs. +Mon Dec 21 10:07:18 1992 Brian Fox (bfox@cubit) -Tue Apr 28 09:33:41 1998 Karl Berry <karl@cs.umb.edu> + * info/session.c, info/display.c: Remove all references to + active_window_ch, active_window_cv, cursor_h, and cursor_v. The + single function display_cursor_at_point () is used for all cursor + movement, and to place the terminal's cursor at the right location + on the screen. - * makeinfo/makeinfo.c (strcasecmp): This is in lib now. +Sat Dec 19 12:01:33 1992 Brian Fox (bfox@cubit) -1998-04-26 Richard Stallman <rms@psilocin.gnu.org> + * info/nodemenu.c: New file implements a few functions for manipulating + previously visited nodes. `list-visited-nodes' produces a menu of + the nodes that could be reached by info_history_node () in some + window. `select-visited-node' is similar to `list-visited-node' + followed by `info-menu-item', but doesn't display a window with + the visited nodes menu. - * util/install-info.c (print_help): Doc clarifications. + * info/session.c (info_numeric_arg_digit_loop): If redisplay had been + interrupted, then redisplay all of the windows while waiting for + input. -Sun Apr 19 15:55:10 1998 Karl Berry <karl@cs.umb.edu> + * info/display.c (display_was_interrupted_p): New variable keeps track + of interrupted display. Used in + info/session.c:info_numeric_arg_digit_loop (). - * lib/system.h (strcasecmp, strncasecmp) [!HAVE_STR[N]CASECMP]: - Declare these. + * info/session.c (info_global_next, info_global_prev): Use the numeric + argument passed to determine how many nodes to move. - * info/search.h (str[n]casecmp): Remove decl from here. + * info/session.c (info_scroll_forward, info_scroll_backward): If the + invoking key is not SPC or DEL only do Page Only scrolling. - * configure.in (AC_REPLACE_FUNCS): Check for strcasecmp and - strncasecmp here. - (AC_CHECK_FUNCS): Instead of just strcasecmp here. +Thu Dec 17 01:34:22 1992 Brian Fox (bfox@cubit) - * configure.in (texconfig): Use TEXMFMAIN in preference to TEXMF - for post-0.4 teTeX. + * info/display.c (display_update_one_window): Allow W_NoWrap to affect + window display. -Wed Apr 15 17:20:31 1998 Karl Berry <karl@cs.umb.edu> + * info/window.c (calculate_line_starts): Now takes a WINDOW * as an + argument, and simply does the calculation, placing the results + into window->line_starts and window->line_count. It also handles + W_NoWrap in window->flags. - * doc/texinfo.txi (Reporting Bugs): New section. - Suggestion from: Andrew Shapira <shapiraa@cs.rpi.edu> - Date: Mon, 4 Aug 1997 19:06:06 -0400 (EDT) +Mon Dec 14 02:18:55 1992 Brian Fox (bfox@cubit) - * info/infomap.c: Define / to be info_search. - Suggestion from: Egil Kvaleberg <egil@kvaleberg.no> - Date: Fri, 1 Aug 1997 08:16:45 +0200 (MET DST) + * info/session.c (info_backward_scroll): Don't try to get previous node + if the top of the node isn't currently being displayed. - * doc/texinfo.txi (uref): Document reason for not using <URL: format. - Also use ftp.gnu.org instead of ftp.gnu.ai.mit.edu throughout. + * info/window.c (window_adjust_pagetop) Use new variable + "window_scroll_step" to attempt to control the amount which the + window scrolls. -Tue Apr 14 10:43:39 1998 Karl Berry <karl@cs.umb.edu> + * info/m-x.c (info_variables) Add "scroll-step" to the list. - 1998-04-05 Karl Eichwalder <ke@suse.de> - * makeinfo/makeinfo.c (begin_insertion): No need to - gettext; it's a keyword. From carl-friedriech.spilcke-liss@ensae.fr. - (cm_printindex): ditto. +Thu Dec 10 08:52:10 1992 Brian Fox (bfox@cubit) - * util/texi2dvi: Always remove the $tmp_dir's. - From: Dean Gaudet <dgaudet@arctic.org> - Date: Tue, 14 Apr 1998 00:55:36 -0700 (PDT) + * info/m-x.c: New variable entry show-index-matches. When set to + non-zero the matched portion of the search string is indicated + with ` and '. Perhaps I should use `|' inst|ea|d? -Mon Apr 13 18:02:57 1998 Karl Berry <karl@cs.umb.edu> + * info/echo_area.c (ea_possible_completions): Always build completions + before checking to see how many there were. - * configure.in: Include - AM_SYS_POSIX_TERMIOS - AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL - to avoid window resizing being ignored under glibc2 systems, - e.g., Red Hat Linux 5.0. Actually any system where the ioctls are not - defined in <termios.h>. - See also http://www-gnats.gnu.org:8080/cgi-bin/wwwgnats.pl/full/206. - * acconfig.h (GWINSZ_IN_SYS_IOCTL): New #undef for autoheader. - * info/termdep.h [GWINSZ_IN_SYSIOCTL]: #include <sys/ioctl> if - this is defined. - From: Mark Jefferys <mjeffery@cse.ogi.edu> - Date: Thu, 9 Apr 1998 12:38:27 -0700 (PDT) + * info/info-utils.c: (info_concatenate_references): New utility + function concatenates references. -Fri Apr 3 01:18:22 1998 Philippe De Muyter <phdm@macqel.be> + * info/Makefile.in: Add indices.c and indices.h to SRCS and HDRS. + Add indices.c to CMDFILES. - * info/info.c (main): Use 0, not NULL, as ? : alternative. + * info/indices.c, info/indices.h: New file implements `i' and `,' + commands of info, and provides index searching capabilities. -Tue Mar 3 13:29:17 1998 Karl Berry <karl@cs.umb.edu> + * info/echo_area.c (info_read_completing_in_echo_area): Split off into + separate callable function info_read_completing_internal (). - * configure.in: Version 3.12. + * info/echo_area.c (info_read_maybe_completing): New function calls + info_read_completing_internal () with non-forcing argument. - * po/de.po: New version. + * info/session.c: Rename down_next_upnext_or_error () and + prev_up_or_error () to forward_move_node_structure (), and + backward_move_node_structure (). Implement new commands + info_global_next () and info_global_prev (). - * po/POTFILES.in: Do not include doc.c; that gets built at - runtime, thus causing texinfo.pot to try to get rebuilt. Besides, - it doesn't have any translatable strings. + * info/infomap.c (initialize_info_keymaps): Bind `[' and `]' to + backward_, forward_move_node_structure () respectively. -Sun Mar 1 10:38:47 1998 Karl Berry <karl@cs.umb.edu> + * info/session.c (info_menu_digit): Called with "0" as arg, select the + last menu item. - * util/install-info.c: No need for i18n on version message. From - ke@suse.de. + * info/infomap.c (initialize_info_keymaps): "0" calls + info_menu_digit (). -Fri Feb 27 16:06:23 1998 Karl Berry <karl@cs.umb.edu> + * info/session.c (info_move_to_xref): Take dir into account when there + are xrefs and menu items in the node and we are wrapping + backwards. - * configure.in: Run texconfig conf instead of confall. +Tue Dec 8 09:57:58 1992 Brian Fox (bfox@cubit) - * doc/Makefile.am (INSTALL_INFO): New variable. - (install-info-am): Use install-info from our distribution. + * info/info.c: Version 2.5 Beta. - * info/info.c (info_minor_version): Increment. - * (info_patch_level), - * info/info.h (info_patch_level): Remove. + * info/terminal.c (terminal_insert_lines, terminal_delete_lines) Do not + expect tgoto to return a new string; it returns the address of a + static buffer. - * info/info.c (program_name): Move decl. + * info/infodoc.c (info_find_or_create_help_window) Correct check for + prior existing help node. - * util/install-info.c (ensure_dirfile_exists): Use commas and \t - instead of an explicit tab, which make dist expands. + * info/m-x.c (set_variable): Allow variables to have a list of choices. + Add new variable scroll-behaviour. - * doc/texinfo.txi: @prep.ai.mit.edu -> @gnu.org. + * info/session.c (down_next_upnext_or_error, prev_up_or_error) New + functions implement user-controlled behaviour when attempting to + scroll past the bottom or top of a node. New variable + info_scroll_behaviour is user visible as "scroll-behaviour". - * info/info.c: Make help messages consistent with others. + * info/session.c (info_scroll_forward, info_scroll_backward) Call new + functions for user-controlled scroll behaviour. - * util/install-info.c (print_help): Format consistently. + * info/terminal.c (terminal_initialize_terminal) Set PC from BC not + from BUFFER. - (readfile): Support gzipped files via libz. - From: Elliot Lee <sopwith@redhat.com> - Date: Mon, 1 Sep 1997 23:37:14 -0400 (EDT) +Mon Dec 7 11:26:12 1992 Brian Fox (bfox@cubit) -Thu Feb 26 16:13:14 1998 Karl Berry <karl@cs.umb.edu> + * util/texindex.c: Change EXIT_SUCCESS and EXIT_FATAL to TI_NO_ERROR + and TI_FATAL_ERROR respectively. This avoids namespace conflicts + on NeXT 2.0. - * info/echo-area.c: Whoops, _ might not start with parens. +Sat Dec 5 00:07:59 1992 Brian Fox (bfox@cubit) - * configure.in: Check for libz. - Do not output emacs/Makefile. + * info/info.c: New option "--subnodes" says to recursively dump the + menus of the nodes that you wish to dump. Menu items which point + to external nodes are not dumped, and no node is dumped twice. - * Makefile.am (AUTOMAKE_OPTIONS): Set to 1.2f. +Thu Dec 3 16:11:02 1992 Brian Fox (bfox@cubit) - * util/texi2dvi: Always remove temporary directories. (From Akim.) - Formatting changes. + * info/session.c (info_error) Don't ring the bell if + info_error_rings_bell_p is zero. (info_abort_key) Ring the bell + if printing "Quit" in the echo area wouldn't do it. -Wed Feb 25 15:26:26 1998 Karl Berry <karl@cs.umb.edu> + * info/m-x.c (set_variable) New functions allows setting of + variables in the echo area. Currently, only visilble-bell and + errors-ring-bell are implemented. - * util/texi2dvi: New options --batch, --clean. - From: Akim Demaille <demaille@inf.enst.fr> - Date: 15 Aug 1997 18:05:33 +0200 - * doc/texinfo.txi (Format with texi2dvi): Mention --help. +Wed Dec 2 13:11:37 1992 Brian Fox (bfox@cubit) - Applied this: -1997-08-09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + * info/nodes.c, info/makedoc.c: If O_RDONLY is not defined by + sys/file.h, include sys/fcntl.h. - * makeinfo/makeinfo.c (me_executing_string): New variable. - (me_execute_string): Use it instead of executing_string. - (popfile): Check for me_executing_string as well as - executing_string. - (get_until_in_line): Likewise. - (insert_and_underscore): Do not write any expansion output if - executing a string. - (cm_node, cm_include, index_add_arg, cm_footnote, execute_macro, - cm_macro, cm_unmacro): Likewise. - (cm_footnote): Include the footnote marker in the expansion - output. - (append_to_expansion_output): Do nothing if the input_text wasn't - a remembered text. - (defun_internal): Make the index entry even if expanding macros. - (expansion): Don't reset macro_expansion_output_stream around call - to execute_string. - (apply): Fix typo. + * info/filesys.c (info_file_in_path): Expand leading tildes found + within directory names. -Tue Feb 24 17:33:44 1998 Karl Berry <karl@cs.umb.edu> + * info/terminal.c (terminal_initialize_terminal) Set ospeed to 13 if + not settable any other way. It is an index into an array of + output speeds. - 1997-11-10 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - * makeinfo/makeinfo.c (get_until_in_line): Don't use xstrdup on - the unterminated input_text. + * info/display.c (free_display) Do not free a NULL display. - * makeinfo/makeinfo.c: Don't assume all \'s in macro bodies are - arguments. - From: Mathias.Herberts@irisa.fr (Mathias Herberts) - Date: Tue, 6 Jan 1998 18:54:26 +0100 + * info/display.c (string_width): New functions returns the width of + STRING when printed at HPOS. - * configure.in: Check for sigblock in libc before libbsd. - * From: hjl@lucon.org (H.J. Lu) - * Date: Fri, 23 Jan 1998 21:50:25 -0800 (PST) +Sun Nov 29 01:24:42 1992 Brian Fox (bfox@cubit) -Mon Feb 23 16:26:31 1998 Karl Berry <karl@cs.umb.edu> + * info/info.c: New version 2.4 beta. - * info/window.c (character_width): If ISO_Latin_p is set, make - printable_limit 255, not 160. ISO Latin 1 uses - essentially all of the 256 characters. - Reported by: Marius Groeger <mag@sysgo.de> - Date: Wed, 17 Dec 1997 16:05:27 +0100 + * info/general.h: #define info_toupper and info_tolower which check + their arguments before performing any conversion. - * info/info.c: Improve help message. + * info/search.c, info/echo_area.c: Use info_toupper. -Sun Feb 22 17:38:32 1998 Karl Berry <karl@cs.umb.edu> +Sat Nov 28 14:23:24 1992 Brian Fox (bfox@cubit) - * Makefile.am (SUBDIRS): Remove emacs; we'll just distribute the - Elisp files with Emacs. + * info/session.c (info_scroll_forward, info_scroll_backward) If at + last/first page of the node, and the last command was + forward/backward, do info_next/prev/_node. - * doc/Makefile.am (info_TEXINFOS, texinfo): Rename manual to - texinfo.txi to avoid DOS filename clash with texinfo.tex. + * info/session.c: New function info_select_reference_this_line gets + menu or cross reference immediately. - * info/tilde.c: Copy slightly updated alloca stuff from makeinfo. + * info/infomap.c (initialize_info_keymaps): Add info_keymap[LFD] to + invoke info_select_reference_this_line (). - * util/texindex.c (main): Declare as returning int to placate - warnings. + * info/session.c (info_last_reference) Rename to + info_history_reference. Wrote info_last_reference, and + info_first_reference which go to the last or first node of an info + file. - * info/Makefile.am: Uncomment BUILT_SOURCES stuff and add missing _. - From: "Joel N. Weber II" <devnull@gnu.org> - Date: Fri, 30 Jan 1998 17:21:38 -1000 +Fri Nov 27 00:59:02 1992 Brian Fox (bfox@cubit) - * util/texindex.c, - * util/install-info.c, - * makeinfo/makeinfo.c, - * info/info.c: Change help address to @gnu.org. + * info/info.c: New version 2.3. Completed implementing contents of + TODO file. - 1998-01-22 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - * makeinfo/makeinfo.c (usage): Fix order of arguments to help - format string. + * info/session.c (info_redraw_display): Fix C-l with numeric arg. - * makeinfo/makeinfo.c (cm_top): Error message wording. +Thu Nov 26 20:14:18 1992 Brian Fox (bfox@cubit) - * doc/texinfo.texi (Functions in Typed Languages): Remove - duplicate description of @deftypemethod. - From: KHMarbaise@p69.ks.fido.de (Karl Heinz Marbaise) - Date: Wed, 07 Jan 1998 11:11:50 +0100 + * info/m-x.c: New file implements reading named commands in the echo + area, along with a new function "info-set-screen-height". + Compilation of this file and some code in others controlled by the + Makefile variable NAMED_COMMANDS (set to -DNAMED_COMMANDS). - * info/session.c (info_get_input_char) [EINTR]: Keep reading if we - get EINTR. - From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - Date: 22 Dec 1997 10:32:53 +0100 + * info/window.c (window_new_screen_size) Rewrite from scratch, allowing + clean growth and shrinkage of the screen. New variable + window_deletion_notifier is a pointer to a function to call when + the screen changes size, and some windows have to get deleted. + The function is called with the window to be deleted as an + argument, and it should clean up dangling references to that + window. -Sat Feb 21 17:41:26 1998 Karl Berry <karl@cs.umb.edu> + * info/session.c (initialize_info_session): Set + window_deletion_function to forget_window_and_nodes. - * makeinfo/makeinfo.c (find_and_load): Malloc enough room for the - null as well as the newline. - From: "John W. Eaton" <jwe@bevo.che.wisc.edu> - Date: Tue, 30 Sep 1997 21:12:01 -0500 + * info/display.c (display_update_one_window): If the first row of the + window to display wouldn't appear in the_screen, don't try to + display it. This happens when the screen has been made + unreasonably small, and we attempt to display the echo area. - * util/texindex.c (--version), - * makeinfo/makeinfo.c (cm_today), - * makeinfo/makeinfo.c (print_version_info): Version strings etc. do not - need translation. - From: Karl Eichwalder <ke@suse.de> - Date: 13 Sep 1997 16:20:02 +0200 +Tue Nov 24 00:47:20 1992 Brian Fox (bfox@cubit) - * info/echo-area.c: Rewrite pluralization to be translatable. - From: Karl Eichwalder <ke@suse.de> - Date: 13 Sep 1997 16:20:02 +0200 + * Release Info 2.2. - * util/texindex.c, - * info/info.c, - * makeinfo/makeinfo.c, - * util/install-info.c: --version: Give year as argument to printf, - to reduce the number of translations needed. - From: Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de> - Date: 02 Sep 1997 18:01:26 +0200 + * info/session.c: New functions implement reading typeahead and + implement C-g flushing typed ahead characters. + (info_search_internal): allows C-g to exit multi-file searches. - * util/texindex.c: Remove the fnctl.h and sys/file.h conditional #includes, they are - already in lib/system.h. - From: "Philippe De Muyter" <phdm@macqel.be> - Date: Thu, 21 Aug 1997 20:16:49 +0200 (MET DST) +Mon Nov 23 01:53:35 1992 Brian Fox (bfox@cubit) - * info/terminal.c (terminal_begin_using_terminal, - terminal_end_using_terminal): #ifdef SIGWINCH settings for - m68k-motorola-sysv. - From: "Philippe De Muyter" <phdm@macqel.be> - Date: Thu, 21 Aug 1997 20:16:49 +0200 (MET DST) + * info/nodes.c: Remove calls to sscanf (), replacing them with calls to + atol (), since that is much faster. + (get_nodes_of_tags_table) Only check for "(Indirect)" if we + haven't parsed any nodes out of the tags table. Increase the + amount that file_buffer->nodes grows to 100 from 50. These two + together sufficiently speed up the parsing process. - * info/filesys.c (info_suffixes): Add /index as a possibility for - subdirectories. - From: Matthew Wilcox <willy@odie.barnet.ac.uk> - Date: Wed, 6 Aug 1997 15:55:16 +0100 (BST) + * info/nodes.c: info_get_node_of_file_buffer_tags (), + info_get_node_of_file_buffer_nodes (): Search the appropriate list + and return a node. This was simply a cut and paste edit to + functionalize the code. - * configure.in: Redirect texconfig input from /dev/null to avoid - stoppage. - From: Thomas Esser <te@informatik.uni-hannover.de> - Date: Mon, 4 Aug 1997 18:15:49 +0200 + * info/TODO: Remove suggestion for partial tag parsing, since tag + parsing is much faster now. - * makeinfo/makeinfo.c (find_and_load): Null-terminate the input text. - From: Kenneth Stailey <kstailey@disclosure.com>. +Sat Nov 21 02:48:23 1992 Brian Fox (bfox@cubit) - * info/Makefile.am (INCLUDES): Add -I.. -I$(srcdir). + * info/makedoc.c: New File replaces makedoc.sh shell script. -Fri Aug 22 16:24:59 1997 Karl Berry <karl@cs.umb.edu> + * info/infomap.c: Install info_isearch (on C-s) and + info_reverse_isearch (on C-r) for Info windows. - * doc/texinfo.texi: Adjust ISBN, edition number for print run. + * info/session.c (incremental_search, info_isearch, + info_reverse_isearch) New functions implement incremental + searching. -Mon Aug 4 16:12:42 1997 Karl Berry <karl@cs.umb.edu> +Fri Nov 20 00:01:35 1992 Brian Fox (bfox@cubit) - * info/info.c (main) [INFODIR]: Add this to infopath, if set. - * info/Makefile.am (DEFS): New define, include -DINFODIR. - From: Larry Schwimmer <rosebud@cyclone.Stanford.EDU>. + * info/terminal.c (terminal_initialize_terminal): Declare and set up + `ospeed'. Turn off C-s and C-q processing. - * util/install-info.c (ensure_dirfile_exists): Use tabs instead of - spaces on the File: dir line. - Bug from: Dave Love <d.love@dl.ac.uk>. + * info/session.c (info_show_point) When this function is called, the + desired result is to show the point immediately. So now it calls + set_window_pagetop () if the new pagetop is not the same as the + old one. This means that info_prev_line (), info_next_line (), + info_forward_word (), and info_backward_word () can all scroll the + window if they have to. -Sat Aug 2 12:43:57 1997 Karl Berry <karl@cs.umb.edu> +Thu Nov 19 12:27:07 1992 Brian Fox (bfox@cubit) - * makeinfo/makeinfo.c (cm_value, cm_email, cm_uref): Have to cast - from unsigned char * to char * or IRIX cc complains. - From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>. + * info/session.c (set_window_pagetop): Add scrolling to make this + faster. -Fri Aug 1 14:05:10 1997 Karl Berry <karl@cs.umb.edu> + * info/echo_area.c (push/pop_echo_area): Remember the list of items to + complete over. - * Makefile.am (EXTRA_DIST): Remove README-alpha. - From: "ir. Mark M._Kettenis" <kettenis@phys.uva.nl>. + * info/session.c (info_forward_char): Don't let point get equal to + nodelen, only to nodelen - 1. -1997-07-31 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + * info/display.c: New function display_scroll_display () scrolls the + rmembered display as well as the text on the actual display. - * configure.in: Use AC_CHECK_HEADERS, not AC_CHECK_HEADER. + * info/terminal.c: New functions terminal_scroll_terminal (), + terminal_scroll_down (), and terminal_scroll_up (). All + implemented using "al" and "dl" termcap capabilities. (i.e., + insert and delete line). -Thu Jul 31 11:57:46 1997 Karl Berry <karl@cs.umb.edu> +Wed Nov 18 15:05:14 1992 Brian Fox (bfox@cubit) - * Version 3.11. + * info/termdep.h: Only define HAVE_FCNTL_H if !aix and !ultrix. - * info/man.c (reap_children): Declare status as int, not unsigned, - since that's what POSIX says the arg to wait should be. +Tue Nov 17 20:35:08 1992 Brian Fox (bfox@cubit) - * makeinfo/makeinfo.c (cm_uref, cm_email): Rewrite to do macro - expansion in the arguments. + * First Beta Release of Info 2.0. - * makeinfo/makeinfo.c (main): setlocale LC_MESSAGES and LC_TIME, - instead of LC_ALL. - From: Akim Demaille <demaille@inf.enst.fr>. +Sun Nov 1 02:21:05 1992 Noah Friedman (friedman@prep.ai.mit.edu) - * makeinfo/makeinfo.c (cm_today): Let the %d %s %d be translated, - so other languages can change the order of day/month/year. - From: Akim Demaille <demaille@inf.enst.fr>. + * util/texi2dvi (--force): Option removed. Always run tex at least + once, don't bother checking if .dvi file is newer than source. - * info/infomap.c: Doc fix. +Fri Oct 30 02:16:28 1992 Noah Friedman (friedman@prep.ai.mit.edu) - * lib/system.h [!O_RDONLY]: Prefer <fcntl.h> to <sys/fcntl.h>. + * util/texi2dvi (-D): debugging option renamed from '-d'. + Made check to enable debugging more terse. + When checking if index files have changed, use + variable $this_file instead of $file in for loop. + (file_texi): wherever the variable $file was used to reference + the texinfo file, substituted $file_texi. - * configure.in (AC_CHECK_HEADERS): Check for fcntl.h. +Sat Oct 17 07:30:34 1992 Brian J. Fox (bfox@helios) - * doc/Makefile.am (install-data-local): Suggest tex/generic/dvips - for epsf.tex. - From: Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>. + * util/texindex.c: Remove references to USG replacing them with a + define declaring the actual feature required or missing. - * configure.in (TEXMF): Move check to block with other program - checks. +Thu Oct 15 16:17:47 1992 Robert J. Chassell (bob@nutrimat.gnu.ai.mit.edu) -Wed Jul 30 11:20:37 1997 Karl Berry <karl@cs.umb.edu> + * emacs/texinfmt.el (texinfo-format-setfilename): Remove date from + Info file header so regression testing is easier. - * makeinfo/makeinfo.c (defun_internal): Allow extra text after - most @def... commands, for tzname[2] in libc.texinfo. +Tue Sep 15 16:28:35 1992 Robert J. Chassell (bob at grackle) - * info/info.c: Include indices.h. - * configure.in (AC_CHECK_HEADERS): Test for sys/wait.h, info/man.c - uses it. - From: Erick Branderhorst <Erick.Branderhorst@asml.nl>. + * emacs/texinfmt.el (texinfmt-version): New variable. + (texinfo-format-setfilename): Include date and + version in Info file header. + Better documentation for @definfoenclose + Handle whitespace after @end iftex, etc. -Tue Jul 29 15:55:19 1997 Karl Berry <karl@cs.umb.edu> +Thu Sep 3 09:25:37 1992 Robert J. Chassell (bob at grackle) - * configure.in: Version 3.9j. + * emacs/texnfo-upd.el: Fix typo re `texinfo-sequential-node-update.' - * info/terminal.c (output_character_function): Return int (the - arg), not void. +Tue Aug 18 08:56:24 1992 Robert J. Chassell (bob at grackle) - * info/infomap.c: Don't define term_kP as 'v', since that's undefined. - From: Tom Hageman <tom@basil.icce.rug.nl>. + * emacs/texinfmt.el (texinfo-value): Revise syntax. - * makeinfo/makeinfo.c: Parameterize some messages to avoid - duplicate translations. + * emacs/texnfo-upd.el (texinfo-start-menu-description): + New function to insert title as description in a menu. + (texinfo-make-menu-list): Remove automatic title insertion. - * info/terminal.c: Only try to declare ospeed, PC, tputs, etc. if - we don't have <ncurses.h/termcap.h> or <termcap.h>. + * emacs/texinfo.el (texinfo-mode-map): Add keybinding for + texinfo-start-menu-description. - * makeinfo/makeinfo.c (cm_email): New function, like cm_uref. +Wed Jul 29 11:58:53 1992 Robert J. Chassell (bob at grackle) -Sun Jul 27 17:09:20 1997 Karl Berry <karl@cs.umb.edu> + * emacs/texinfmt.el (texinfo-set): Revise to set a string to the flag. + (texinfo-value): @value{flag}: New command which inserts the + string to which the flag is set. - * configure.in: Only check for <ncurses/termcap.h> if we're using - -lncurses. - From: Bo Johansson <bo.johansson@mbox2.swipnet.se>. +Tue Jul 7 15:10:52 1992 Robert J. Chassell (bob at grackle) - * info/dir.c (new_dir_file_p): Avoid automatic struct - initialization, SunOS 4 etc. cc can't handle it. - From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>. + * emacs/texnfo-upd.el (texinfo-master-menu): Error message if file + contains too few nodes for a master menu. + (texinfo-insert-master-menu-list): Only attempt to insert detailed + master menu if there is one. -Sat Jul 26 15:08:13 1997 Karl Berry <karl@cs.umb.edu> +Wed Jun 10 15:26:18 1992 Robert J. Chassell (bob at grackle) - * Version 3.9i. + * emacs/texinfmt.el (texinfo-append-refill): Refill properly when lines + begin with within-paragraph @-commands. - * configure.in: Check for termcap.h and ncurses/termcap.h. - From: bo.johansson@mbox2.swipnet.se. +Tue Jun 9 12:28:11 1992 Robert J. Chassell (bob at grackle) -Fri Jul 25 14:09:05 1997 Karl Berry <karl@cs.umb.edu> + * emacs/texinfmt.el: Add `texinfo-deffn-formatting-property' and + `texinfo-defun-indexing-property' to @deffn commands. - * doc/texinfo.texi: Document new second optional arg to email. +Mon Jun 8 11:52:01 1992 Robert J. Chassell (bob at grackle) - * info/infodoc.c: Document CTRL-x 0 as the way to get out of help. + * emacs/texnfo-upd.el: Replace `(mark-whole-buffer)' with + `(push-mark (point-max) t) (goto-char (point-min))' + to avoid `Mark set' messages. - * info/dir.c (maybe_build_dir_node): Really check for the same dir - file twice, not just by name. - (new_dir_file_p): New function. +Fri Jun 5 15:15:16 1992 Robert J. Chassell (bob@kropotkin.gnu.ai.mit.edu) - * util/install-info.c: Tell them about --help in doc strings. + * emacs/texnfo-upd.el (texinfo-check-for-node-name): Offer section + title as prompt. + (texinfo-copy-next-section-title): Copy title correctly. -Thu Jul 24 14:25:44 1997 Karl Berry <karl@cs.umb.edu> +Thu May 28 20:34:17 1992 Robert J. Chassell (bob@hill.gnu.ai.mit.edu) - * util/texindex.c (memory_error): Move to avoid incorrect implicit - decl. + * emacs/texinfmt.el: @vtable defined, parallel to @ftable, for + variables. + (texinfo-append-refill): set case-fold-search nil so @TeX is not + confused with @tex. - * makeinfo/makeinfo.c, - * makeinfo/multi.c, - * util/install-info.c, - * util/texindex.c, - * info/tilde.c, - * info/man.c, - * info/gc.c, - * info/session.c (info_replace_key_to_typeahead): Remove unused - function, - * info/nodemenu.c, - * info/man.c, - * info/m-x.c, - * info/footnotes.c - * info/info.c - * info/indices.c, - * info/filesys.c: Parenthesize to avoid -Wall warnings - remove unused variables, - make return types explicit, - printf type corrections. +Thu Mar 26 21:36:41 1992 Robert J. Chassell (bob@kropotkin.gnu.ai.mit.edu) - * lib/system.h: <ctype.h>: Include this. - * util/texindex.c, - * makeinfo/makeinfo.c, - * info/echo-area.c, - * info/display.c: ctype.h: Included in system.h now. + * emacs/makeinfo.el: Rename temp buffer from `*Makeinfo*' back to + `*compilation*' so `next-error' works; unfortunately, + `*compilation*' is written into the code as the name + `next-error' needs. + Rename `makeinfo-recenter-makeinfo-buffer' back to + `makeinfo-recenter-makeinfo-buffer' - * info/echo-area.c: Parenthesize to avoid -Wall warnings. - (ctype.h): #include for isprint. - (echo_area_stack_depth): Remove unused function. - * info/display.c: Parenthesize to avoid -Wall warnings. - (ctype.h): #include for isprint. - * info/dir.c: Parenthesize to avoid -Wall warnings. - (build_dir_node_internal): Remove declaration of nonexistent function. - From: Erick Branderhorst <Erick.Branderhorst@asml.nl>. +Thu May 14 21:14:25 1992 Noah Friedman (friedman@prep.ai.mit.edu) - * configure.in (TEXMF): Call texconfig to discover the default value, - for the sake of the warning in doc/Makefile. - From: Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>. + * util/fixfonts: Enclosed most variable references with "" to prevent + potential globbing and other weirdness. Eliminated uses of + ${var-value}, which unfortunately isn't portable. - * doc/Makefile.am (TEXMF): New variable. - (install-data-local): Use it in warning. - From: Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>. + * util/texi2dvi: rewritten from scratch. - * info/session.c (initialize_info_session): Only call - terminal_prep_terminal if clear_screen is true. Otherwise, failed - --index-searches prep the terminal but do not unprep it. - From: William Edward Webber <wew@yallara.cs.rmit.EDU.AU>. +Sat Apr 18 23:46:25 1992 Charles Hannum (mycroft@hal.gnu.ai.mit.edu) - * info/nodemenu.c: Doc fix. + * util/fixfonts: Re-evaluate prefix and libdir if inherited (to resolve + variable references from make). + (texlibdir): Don't add '/tex', since it's already there. -Mon Jul 21 17:11:09 1997 Karl Berry <karl@cs.umb.edu> +Fri Apr 10 14:51:23 1992 Noah Friedman (friedman@prep.ai.mit.edu) - * doc/texinfo.texi: Comment out @smallbook and @set smallbook so - people at other sites can print it the way they want. - From: Thomas Walter <walter@pctc.chemie.uni-erlangen.de> + * util/fixfonts: set prefix and libdir only if they are not already + defined (i.e. not inherited from the environment). + Changed default path for libdir to be consistent with Makefile. -Sun Jul 20 07:52:25 1997 Karl Berry <karl@cs.umb.edu> +Tue Mar 3 13:17:42 1992 Robert J. Chassell (bob at grackle) - * configure.in: 3.9h. + * emacs/texnfo-upd.el (texinfo-insert-master-menu-list): Insert a + master menu only after `Top' node and before next node. + (texinfo-copy-menu): Error message if menu empty. - * doc/Makefile.am (install-info-am, distclean-aminfo): New targets - to avoid assuming info files are in srcdir. +Mon Feb 24 15:47:49 1992 Robert J. Chassell (bob at grackle) - * lib/system.h (xstrdup): Returns char *, not void *. + * emacs/texinfmt.el (texinfo-format-region): Make sure region ends in a + newline. + (texinfo-itemize-item): Recognize all non-whitespace on same line + as @item command. - * doc/Makefile.am (.texi.info), - * doc/Makefile.am (texinfo): Don't run in $(srcdir). +Sat Feb 22 02:15:00 1992 Brian Fox (bfox at gnuwest.fsf.org) - * util/install-info.c (main): Remove unnecessary decl of strrchr. + * util/texindex.c: New version 1.45 has cleanups, should compile under + VMS quietly. - * info/tilde.c: Include info.h (for config.h) before alloca stuff. +Wed Feb 12 10:50:51 1992 Robert J. Chassell (bob at grackle) - * makeinfo/makeinfo.c (validate_file): Rename `valid' to `valid_p' - to avoid conflict with SunOS 4 header files. - From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>. + * emacs/makeinfo.el: Rename temp buffer as *Makeinfo*. + Rename `makeinfo-recenter-compilation-buffer'. + (makeinfo-buffer): Offer to save buffer if it is modified. + (makeinfo-compile): Do not offer to save other buffers. + (makeinfo-compilation-sentinel): Switch to Info file. - * info/session.c (initialize_info_session): Call - terminal_prep_terminal here (before calling terminal_clear_screen). - (info_session): Instead of here. - From: William Edward Webber <wew@yallara.cs.rmit.EDU.AU>. +Tue Feb 4 13:07:39 1992 Robert J. Chassell (bob at grackle) - * Makefile.am (EXTRA_DIST): Add README-alpha. + * emacs/texinfmt.el (texinfo-print-index): Format so that node names in + the index are lined up. -Sat Jul 19 13:50:27 1997 Karl Berry <karl@cs.umb.edu> +Mon Feb 3 09:08:14 1992 Robert J. Chassell (bob at grackle) - * info/terminal.c: Use `keypad transmit' sequence if it's defined: - (term_keypad_on, term_keypad_off): New statics. - (terminal_begin_using_terminal): If term_keypad_on, send it. - (terminal_end_using_terminal): If term_keypad_off, send it. - (terminal_initialize_terminal): Look up ks and ke termcap strings. - From: William Edward Webber <wew@yallara.cs.rmit.EDU.AU>. + * emacs/texinfmt.el (texinfo-itemize-item): Format entry when text + is on the same line as @item command. Also, handle @-commands. + (texinfo-format-region, texinfo-format-buffer-1): Set fill column + to local value of Texinfo buffer. - * info/infomap.c (initialize_info_keymaps): Initialize hardwired - cases for arrow keys a la readline. Found by John Eaton, - jwe@bevo.che.wisc.edu. + * emacs/texnfo-upd.el (texinfo-pointer-name): Find only those + section commands that are accompanied by `@node' lines. - * makeinfo/makeinfo.c (output_pending_notes): Remove footnote - macro expansion code I #if 0'd out some time ago. And doc fixes. +Tue Jan 14 16:10:16 1992 Robert J. Chassell (bob at grackle) - * Applied this patch: + * emacs/texnfo-upd.el: Ensure that no commands depend on the value of + case-fold-search. -Sat Jul 19 16:29:01 1997 Karl Eichwalder <ke@suse.de> +Fri Jan 10 15:13:55 1992 Robert J. Chassell (bob at kropotkin) - * info/info.c (main): setlocale, bindtextdomain, and textdomain. + * emacs/texinfmt.el (texinfo-append-refill): Replace use of + unsupported function `looking-at-backward' with + `re-search-backward'. -Fri Jul 18 10:02:18 1997 Karl Berry <karl@cs.umb.edu> +Mon Dec 23 23:46:42 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) - * doc/Makefile.am (install-data-local), - * emacs/Makefile.am (install-data-local): Give subdir in warning. + * util/texindex.c: Change POSIX ifdefs to HAVE_UNISTD_H and + _POSIX_VERSION. - * configure.in: Version 3.9f. +Mon Dec 16 15:01:36 1991 Robert J. Chassell (bob at grackle) - * doc/texinfo.texi: Correct \^ to @^. - From Andreas S. + * emacs/texinfmt.el (texinfo-append-refill): New function appends + @refill to all appropriate paragraphs so you no longer need to + append @refill command yourself. + (texinfo-format-region, texinfo-format-buffer-1, + texinfo-format-include): Call `texinfo-append-refill'. - * Merged these changes: +Fri Dec 6 01:25:09 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) -1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + * util/texindex.c: Conditionalize on _AIX (which is predefined) instead + of AIX, just like makeinfo does. - * info/display.c (display_cursor_at_point): Flush ouput. +Tue Nov 26 10:21:04 1991 Robert J. Chassell (bob at grackle) -1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + * emacs/texnfo-upd.el (texinfo-section-types-regexp): `@subtitle' no + longer treated as subsection. - * info/session.c (remember_window_and_node): Don't crash when the - current window has no current node. +Sat Nov 16 08:27:42 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) -1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + * util/fixfonts: New file, from Karl Berry. - * util/texindex.c (usage): Translate the doc strings. - * makeinfo/makeinfo.c (cm_today): Translate the month names. - * info/variables.c (describe_variable): Translate the doc strings. - * info/nodes.h: Don't translate the strings defining the info format. +Tue Nov 12 16:13:24 1991 Robert J. Chassell (bob at grackle) -1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + * emacs/texinfmt.el: Create @end smalllisp. - * makeinfo/makeinfo.c (get_item_function): Remove superfluous call - to canon_white after get_rest_of_line. - (cm_end): Likewise. - (handle_variable): Likewise. - (cm_item): Likewise. - (cm_unmacro): Likewise. +Mon Nov 11 16:50:13 1991 Robert J. Chassell (bob at grackle) -1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + * emacs/texinfo.el (texinfo-environment-regexp): Add all other block + enclosing Texinfo commands. - * info/nodemenu.c (list_visited_nodes): Don't clear the internal - flag, this and other functions depend on it. Don't insist on - displaying the menu below the current window. +Thu Nov 7 10:23:51 1991 Robert J. Chassell (bob at grackle) -1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + * emacs/texinfo.el (texinfo-insert-@end): Attempt to insert correct end + command statement, eg, @end table. Fails with nested lists. + (texinfo-insert-*): Accept prefix arg to surround following N + words with braces for command. - * makeinfo/makeinfo.c (cm_uref): Fix memory leaks. - (cm_inforef): Likewise. Handle empty cross reference name. +Thu Oct 31 21:31:41 1991 Robert J. Chassell (bob at kropotki) -1997-07-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + * emacs/texinfmt.el (texinfo-clear): Clear flag even if flag not + previously set. - * info/echo-area.c (ea_possible_completions): Check that the - current window can actually be split. +Wed Oct 23 11:15:58 1991 Robert J. Chassell (bob at grackle) -Thu Jul 17 17:19:34 1997 Karl Berry <karl@cs.umb.edu> + * emacs/texinfo.el (texinfo-mode): page-delimiter now finds top node as + well as chapters. +Tue Oct 22 11:46:12 1991 Robert J. Chassell (bob at grackle) - * emacs/Makefile.am (*clean-lisp): Define, as Automake didn't. - From: Kenneth Stailey <kstailey@disclosure.com>. + * emacs/texinfmt.el (texinfo-do-flushright): Test whether a line is too + long for the flush right command (line length must be less than + the value of fill column). - * doc/Makefile.am: Do not distribute info.1. - * makeinfo/macros: Do not distribute this directory, it's merged - into the main documentation. - * doc/makeinfo.texi: Don't distribute this either, it's in the - main manual. + * emacs/texnfo-tex.el (texinfo-tex-buffer): Prompt for original file + even if point moved to *texinfo-tex-shell*. + texinfo-tex-original-file: variable to hold file name. - * util/install-info.c: Use \n\ for multiline string constant. - From: Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>. +Wed Oct 16 08:32:05 1991 Robert J. Chassell (bob at grackle) -Wed Jul 16 15:29:50 1997 Karl Berry <karl@cs.umb.edu> + * emacs/texinfmt.el (texinfo-format-center): Expand string before + centering so @-commands not included. - * doc/texinfo.texi: @set must be after @setfilename, I guess. - Noted by Erick Branderhorst. +Thu Oct 10 22:01:47 1991 Robert J. Chassell (bob at kropotki) - * Applied this change: + * emacs/texnfo-tex.el (texinfo-show-tex-print-queue): Do not kill a + running process; do start a process none exists. -Tue Nov 12 22:20:22 1996 John Eaton <jwe@bevo.che.wisc.edu> +Thu Sep 26 21:58:47 1991 Robert J. Chassell (bob at kropotki) - * makeinfo.c (INDEX_ALIST): Use two indices, read_index and - write_index, instead of just one. - (find_index_offset): If a match is found, return index to the - current INDEX_ALIST struct, not the index pointing to the list of - index entries. - (translate_index): Return read_index from the matching - INDEX_ALIST. - (undefindex): Delete the list of index elements pointed to by - read_index from the INDEX_ALIST that matches name. - (defindex): Initialize read_index and write_index. - (index_add_arg): Add entries to the list pointed to by write_index - from the INDEX_ALIST matching name. - (index_append): Delete unused function. - (cm_synindex): Don't merge indcies, just make the write_index for - redirectee the same as the write_index for redirector. + * util/texi2dvi: Misc. bugs fixed. -Tue Jul 15 09:32:04 1997 Karl Berry <karl@cs.umb.edu> + * emacs/texinfo.el: Remove extraneous references to TeX. - * doc/texinfo.texi: Bump edition number for 2.24. +Thu Sep 19 20:45:29 1991 Robert J. Chassell (bob at kropotki) - * util/Makefile.am (localedir): Define. + * emacs/texinfmt.el: add @cartouche as a noop (makes box with rounded + corners in TeX) - * info/window.h: Rename __window__ to window_struct. +Tue Sep 10 20:44:57 1991 Robert J. Chassell (bob at grackle) - * info/window.h, - * info/variables.h, - * info/search.h, - * info/man.h, - * info/info-utils.h, - * info/gc.h, - * info/footnotes.h, - * info/filesys.h, - * info/echo-area.h, - * info/display.h: Avoid leading _ in #define for #include protection. + * emacs/texnfo-upd.el (texinfo-make-one-menu): Copy node-name correctly + for message. - * makeinfo/makeinfo.c: Version 1.68. - * info/info.c: Version 2.17. +Thu Aug 29 17:54:07 1991 Robert J. Chassell (bob at kropotki) - * Most all files: Untabify. + * emacs/texnfo-tex.el (texinfo-quit-tex-job): Do not set mark. - * doc/Makefile.am (texinfo): Add explicit target. +Wed Aug 21 10:36:21 1991 Robert J. Chassell (bob at grackle) - * emacs/Makefile.am (noinst_LISP): Remove the obsolete - detexinfo.el (makeinfo --no-headers is better) and - texnfo-tex.el (now handled by TeX modes in general). + * emacs/texnfo-upd.el: (texinfo-copy-menu-title): Copy title as it + should rather than node line. -Mon Jul 14 15:21:03 1997 Karl Berry <karl@cs.umb.edu> +Mon Aug 5 15:27:12 1991 Robert J. Chassell (bob at grackle) - * util/texi2dvi: Update RCS file from 3.9 distribution. + * emacs/texinfmt.el (texinfo-format-convert): Changed regexp that + looks for three hyphens in a row to find those between word + constituent characters, as now, for Oxford Univ. style dashes and + also between spaces, for Cambridge Univ. Press style dashes. - * util/Makefile.am (EXTRA_DIST): Add update-info, from - rhawes@dmapub.dma.org + * emacs/texnfo-tex.el (texinfo-tex-start-shell): Runs "/bin/sh" so + `explicit-shell-file-name' is not set globally. -Sun Jul 13 17:05:03 1997 Karl Berry <karl@cs.umb.edu> + * emacs/texnfo-upd.el: Rewrite messages. + (texinfo-find-higher-level-node): Stop search at limit. + (texinfo-copy-menu-title): Rewrite to handle outer include files. + (texinfo-multi-file-update): Update all nodes properly; + rewrite doc string and interactive. - * info/signals.c: Use RETSIGTYPE instead of hardwiring void. - From: "Jeffery L. JT Vogt" <lfm@atw.earthreach.com>. +Sat Aug 3 10:46:13 1991 Robert J. Chassell (bob at grackle) - * info/session.c (info_history_node): Rewrite as - info_kill_node (current_node). - (kill_node, read_nodename_to_kill): New functions from info_kill_node. - (info_kill_node): Now this just calls them. + * emacs/texnfo-upd.el (texinfo-all-menus-update): Fixed typo that + caused the function to create a master menu when it shouldn't. -Fri Jul 11 11:56:58 1997 Karl Berry <karl@cs.umb.edu> + * emacs/texinfo.el (texinfo-mode): Make `indent-tabs-mode' a local + variable and set to nil to prevent TABs troubles with TeX. - * doc/texinfo.texi: Fix `Conditionals' xref. +Wed Jul 31 11:07:08 1991 Robert J. Chassell (bob at grackle) -Thu Jul 10 17:58:12 1997 Karl Berry <karl@cs.umb.edu> + * emacs/texnfo-tex.el (texinfo-quit-tex-job): New function: quit + currently running TeX job, by sending an `x' to it. + (texinfo-tex-shell-sentinel): New function to + restart texinfo-tex-shell after it is killed. + (texinfo-kill-tex-job): Rewrite to use kill-process rather than + quit-process; uses `texinfo-tex-shell-sentinel' to restart + texinfo-tex-shell after it is killed. + (texinfo-tex-region, texinfo-tex-buffer): Replace + texinfo-kill-tex-job with quit-process. - * doc/info.texi: Don't say SPC clears ? screen. + * emacs/texinfo.el (texinfo-define-common-keys): Add keybinding for + texinfo-quit-tex-job -Sun Jul 6 16:26:41 1997 Karl Berry <karl@cs.umb.edu> +Wed Jul 10 15:15:03 1991 Robert J. Chassell (bob at grackle) - * doc/info-stnd.texi: Document --index-search. + * emacs/texinfmt.el: New commands @set, @clear, @ifset...@end + ifset, and @ifclear...@end ifclear. + Definition functions rewritten to make them easier to + maintain. - * info/tilde.c, - * info/session.c: Remove redundant getenv decl. +Wed Jul 3 19:37:04 1991 Robert J. Chassell (bob at kropotki) - * Installed following change: -Tue Nov 12 14:44:00 1996 John W. Eaton <jwe@bevo.che.wisc.edu> + * emacs/texinfmt.el (texinfo-format-deftypefn-index): Remove reference + to data-type to make consistent with texinfo.tex and makeinfo. + texinfo.el: Fix page-delimiter and texinfo-chapter-level-regexp + variables. - * info/info.c (main): Handle new option, --index-search STRING. - (index_search_p, index_search_string): New static variables, used - to handle --index-search option. +Thu Jun 27 18:35:36 1991 Robert J. Chassell (bob at nutrimat) - * info/session.c (initialize_info_session): New arg, - clear_screen. Change all callers. + * emacs/texinfmt.el: Add @dmn as `texinfo-format-noop'. + texinfo2.texi: Document @dmn. + texinfmt.el (texinfo{,-end}-{eleterate,ecapitate} renamed + {alphaenumerate, capsenumerate}. - * info/indices.h (do_info_index_search, index_intry_exists): - Provide declarations here. +Fri Jun 14 12:46:32 1991 Robert J. Chassell (bob at churchy.gnu.ai.mit.edu) - * info/indices.c (do_info_index_search): New function, extracted - from info_index_search. - (info_index_search): Simply call do_info_index_search() with - search_string set to NULL. - (index_entry_exists): New function. + * emacs/texinfmt.el (texinfo-format-defun-1): @defivar prints name + correctly. -Sat Jul 5 17:17:14 1997 Karl Berry <karl@cs.umb.edu> +Thu Jun 6 21:38:33 1991 Robert J. Chassell (bob at churchy.gnu.ai.mit.edu) - * doc/texinfo.texi: Document @kbdinputstyle. + * emacs/texinfo.el (texinfo-mode): Set page delimiter to + 'texinfo-chapter-level-regexp' so that page commands work by + chapter or equivalent. - * makeinfo/makeinfo.c (kbdinputstyle): New command. - (cm_no_op_line_arg): New function. + * emacs/texinfmt.el (texinfo-format-defun-1): @defop prints name + correctly. + (batch-texinfo-format): replace unsupported + 'buffer-disable-undo' with 'buffer-flush-undo' - * info/termdep.h (HAVE_TERMIOS_H) [NeXT]: #undef. - From: Gregor Hoffleit <flight@mathi.uni-heidelberg.de> et al. +Fri Apr 5 15:17:17 1991 Robert J. Chassell (bob at wookumz.gnu.ai.mit.edu) -Fri Jul 4 14:18:08 1997 Karl Berry <karl@cs.umb.edu> + * emacs/makeinfo.el (makeinfo-compilation-sentinel): Check for + existance of makeinfo-temp-file to avoid harmless error message. + texinfo2.texi: Minor typos fixed. - * info/Makefile.am (EXTRA_DIST), - * util/Makefile.am (EXTRA_DIST), - * makeinfo/Makefile.am (EXTRA_DIST), - * lib/Makefile.am (EXTRA_DIST): Include README. +Thu Mar 28 19:13:24 1991 Robert J. Chassell (bob at pogo.gnu.ai.mit.edu) - * doc/texinfo.texi (makeinfo options): Document --paragraph-indent - values more completely. - * makeinfo/makeinfo.c (set_paragraph_indent): Allow translated - asis or none, improve doc. - From ke. + * util/texi2dvi: Revised. - * doc/Makefile.am (dist-info): New empty target so that we do not - distribute info files. - From Erick Branderhorst. +Mon Mar 11 12:35:51 1991 Robert J. Chassell (bob at grackle) - * doc/texinfo.texi (Invoking install-info): Document that the dir - file is created now if need be. - * Makefile.am (EXTRA_DIST): No longer need dir. - * util/install-info.c (ensure_dirfile_exists): New routine. - (main): Call it before trying to open dirfile for reading. + * emacs/texinfmt.el: (@footnotestyle): New command to set + footnotestyle. + (@paragraphindent): New command to set indentation. + (texinfo-format-refill): Add indentation feature so as to + indent paragraph or leave indentation asis before refilling + according to value set by @paragraphindent command. + (texinfo-format-region): Insert header, if any, into Info buffer. + (texinfo-format-separate-node, texinfo-format-end-node): Run + texinfo-format-scan on footnote text only once. + (texinfo-format-scan): Shorten `---' to `--'. - * doc/texinfo.texi: Document install-info --delete a little better. - * util/install-info.c: Set something_deleted when we delete a - normal line. - Bug from: Denis Kosygin <dkosygin@math.Princeton.EDU>. + * emacs/texinfo.el: Define key for `texinfo-master-menu'; define + start and end of header expressions. - * util/install-info.c: If no info dir entry, give warning and exit 0. + * emacs/texnfo-upd.el (texinfo-all-menus-update): Update + pre-existing master menu, if there is one. -Wed Jul 2 06:35:17 1997 Karl Berry <karl@cs.umb.edu> +Fri May 11 14:36:07 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - * configure.in (ALL_LINGUAS): Add fr. + * util/texindex.c: Rename `lines' to `nlines'. + (bzero): Pass arg to lib$movc5 through non-register var. + (perror_with_file, pfatal_with_file): Move extern decls and includes + to top of file. + [VMS]: If not using VMS C, define away `noshare' keyword. + Include perror.h. - * makeinfo/makeinfo.h (insertion_type, insertion_type_names): Add - ifnot... entries. Alphabetize. +Mon Jul 11 18:02:29 1988 Chris Hanson (cph at kleph) -Tue Jul 1 17:21:54 1997 Karl Berry <karl@cs.umb.edu> + * util/texindex.c (indexify): when comparing to initial strings to + decide whether to change the header, must use `strncmp' to avoid + comparing entire strings of which initials are a substring. - * makeinfo/makeinfo.c (sort_index): Set defining_line and - input_filename so errors in index entries are reported at - the correct location. From rms. +Sun Jun 26 18:46:16 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - * makeinfo/makeinfo.c (cm_ifnothtml, etc.): Routines for new - commands. + * util/texindex.c (sort_in_core, sort_offline, parsefile): + Give up on input file if any line doesn't start with backslash. + +/* changelog for texinfo.tex before 19jun01. */ -Sun Jun 29 09:44:01 1997 Karl Berry <karl@cs.umb.edu> +2001-05-24 <karl@gnu.org> - * doc/texinfo.texi: Document new @ifnot... commands, etc. - * doc/texinfo.texi: Document @image, etc. + * texinfo.tex (\smallbreak, \medbreak, \bigbreak): add check for + \ifnum\lastpenalty to plain tex definitions, so that we won't + insert space right after a section title. + (\aboveenvbreak): similar check of \lastpenalty. -Thu Jun 26 17:57:37 1997 Karl Berry <karl@cs.umb.edu> +2001-05-21 <karl@gnu.org> - * makeinfo/makeinfo.c (cm_image): New routine for new command @image. - (cm_end): Move to better place, doesn't need its own page. - Doc fixes. + * texinfo.tex (\pdfurl): \let\value=\expandablevalue, so at least + some cases can be properly handled. -Mon Jun 23 16:54:03 1997 Karl Berry <karl@cs.umb.edu> +2001-03-28 <karl@gnu.org> - * Makefile.am (SUBDIRS): Do intl first. + * texinfo.tex: Copyright. - * doc/Makefile.am (EXTRA_DIST): Include epsf.tex. - (install-data-local): Suggest possible installation directory. - * epsf.tex: New file. + * texinfo.tex (\pdfmkdest): remove trailing @ in target names; + suggestion from: Reiner Schlotte <R.Schlotte@science-computing.de>. + (\imagexxx): call \normalturnoffactive so _ (among others) will be + allowed in filenames; report from arnold@skeeve.com. -Wed Jun 18 17:51:52 1997 Karl Berry <karl@cs.umb.edu> +2001-02-02 <karl@gnu.org> - * doc/texinfo.texi: Document texinfo.cnf. + * texinfo.tex (\secondary): handle pdf case. + (\dosubind): secondary index entry not written as separate arg for + texindex. + From: Trevin Beattie <trevin@eyring.com> + Date: Tue, 21 Mar 2000 13:04:06 -0700 -Sun Jun 15 14:37:58 1997 Karl Berry <karl@cs.umb.edu> +2001-01-12 <karl@gnu.org> - * doc/texinfo.texi (Command List): Various commands missing or - erroneous. - From: Karl_Heinz_Marbaise@p69.ks.fido.de. + * texinfo.tex (\dopdfimage): different syntax for filename + inclusion (foo vs {foo}). From: <Kurt.Hornik@ci.tuwien.ac.at>, + 22dec99. - * makeinfo/makeinfo.c: Oops, failed to break out of loop. +2001-01-08 <karl@gnu.org> - * util/texindex.c: Use <getopt.h> not "getopt.h". + * texinfo.tex (\afivepaper): new command from Jose Romildo + Malaquias <romildo@urano.iceb.ufop.br>. - * All source files: Merge gettext changes from Karl E.; - his ChangeLog entries below. +2000-12-12 <karl@gnu.org> -Sat Jun 14 17:04:28 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex: oops, had outside page reversed. - * Makefile.am, - * makeinfo/Makefile.am: Doc fix. - * util/Makefile.am (EXTRA_DIST): Add texi2dvi. From Karl E. +2000-12-11 <karl@gnu.org> -Fri Jun 13 17:39:34 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\inmargin): allow lefttext and righttext as args. - * makeinfo/makeinfo.c [WIN32]: Handle read bogosity and c:\ - absolute paths. - From: Eric Hanchrow <erich@MICROSOFT.com>. +2000-11-10 <karl@gnu.org> - * configure.in (AC_CHECK_HEADERS): Check for pwd.h. - * info/tilde.c (pwd.h): Move #include to system.h. + * texinfo.tex: implementation of new commands @verbatim, @verb, + and @verbatiminclude from janneke@gnu.org. - * makeinfo/makeinfo.c (main): New option -P to prepend to search path. - From: Kenneth Stailey <kstailey@cvs.openbsd.org>. +2000-11-09 <karl@gnu.org> - * doc/texinfo.texi (Invoking makeinfo), - * doc/makeinfo.texi: Mention -P. + * texinfo.tex (\inmargin): rewrite to allow for placing the + material either in the right or left margin. -Thu Jun 12 16:25:40 1997 Karl Berry <karl@cs.umb.edu> +2000-10-27 <karl@gnu.org> - * info/signals.h (SIGCHLD): #define as SIGCLD if undefined, for sysV68. - From: "Philippe De Muyter" <phdm%labauto1@ulb.ac.be>. + * texinfo.tex (\dosynindex): new macro subroutine, do not + \closeout twice the index being redirected. + (\synindex, \syncodeindex): call it. - * util/install-info.c (O_RDONLY): Remove this stuff, it's in system.h. - (main): Handle existing entry in dir file having .info extension. - From: "Bradley C. Kuszmaul" <bradley@GRANITE.SYSTEMSX.CS.YALE.EDU>. +2000-10-18 <karl@gnu.org> - * makeinfo/makeinfo.c (get_char_len): Don't count 8-bit characters - as two chars in the output. - From: Sung-Hyun Nam <namsh@amuna.rms.lgic.co.kr>. + * texinfo.tex (\inmargin): rewrite to allow argument to be vmode + material, such as a box from an image. -Wed Jun 11 16:36:51 1997 Karl Berry <karl@cs.umb.edu> +2000-09-06 <karl@gnu.org> - * doc/texinfo.texi (Other Info Directories): Document new trailing - : in INFOPATH feature. + * texinfo.tex (\doublecolumnout): must subtract \ht\partialpage + here, not in \begindoublecolumns. Otherwise the \partialpage on + the first page of double columns affects every subsequent page, + e.g., if @setchapternewpage off. Reported by Aharon Robbins + <arnold@skeeve.com> for standards.texi. - * info/info.c (main): Have trailing : in INFOPATH expand to the - default path. +2000-05-28 <karl@gnu.org> -Fri Jun 6 13:22:02 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\linkcolor): replace Cyan with Blue. + (\output): do \pdfmkdest at top. + (\pdfmakeoutlines): set \_ to \normalunderscore. + From: Trevin Beattie <trevin@eyring.com>. - * doc/texinfo.texi (uref): New node for new command. +2000-05-27 <karl@gnu.org> -Thu Jun 5 18:13:48 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\today): only define if undefined. + From: Stepan Kasal <kasal@suse.cz>. - * makeinfo/makeinfo.c (cm_uref): New function to accept optional - second argument. Call it in command table. +2000-05-16 <karl@gnu.org> -Sat Jun 14 10:54:16 1997 Karl Eichwalder <ke@suse.de> + * texinfo.tex (\deftypeivarheader): need defheaderxcond. From: + Marcel van der Boom <marcel@hsdev.com>. - * mkinstalldirs: Update from automake-1.1p. +1999-10-01 Karl Berry <karl@gnu.org> - * configure.in: Touch po/ChangeLog (gettext needs it). + * texinfo.tex (\afourwide): had hsize and vsize reversed. + From: Pascal Obry <pascal_obry@csi.com> -Thu Jun 12 08:37:52 1997 Karl Eichwalder <ke@ke.Central.DE> +1999-09-25 Karl Berry <karl@gnu.org> - * util/texindex.c: Include system.h, remove config.h. + * texinfo.tex (\alias): fix from Andreas. - * po/POTFILES.in: Fill it. +1999-09-19 Karl Berry <karl@gnu.org> - * makeinfo/multi.c: Include system.h. + * texinfo.tex (\key): rename the \smallrm and \smallsy here. - * info/Makefile.am: - * makeinfo/Makefile.am: - * util/Makefile.am: - (localedir): Set. - (INCLUDES): Add intl/ and LOCALEDIR. - (LDADD): Add @INTLLIBS@. + * texinfo.tex (\indexfonts): rename to \smallfonts, along with + \indrm, etc. + Define all the fonts, too. + (\footnotezzz): use \smallfonts. - * makeinfo/makeinfo.c (main): - * util/texindex.c (main): - * util/install-info.c (main): - setlocale, bindtextdomain, and textdomain. + * texinfo.tex (\needx): get better leading; do nothing if @need + value is less than one linespace. From Arnold. + (\douref, \xrefX, \doemail [pdf]): make spaces normal again, so our + \ignorespaces commands are effective even in an @display. - * lib/system.h: Include locale.h and libintl.h. + * texinfo.tex (\finishtitlepage): remove FINISH TITLE debugging + message. - * acconfig.h: Include libintl.h. - (_, N_): Define. - Add ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_LC_MESSAGES, - HAVE_STPCPY for libintl. - Add @TOP@ and @BOTTOM@. + * texinfo.tex (\anchor): rewrite to always \ignorespaces. + Bug from esken. + + * texinfo.tex (\indexnofonts): dummy up \acronym. + From: Thomas Esken <esken@nmlab.informatik.fh-dortmund.de> - * configure.in (AM_GNU_GETTEXT): Add. - (AC_OUTPUT): Process Makefiles in intl/ and po/. - (ALL_LINGUAS): Available languages. +1999-09-06 Karl Berry <karl@gnu.org> - * Makefile.am (AUTOMAKE_OPTIONS): Now use 1.1p. + * texinfo.tex (\texinfoversion): update. -Wed Jun 11 17:05:37 1997 Karl Eichwalder <ke@ke.Central.DE> + * texinfo.tex: Avoid multiparagraph cells losing linespace between + paragraphs. From: Andreas Schwab <schwab@suse.de>. + Bug from: Lalo Martins <lalo@webcom.com>. - * Makefile.am (SUBDIRS): Add intl/ and po/ for NLS. +1999-08-19 Karl Berry <karl@gnu.org> - * run `gettextize -c' to get the i18n skeleton. + * texinfo.tex (\shortchaplabel): move computation of width of + "Appendix" inside, in case it's been changed by a language. -Wed Jun 4 17:51:08 1997 Karl Berry <karl@cs.umb.edu> +Mon Aug 9 16:31:55 1999 Karl Berry <karl@gnu.org> - * makeinfo/makeinfo.c (uref): New command, another alias for @code - for now. + * texinfo.tex: pdf updates from Han. -Wed Jun 4 02:02:33 1997 Miles Bader <miles@gnu.ai.mit.edu> +Fri Aug 6 13:48:22 1999 Karl Berry <karl@gnu.org> - * doc/texinfo.texi (email): { and } need @ escapes. + * texinfo.tex (\charcode): remove unused counter. + From: Akira KAKUTO <kakuto@fsci.fuk.kindai.ac.jp>. -Sun Jun 1 16:34:12 1997 Karl Berry <karl@cs.umb.edu> +Thu Jul 22 19:08:19 1999 Karl Berry <karl@gnu.org> - * doc/texinfo.texi (itemx): @itemx should always follow @item. + * texinfo.tex: Update from Han. - * makeinfo/makeinfo.c (cm_item): Insert blank line if two - consecutive @item's. - From: Karl Eichwalder <ke@ke.central.de>. - Also various doc fixes. +Tue Jul 20 17:13:16 1999 Karl Berry <karl@gnu.org> -Tue May 27 17:20:44 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex: More pdf improvements from Han. - * doc/texinfo.texi (various): Document @deftypemethod. - (email): @ should have been @@ in the example. - From: Mate Wierdl <mw@wierdlmpc.msci.memphis.edu> +Mon Jul 19 16:33:31 1999 Karl Berry <karl@gnu.org> -Mon May 26 16:56:26 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex: Better pdf support from: Han The Thanh + <thanh@informatics.muni.cz>. - * makeinfo/multi.c (setup_multitable_parameters): Avoid use of %n - for sake of m68k-hp-bsd. - From: Derek L Davies <ddavies@world.std.com>. +Sun Jul 18 14:21:03 1999 Karl Berry <karl@gnu.org> - * info/terminal.c (terminal_begin_using_terminal, - terminal_end_using_terminal): Call fflush and sleep to handle - cmdtool/shelltool with scrollbars. Also ignore - SIGWINCH so we do not prematurely exit. Move call. - (terminal_prep_terminal): Disable LNEXT (CTRL-V). - From: strube@physik3.gwdg.de (Hans Werner Strube). + * texinfo.tex: pdfimage takes braces. - * configure.in (AC_TYPE_SIGNAL): Check this. +Tue Jul 6 19:40:14 1999 Karl Berry <karl@gnu.org> -Sun May 25 16:49:58 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\deftypeop): New command. - * makeinfo/makeinfo.c (discard_insertions): Take arg saying - whether ifinfo/ifset/etc. are ok. - (convert_from_loaded_file): At `finished', call discard_insertions. - (handle_variable_internal): Complain if we reach eof before the - @end for a false condition. - From: HERBERT@boevm4.vnet.ibm.com. +Mon Jul 5 17:17:33 1999 Karl Berry <karl@gnu.org> - * info/Makefile.am (ginfo_SOURCES): Add doc.h. - * lib/Makefile.am (libtxi_a_SOURCES): Add system.h. + * texinfo.tex (\contents): call \pdfmakeoutlines here instead of + inline (!). + (\pdfmakeoutlines): call \indexnofonts instead of making a separate + attempt at it. -Sat May 24 18:08:27 1997 Karl Berry <karl@cs.umb.edu> +Tue May 25 06:16:06 1999 Karl Berry <karl@gnu.org> - * makeinfo/makeinfo.c: Check that we have macro_expansion_filename - before using strcmp. + * texinfo.tex (time-stamp-format): use %02H. -Thu May 22 17:59:46 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex: Had PDF and DVI transposed. - * doc/makeinfo.texi: Minimally document --force. +Sun Apr 25 15:30:00 1999 Karl Berry <karl@gnu.org> - * makeinfo/makeinfo.c (--force): New option. - (-E): Allow stdout via `-'. - (convert_from_loaded_file): Unlink output files if errors and !force. + * texinfo.tex (\appendixletter): restore \the, necessary for .toc. -Tue May 20 17:48:42 1997 Karl Berry <karl@cs.umb.edu> +Thu Apr 22 19:22:12 1999 Karl Berry <karl@gnu.org> - * makeinfo/makeinfo.c: Change all strdup calls to xstrdup. - (xmalloc, xrealloc, memory_error): Remove these functions, they're - in lib. - (set_paragraph_indent, cm_paragraph_indent): Move to misc page. - (cm_footnote): Expand macros in the arg for the macro expansion output. + * texinfo.tex (\emergencystretch): Increase to .15\hsize. -Fri May 16 17:26:59 1997 Karl Berry <karl@cs.umb.edu> +Tue Apr 20 05:11:04 1999 Karl Berry <karl@gnu.org> - * makeinfo/makeinfo.c (cm_macro): Allocate an empty body if the - macro was empty. - (cm_unmacro): Allocate one more byte for the null. - From: Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>. + * texinfo.tex (\defunargs): use \tensl\hyphenchar\font to work + better with Gildea's PostScript version. -Sun May 11 17:51:21 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + * texinfo.tex (\tab): Change back to just &. + From: Nathan Sidwell <nathan@acm.org>. - * makeinfo/makeinfo.c (cm_printindex): Fix calculation of the - length of an index line. + * texinfo.tex: No \fi. -Sun May 11 14:47:42 1997 Tom Tromey <tromey@cygnus.com> +Mon Apr 19 17:38:54 1999 Karl Berry <karl@gnu.org> - * makeinfo/makeinfo.c (main): Don't unconditionally run usage when - -e specified. + * texinfo.tex (\pdflink) [!\ifpdf]: define to ignore arg. -Sun May 11 17:47:42 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex: Add pdf support. Merge from: Kurt Hornik + <Kurt.Hornik@ci.tuwien.ac.at>. - * makeinfo/makeinfo.c (init_indices): Free the source for an @synindex. - (undefindex): Do not go further if the target was already freed. - (free_index): Do not free the node names, as init_tags already did. - (cm_synindex, index_add_arg): Improve error message. - (program_index, function_index, etc.): Remove these unused #defines. +Wed Mar 31 13:24:16 1999 Karl Berry <karl@gnu.org> -Tue May 6 17:53:37 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\defopheader): missing word space before `on'. + Report from: Chris Hanson <cph@martigny.ai.mit.edu>. - * makeinfo/makeinfo.c (init_internals): Do not free current_node, - it already is, at least when multiple input files are specified. - From: Karl Eichwalder <ke@ke.central.de>. +Fri Mar 26 17:00:41 1999 Karl Berry <karl@gnu.org> -Mon May 5 16:14:39 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\imagexxx): Equalize space above and below if in + vmode. From rms. - * doc/texinfo.texi: Mention both alignment and non-alignment of - continuation description lines in menus (Arnold). +Thu Mar 25 20:00:00 1999 Karl Berry <karl@gnu.org> -Sun Apr 27 16:12:44 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\deftypeivar): new command. - * makeinfo/makeinfo.c (apply): Handle body being `\string'. - Also, avoid dereferencing a null pointer when a macro has no named - parameters. - From: Eli Zaretskii <eliz@is.elta.co.il>. +Tue Mar 23 17:53:37 1999 Karl Berry <karl@gnu.org> - * makeinfo/makeinfo.c: Wording changes/fixes in warnings. + * texinfo.tex (&): be sure active & is defined for @deftypefn + operator&. + Report from: Nathan Sidwell <nathan@acm.org>. - * info/session.c (info_get_input_char): Do not mix stdio with raw I/O. - From: Egil Kvaleberg <egilk@sn.no>. +Sat Mar 20 12:31:53 1999 Karl Berry <karl@gnu.org> - From Tom Hageman <tom@basil.icce.rug.nl>. These changes make - arrow keys work: - * info/infomap.c: Add arrow key bindings. - (keymap_bind_keyseq): New support function. - (initialize_info_keymaps): Use it. - (term_ku,term_kd,term_kl,term_kr): Remove explicit declarations; - use #include "terminal.h" instead. - * info/session.c (initialize_info_session): Unbuffer stdin. - (info_get_another_input_char): Fix bug in `ready' logic. - * info/terminal.h, - * info/terminal.c (term_kP, term_kN): New variables to hold - PageUp, PageDown key sequences. - (terminal_initialize_terminal): Set them. + * texinfo.tex (\exampleindent): new command. From Yoshiki. - * util/texindex.c (main), - * util/install-info.c (main), - * makeinfo/makeinfo.c (print_version_info), - * info/info.c (main): Use PACKAGE and VERSION from Automake for - printing version number. + * texinfo.tex: Changes from Andreas to use \sl\$ inside italics + and to avoid extra spaces around @anchor. -Sat Apr 26 19:19:46 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\image, \imagexx): move pdf test to imagexxx for + correct filename parsing. - * makeinfo/makeinfo.c (get_until_in_line): Do not expand if - executing_string. - Also, free temporary strings. - Also, untabify entire file. +Mon Mar 15 16:51:20 1999 Karl Berry <karl@gnu.org> - * doc/texinfo.texi: Many corrections from Arnold. + * texinfo.tex (\imagexxx): reset catcode ^^M in case we're inside + in an example. Report from kama. -Thu Apr 24 16:31:09 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\putwordin): new macro for word `in'. + (\xrefX): use it. + Report from: "Alexey A. Nikiforov" <A.A.Nikiforov@inp.nsk.su> - * makeinfo/multi.c (draw_horizontal_separator): Account for indent - here also. From Ulrich. +Sun Feb 21 16:47:28 1999 Karl Berry <karl@gnu.org> -Wed Apr 23 15:15:34 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex: Expand tabs. - * makeinfo/makeinfo.c (cm_today): Use time_t instead of long; - everyone else does. - (LOCALTIME_CAST): Remove kludge, we'll always use time_t now. +Sun Feb 14 16:02:29 1999 Karl Berry <karl@gnu.org> - * info/Makefile.am (ginfo_SOURCES): Remove general.h, that got - merged into system.h. + * texinfo.tex (\paragraphindent): implement. + Suggestion from: Paul DuBois <dubois@primate.wisc.edu>. -Mon Apr 21 17:13:25 1997 Karl Berry <karl@cs.umb.edu> +Tue Feb 9 07:25:07 1999 Karl Berry <karl@gnu.org> - * makeinfo/multi.c (output_multitable_row): Account for - column_indent, both the global one and for each column. - (setup_multitable_parameters): Account for column_indent in the table - width in the columnfrac case, but don't bother with the template - case for now. + * texinfo.tex (\alias): use def rather than \let. + Change timestamp format to include hours. -Sun Apr 20 16:32:00 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex: New commands @alias and @definfoenclose. + From: "Eric S. Raymond" <esr@snark.thyrsus.com>. - * makeinfo/makeinfo.c (output_stream): Remove redundant - definition; it's in makeinfo.h, - and a vaxstation-ultrix4.3 fails to link because of the two defns. - From: Anders Olofsson <anders@kid025.ericsson.se>. +Mon Feb 8 14:46:56 1999 Karl Berry <karl@gnu.org> - * makeinfo/makeinfo.c (expansion): Inhibit appending to the macro - expansion stream. - (get_until_in_line): Possibly expand the text. - Change caller in get_node_token to do the expansion, - all other calls to remain the same. + * texinfo.tex (\scanmacro): Use \endinput to avoid spurious space, + and various other space fixes. From: Andreas Schwab + <schwab@ls5.informatik.uni-dortmund.de>. - * makeinfo/makeinfo.c (cm_node): No need to call strlen to check - for the empty string. +Thu Feb 4 15:24:40 1999 Karl Berry <karl@gnu.org> - * doc/texinfo.texi: Restore missing @c for initial comment. + * texinfo.tex (\uref): implement optional third arg. -Fri Apr 18 17:41:36 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\dosubind): Include index entry in third arg to + \entry instead of writing as bogus fourth arg. + Report from: kama@hippo.fido.de (Karl Heinz Marbaise). - * doc/texinfo.texi: Mention that .info is unnecessary in the info - file name argument of an xref. + * texinfo.tex (\setemergencystretch): Increase somewhat. - * doc/texinfo.texi: Mention texi2dvi -t instead of embedding - @smallbook or @afourpaper in the document source. + * texinfo.tex (\putwordof): rename from \putwordOf. + * texinfo.tex (defivarhead, \defcvarheader): Use \putwordof. -Sun Apr 13 15:19:08 1997 Karl Berry <karl@cs.umb.edu> +Tue Feb 2 16:57:00 1999 Karl Berry <karl@gnu.org> - * lib/system.h (_GNU_SOURCE): #define. + * texinfo.tex (\documentlanguage, \documentencoding): new + commands. \documentlanguage based on an implementation by kama. -Mon Apr 7 16:30:11 1997 Karl Berry <karl@cs.umb.edu> +Sat Jan 30 17:23:45 1999 Karl Berry <karl@gnu.org> - * doc/info.texi, - * doc/info-stnd.texi, - * doc/texinfo.texi: Do not make (dir) the previous ptr from the top node, - and tell people not to do that in the manual. - From: rmedina@kanojo.ivic.ve (Rodrigo Medina), - confirmed by rms. + * texinfo.tex (\putwordMMai): Should be MMay. From Trond. -Fri Apr 4 16:30:33 1997 Karl Berry <karl@cs.umb.edu> +Fri Jan 29 17:52:16 1999 Karl Berry <karl@gnu.org> - * makeinfo/makeinfo.c: Move error page to top to avoid - prototypes, and do add prototypes for add_word_args and execute_string, - so we can use <stdarg.h>. + * texinfo.tex: Fix @macro expansion inside @section. Patch from + Andreas: - * info/makedoc.c, - * info/nodemenu.c: Use %ld instead of %d for file offsets. - * makeinfo/makeinfo.c (delete_macro): Decrement macro_list_len. - (get_macro_args): Decrement line number if see \n. - * utils/texindex.c (indexify): Use fputs instead of fprintf - for constant string. - From: Eli Zaretskii <eliz@is.elta.co.il>. + From: Andreas Schwab <schwab@ls5.informatik.uni-dortmund.de> -Thu Apr 3 17:40:52 1997 Karl Berry <karl@cs.umb.edu> + The general idea is to construct a list a all defined macros in + the form \do\macro1\do\macro2..., then temporarily define + \do to something appropriate and execute the list to do + whatever is needed. Here is a patch, and i have also + fixed a few other bugs that i found while browsing through + the @macro implementation. Additionally i have added a + check to prevent the user from doing silly things like + @macro shipout. - * configure.in (AC_CHECK_HEADERS): No need to check for vararg.h - here, AC_FUNC_VPRINTF does it. - (AC_CHECK_FUNCS): Likewise for vsprintf and vfprintf. - * makeinfo/makeinfo.c (add_word_args, execute_string): Rewrite - like the error functions. +Sun Jan 24 09:59:42 1999 Karl Berry <karl@gnu.org> -Wed Apr 2 17:46:28 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\obstexwarn): Don't use *** in message, it + interferes with make output parsing. - * configure.in: Add AC_FUNC_VPRINTF. - * makeinfo/makeinfo.c (error, line_error, warning): Rewrite a la - error.c from the *utils to use <stdarg.h> if available. +Thu Jan 21 15:45:20 1999 Karl Berry <karl@gnu.org> -Tue Apr 1 11:48:40 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex: Internationalization improvements from kama. - * doc/texinfo.texi: Tabs are a bad idea. +Wed Jan 20 17:12:52 1999 Karl Berry <karl@gnu.org> - * doc/userdoc.texi, - * doc/info.texi: Untabify. + * texinfo.tex (\contents, \shortcontents): Run \contentspagealignmacro. + From: Trond Endrestol <trond@agamemnon.gtf.ol.no> -Sun Mar 30 17:36:47 1997 Karl Berry <karl@cs.umb.edu> +Thu Jan 14 16:53:43 1999 Karl Berry <karl@gnu.org> - * makeinfo/makeinfo.c (end_of_sentence_p): New function. - (add_char): Call it, instead of simply sentence_ender. - (post_sentence): New macro. - Also, remove some #include's now in system.h. - * lib/system.h [VMS]: #include <perror.h>, from makeinfo. + * texinfo.tex (\begindoublecolumns): Ship out \partialpage + immediately if it is nonvoid, instead of saving it. This avoids a + bug where the index could end up printing one line per page (see + the indexspread.tex test). + From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> -Thu Mar 27 17:41:03 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\image): If running pdftex, do \pdfimage{imagefile.pdf}. + From: Samuel Tardieu <sam@inf.enst.fr> - * info/search.c (skip_node_characters): Do not arbitrarily - strip trailing period from end of node name; this is valid. + Also, update copyright year. -Mon Mar 24 16:44:42 1997 Karl Berry <karl@cs.umb.edu> +Tue Jan 5 17:50:45 1999 Karl Berry <karl@gnu.org> - * configure.in (AC_OUTPUT): Don't need to create stamp-h here, - tromey says AM_CONFIG_HEADER will do it. + * texinfo.tex (\enddoublecolumns): Move \pagegoal reset to after + the \endgroup so we get the restored single-column \vsize + as intended. - * info/Makefile.am, util/Makefile.am, makeinfo/Makefile.am (INCLUDES): - Don't need -I.. (for config.h) or -I$(srcdir), says tromey. - Automake includes those already. +Sun Dec 20 17:57:22 1998 Karl Berry <karl@gnu.org> -Fri Mar 14 15:05:17 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\indexdummies): Set \{ and \} to \mylbrace and + \mybrace to avoid braces in the index file, which + texindex can't handle. - * info/Makefile.am: Build as ginfo, install as info, - to avoid conflict with the standard info target. +Sat Dec 19 18:13:16 1998 Karl Berry <karl@gnu.org> - * lib/system.h: New file. - * makeinfo/makeinfo.c (strerror): Remove declaration, - include system.h, remove other redundant #if stuff. - * info/general.h: Include system.h instead of doing common stuff. - * util/install-info.c (my_strerror): Remove this, use strerror, - include system.h. + * texinfo.tex (\pickupwholefraction): Ignore whole-number part. + (\setuptable): Always pass whole-number part and decimal point. This + allows leading zeroes. + Suggestion from: Ben Bullock <ben@hayamasa.demon.co.uk>. + Date: Fri, 21 Aug 1998 14:06:50 +0100 (BST) - * info/terminal.c (terminal_prep_terminal): Only use OCRNL and - ONLCR if they are defined. Reported by many people. +Tue Dec 15 16:38:07 1998 Karl Berry <karl@gnu.org> - * Installed: + * texinfo.tex (\indexdummies): set \{ and \} to \lbracecmd and + \rbracecmd to avoid lossage if @tex is active during \shipout. + Report from: "Peter Kabal" <Kabal@ece.mcgill.ca>. - Sun Dec 1 19:23:54 1996 Karl Eichwalder <ke@ke.Central.DE> +Sun Dec 6 17:11:17 1998 Karl Berry <karl@gnu.org> - * configure.in (TERMLIBS): Add ncurses. + * texinfo.tex: Doc fix. -Thu Mar 13 13:59:45 1997 Karl Berry <karl@cs.umb.edu> +1998-11-11 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> - * lib/Makefile.am (libtxi_a_SOURCES): Add xstrdup.c. - * info/*.c: Use xstrdup instead of strdup everywhere. + * doc/texinfo.tex (\onepageout): Put the cropmarks in vboxes of + zero height so that they don't contribute space themselves. + Compensate for \topandbottommargin. + (\internalpagesizes): Advance \outervsize by 2\topandbottommargin, + not only 0.6in. - * info/tilde.c: Do not include clib.h, move stdlib.h include to - * info/general.h: here. +Fri Nov 6 17:27:57 1998 Karl Berry <karl@gnu.org> - * configure.in (AC_CONFIG_HEADER): Use this, - to avoid hugely long compile line with all the -D's. - * info/general.h: Include <config.h>. + * texinfo.tex: Use standard time-stamp.el package instead of + update-date.el. - * emacs/Makefile.am (install, install-data): Do @echo - to tell the user to compile/install the elisp manually. +Sat Oct 31 19:23:02 1998 Karl Berry <karl@gnu.org> - * configure.in (AC_REPLACE_FUNCS): Move strerror check to here. - (AC_CHECK_FUNCS): From here. + * texinfo.tex (\indexnofonts,\indexdummies): add \url and \uref to + list. - * lib/strerror.c: New file, from enscript (et al.) distribution. +Fri Oct 30 08:16:23 1998 Karl Berry <karl@gnu.org> -Tue Mar 11 16:36:25 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\expandablevalue): Delete spurious `v' character. - * info/Makefile.am (info_SOURCES): Add doc.c, dribble.c, infodoc.c. - (LDADD): Add @TERMLIBS@. +Tue Oct 27 11:18:40 1998 Karl Berry <karl@gnu.org> - * info/info.h: HANDLE_MAN_PAGES, NAMED_FUNCTIONS: Define these. + * texinfo.tex (@env, @command, @option): Must disable for index + and xref commands. Also, \input plain if necessary before + using {} in the version number. - * info/filesys.h: Spurious ! when DEFAULT_INFOPATH is not defined. +Wed Sep 30 11:40:36 1998 Karl Berry <karl@cs.umb.edu> - * configure.in (AC_OUTPUT): Do lib first and doc last. + * texinfo.tex: Use date as version number instead of RCS, and + update-date to update it. - * info/echo-area.c, - * info/echo-area.h, - * info/info.h: Rename echo_area to echo-area. +Thu Sep 17 13:22:44 1998 Karl Berry <karl@cs.umb.edu> -Mon Mar 10 17:59:05 1997 Karl Berry <karl@cs.umb.edu> + * texinfo.tex: Fix @macro expansion of @code with _ in the + argument. + From: Zack Weinberg <zack@rabi.columbia.edu>. - * */Makefile.am: Write Makefile.am files for Automake. - * doc: New subdirectory, move all manuals and texinfo.tex there. - * AUTHORS, THANKS, config.guess, config.sub, mkinstalldirs: New files, - required by Automake. - * lib/xmalloc.c: Move from info/. +Fri Aug 28 10:30:29 1998 Karl Berry <karl@cs.umb.edu> -Fri Oct 4 07:49:49 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\itemzzz): take \itemmargin into account when + unhboxing. Reported by Bob. - * Version 3.9. +Fri Aug 14 16:56:58 1998 Karl Berry <karl@cs.umb.edu> - * Makefile.in (install): Say to install texinfo.tex manually. + * texinfo.tex: Change @defun environments so that right margin is + not changed, and instead the defun type label is outdented + into the margin. - * util/texi2dvi, - * util/texindex.c, - * makeinfo/makeinfo.c, - * info/info.c: Include only the current year in the copyright message. +Thu Aug 13 13:31:41 1998 Karl Berry <karl@cs.umb.edu> - * util/texi2dvi: Exit successfully. - From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>. + * texinfo.tex (\smartslanted): define this separately from + \smartitalic. + (\emph, \i): use \smartitalic for true italics. -Thu Oct 3 12:58:32 1996 Karl Berry <karl@cs.umb.edu> +Mon Aug 10 11:51:13 1998 Karl Berry <karl@cs.umb.edu> - * Rename install.sh to the preferred install-sh. + * texinfo.tex (\value): handle active _ or - in argument (happens + if called from @code). + Report from: Dave Love <d.love@dl.ac.uk>. - * 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. +Sun Jul 19 09:49:23 1998 Karl Berry <karl@cs.umb.edu> - * util/texi2dvi: Only show diff if verbose. + * texinfo.tex (\dosubind): Don't do \vskip to preserve \lastskip + unless we are in vertical mode. Otherwise we might end a + paragraph prematurely, and \folio won't get expanded by + \output. + Report from: "Richard E. Stone" <res@rstone.mn.org> - * 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. +Thu Jul 16 15:33:37 1998 Karl Berry <karl@cs.umb.edu> - * texinfo.texi: Fix incorrect uses of @key, - insert missing newline in Installing Dir Entries' @menu item, - document install-info invocation. + * texinfo.tex: Keep track of how negative the page numbers have + gotten: + (\lastnegativepageno): New \count register. + (\startcontents): Use it. + (\contents, \summarycontents): set it. - * 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. +Mon Jul 13 16:58:11 1998 Karl Berry <karl@cs.umb.edu> - * makeinfo/makeinfo.c (cm_xref): Back out patch from Tom T., since - we generate a good-enough error message that is suppressible - without it. + * texinfo.tex (\imagexxx): Add some space around the image if it's + by itself. - * util/gen-dir-node: The recommended name for the top-level info - file is dir, not dir.info. +1998-07-09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> - * 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. + * texinfo.tex (chapterzzz): Put a space before the chapter number + in the message. + (appendixzzz): Use \putwordAppendix in the message. - * 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 <gaylen@proaxis.com>, 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. +Thu Jul 9 08:39:53 1998 Karl Berry <karl@cs.umb.edu> -Wed Oct 2 18:23:30 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\macro): Globalize assignments since it's done + inside a group. From Zack. - * 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. +Mon Jul 6 17:21:25 1998 Karl Berry <karl@cs.umb.edu> -Tue Oct 1 17:41:52 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\comment): Speed up. + (\loggingall): Turn on eTeX's extended tracing. + More macro fixes. + Date: Sat, 04 Jul 1998 14:51:49 -0400 + From: Zack Weinberg <zack@rabi.phys.columbia.edu> - * makeinfo/Makefile.in (install), - * info/Makefile.in (install), - * Makefile.in (install): Use new option name --info-dir instead of - --infodir. +Thu Jul 2 10:20:32 1998 Karl Berry <karl@cs.umb.edu> - * makeinfo/multi.c (out_char): New fn. Replace all calls to - putc/fprintf with calls to this. + * texinfo.tex (\contents, \summarycontents, \startcontents): Use + roman numerals for toc, arabic outside, even when toc is + at the beginning. - * util/install-info.c: Rename --infodir to info-dir. +Mon Jun 29 10:05:28 1998 Karl Berry <karl@cs.umb.edu> -Mon Sep 30 10:07:21 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\anchor): New command @anchor. + (\xrefX): Avoid double space when xref to an @anchor or an @unnumbered. - * Version 3.8. + * texinfo.tex (\itemzzz): Use kerns and \unhbox when item text + fits in the space, so footnotes can work. - * texinfo.tex: Untabify. + * texinfo.tex (\setref): Take additional argument for the -snt + xref. Call \indexdummies. + (\donoderef, \appendixnoderef, \unnumbnoderef): Change \setref calls. - * 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. +Sat Jun 27 19:16:34 1998 Karl Berry <karl@cs.umb.edu> - * COPYING: Update for new FSF address (from gcc dist). + * texinfo.tex (\contents, \summarycontents): Must not be \outer. - * libtxi/Makefile.in: Various simplifications. +Fri Jun 26 16:15:14 1998 Karl Berry <karl@cs.umb.edu> -Sun Sep 29 12:58:44 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\writetocentry): New macro. + (\chapternofonts): No longer needed. + (\chapter, ..., \unnumberedsubsubsec): Change all the sectioning + commands to call \writetocentry instead of doing it inline. + Also, do not call \chapternofonts, we avoid expansion with + \the\toks instead. + (\opencontents): No longer needed, instead \writetocentry opens + the file when necessary. + (\setfilename): Don't call \opencontents. + (\ifsetcontentsaftertitlepage, \ifsetshortcontentsaftertitlepage): + New conditionals. + (\Etitlepage): Call \contents and/or \shortcontents if + conditionals are set. - * util/texi2dvi: Use $progname instead of $0 for --version. + Global: use \nobreak instead of \penalty 10000 for epsilon efficiency. - * util/install-info.c (xmalloc, xrealloc): Declare malloc and - realloc as returning void *, - to avoid ptr/int problems on Digital Unix. +Thu Jun 25 08:29:32 1998 Karl Berry <karl@cs.umb.edu> - * info/tilde.c (tilde_expand_word): Declare getenv as returning char *, - to avoid warning on Digital Unix. + * texinfo.tex (\option,\env,\command): New markup commands. + Suggested by arnold@gnu.org. - * makeinfo/multi.c (multitable_active): Declare extern here to - avoid ld warning on rs6000. + * texinfo.tex (\afourpaper): More reasonable margins. + From: Wilhelm Mueller <muewi@hb.senbvs43.uni-bremen.de> + Date: Thu, 25 Jun 1998 10:48:13 +0200 (MET DST) - * util/texindex.c (usage): Avoid ??' trigraph. +Wed Jun 24 17:46:43 1998 Karl Berry <karl@cs.umb.edu> - * util/install-info.c: Include <sys/fcntl.h> or <fnctl.h>, - according to HAVE_SYS_FCNTL_H, - and only include <sys/file.h> if HAVE_SYS_FILE_H. - (readlines): Oops, had NULL's and 0's reversed for ptr/int members. + * texinfo.tex (\acronym): New Texinfo command. - * info/terminal.c (terminal_goto_xy): Remove spurious extra ;. +Tue Jun 23 17:36:39 1998 Karl Berry <karl@cs.umb.edu> - * 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. + * texinfo.tex (\dots, \enddots): Missing \leavevmode. + Report from: Thomas Esken <esken@nmlab.informatik.fh-dortmund.de> + Date: Tue, 23 Jun 1998 14:22:27 +0200 (MET DST) - * info/Makefile.in (distclean): Remove *.info* files. +Mon Jun 22 16:00:53 1998 Karl Berry <karl@north> - * Makefile.in (install), - * info/Makefile.in (install), - * makeinfo/Makefile.in (install): Use --infodir instead of --info-file. + * texinfo.tex: Rewrite of index stuff to do better column breaking + and balancing. + The old code failed miserably when the index was just the wrong size, + e.g., the Autoconf manual with @afourpaper. + Bug report from: Wilhelm Mueller <muewi@hb.senbvs43.uni-bremen.de> + Date: Fri, 12 Jun 1998 16:34:49 +0200 (MET DST) + (\initial): Add more glue around the initial, and make it a + multiple of \baselineskip. + (\entry): Add glue before each entry so the columns can always be the + same height. + (\doublecolumnout): Available space no longer needs to handle + \partialpage specially. + (\pagesofar): Take \ht\partialpage into account with \vsize. + (\enddoublecolumns): Reset \output to avoid calling + \balancecolumns twice + (\balancecolumns): Format for readability. + (\initialskipamount): No longer needed, remove. - * info/info.c, - * makeinfo/makeinfo.c: Avoid newlines in string constants for the - sake of SunOS cc. + (\hbadness): Increase a bit, boxes that are a little underfull look ok. - * makeinfo/multi.c: Do not assume ANSI C. +Sun Jun 21 16:48:38 1998 Karl Berry <karl@north> - * info/info.texi: Oops, need @end vtable for a @vtable. + * texinfo.tex (\ninettsl): cmsltt10 is not standard, so use + cmsltt10 scaled 900. + Date: Mon, 15 Jun 1998 12:35:41 +0200 (MET DST) + From: Werner Struckmann <struck@ips.cs.tu-bs.de>. -Sat Sep 28 16:31:28 1996 Karl Berry <karl@cs.umb.edu> +Thu Jun 18 08:32:15 1998 Karl Berry <karl@cs.umb.edu> - * Makefile.in (texinfo): Do not depend on sub-all, as then - makeinfo is always run. Instead, depend on texinfo.texi. + * texinfo.tex: @macro fixes from Zack Weinberg + <zack@rabi.phys.columbia.edu>. + - @ifblah did not work inside @macro + - spaces in parameter lists in macro definitions caused errors + - leading spaces in parameter lists in macro invocations were + preserved inappropriately. - * makeinfo/Makefile.in (info, dvi): New targets. - makeinfo.info, makeinfo.dvi: Do not depend on macro.texi for now. +Wed Jun 10 16:50:53 1998 Karl Berry <karl@cs.umb.edu> - * info/Makefile.in (install): Must call install-info twice. + * texinfo.tex (\smallformatx, \smalldisplayx): New macros. + (\smallbook): Arrange to use them. + (\display, \flushleft, etc.): Rewrite to avoid duplication. - * info/info-stnd.texi, - * info/info.texi, - * makeinfo/makeinfo.texi: Include direntry. +Sun Jun 7 18:13:45 1998 Karl Berry <karl@cs.umb.edu> - * emacs/Makefile.in: Use && after cd, etc. + * texinfo.tex (\pagesizes): Rename to \internalpagesizes. + (\custompaper): Rename to \pagesizes. - * texinfo.texi: Kludges so makeinfo -E will not create spurious - differences. Add new direntries. +Sat Jun 6 13:16:32 1998 Karl Berry <karl@cs.umb.edu> - * util/install-info.c, - * util/texindex.c, - * makeinfo/makeinfo.c, - * info/info.c: Standardize --version output. + * texinfo.tex: Rewrite paper size definitions, add @custompaper. - * 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. + * texinfo.tex: Fix for macros in arguments to other commands. + From Zack. - * util/texi2dvi: Recompute original index files each time through loop. - Make indentation uniform. - Use same basename for the temp input files. - Standardize --version output. +Thu Jun 4 11:21:07 1998 Karl Berry <karl@cs.umb.edu> - * info/Makefile.in (install), - * makeinfo/Makefile.in (install): Insert $(POST_INSTALL). + * texinfo.tex: Better @macro implementation. + From: Zack Weinberg <zack@rabi.phys.columbia.edu>. -Fri Sep 27 13:27:30 1996 Karl Berry <karl@cs.umb.edu> +Tue May 26 17:43:21 1998 Karl Berry <karl@cs.umb.edu> - * texinfo.texi (Format with texi2dvi): Rewrite now that the script - runs in a loop. + * texinfo.tex (\imagexxx): Center image if it is not part of a + paragraph. - * info/Makefile.in (MAKEINFO): Simplify to ../makeinfo/makeinfo. +Tue May 19 17:17:12 1998 Karl Berry <karl@cs.umb.edu> -Fri Sep 27 00:26:03 1996 Miles Bader <miles@gnu.ai.mit.edu> + * texinfo.tex: \linkstrue by default. + Also, first implementation of @macro; can only handle some cases, + but that is better than nothing. + From: Zack Weinberg <zack@rabi.phys.columbia.edu> - * 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 <termios.h>. - * configure.in: Add check for <termios.h>. +Thu May 14 17:32:47 1998 Karl Berry <karl@cs.umb.edu> -Thu Sep 26 10:46:34 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex: New command @novalidate along the lines of makeinfo + --no-validate. + Date: Sun, 26 Oct 1997 18:54:47 -0500 + From: Zack Weinberg <zack@rabi.phys.columbia.edu> - * emacs/texnfo-upd.el, - * emacs/texinfo.el, - * emacs/texinfmt.el: Update from bob for new Texinfo commands, etc. +Tue May 12 16:19:35 1998 Karl Berry <karl@cs.umb.edu> - * emacs/info.el, emacs/informat.el, emacs/makeinfo.el, - emacs/texnfo-tex.el: Update from Emacs 19.34 dist. + * texinfo.tex (\valuexxx): Split up into expandable and + non-expandable parts. + (\expandablevalue): New macro. + (\indexdummies): \let\value = \expandable value. - * emacs/elisp-comp: Use TMPDIR if set. + * texinfo.tex: Doc fixes. - * util/Makefile.in (libdir): Remove. + * texinfo.tex (\doind): Just call \dosubind with empty third arg. + (\dosubind): Replace with \doind definition and suitable code to handle + possible third arg. And propagate glue past the whatsit from the + \write so index entries don't cause extra space between + @defuns (for example). - * makeinfo/Makefile.in (install), - * Makefile.in (install), - * info/Makefile.in (install): Run install-info. - (libdir): Remove. +Wed May 6 12:51:27 1998 Karl Berry <karl@cs.umb.edu> - * texinfo.texi: Various fixes as I make this go through TeX. + * texinfo.tex (\deftypemethparsebody): Handle the extra arg in + @deftypemethodx, too. + (\deftypefunx): Error definition was misspelled as \deftypeunx. - * util/install-info.c: Quote newlines in help message. +Fri May 1 17:31:58 1998 Karl Berry <karl@cs.umb.edu> - * util/texi2dvi (texi2dvi): Run TeX until the aux/index files - stabilize, instead of just twice. From: David Shaw - <daves@gsms01.alcatel.com.au>. + * texinfo/texinfo.tex (\putwordon, \putwordMethodon): New macros. + Use in \def... commands. + (\indexdummies): make `\ ' be just ` ' for sorting. + (\deftypemethparsebody): New macro. + (\defmethod): Call it. + Various doc fixes. + Repored by: KHMarbaise@p69.ks.fido.de (Karl Heinz Marbaise) + Date: Wed, 07 Jan 1998 10:19:42 +0100 -Tue Sep 24 14:43:03 1996 Karl Berry <karl@cs.umb.edu> +Fri Apr 10 16:54:48 1998 Karl Berry <karl@cs.umb.edu> - * dir: Blank dir file for installation on new systems. + * texinfo.tex: @cartouche: Align right side correctly. + From: dale.smith@bellhow.com (Dale Smith) + Date: Fri, 06 Mar 1998 14:47:02 GMT -Mon Sep 23 12:18:43 1996 Karl Berry <karl@cs.umb.edu> +Sun Apr 5 17:19:03 1998 Karl Berry <karl@cs.umb.edu> - * makeinfo/makeinfo.c (args_from_string): Do not back up at a }; - that leads to an infinite loop. + * texinfo.tex (\dosetq): Use \normalturnoffactive instead of just + \turnoffactive, so \'s in node names are handled properly. + (\tie): Move definition to more rational position in the file. + (\@, \{, etc.): Use decimal numbers in all cases, to avoid use of '. + Paranoia only. + (\+): Turn off once and for all at the beginning, and define as + \tabalign in @tex. -Sat Sep 21 17:48:04 1996 Karl Berry <karl@cs.umb.edu> +Tue Mar 31 19:33:31 1998 Karl Berry <karl@cs.umb.edu> - * makeinfo/makeinfo.c (cm_xref): Do not seg fault if outside of - any node. From: Tom Tromey <tromey@creche.cygnus.com>. - (cm_ctrl): Make obsolete. + * texinfo.tex (\synindex, \syncodeindex): \closeout the redirected + index. + From: Jakob Stoklund Olesen <stoklund@mi.aau.dk> -Tue Sep 17 13:30:08 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\doignore): Ignore everything after `c', so @end + ifinfo and the like can be commented out. + (\macrocsname): New macro. + Reported by: "James A. Lupo" <lupoja@feynman.ml.wpafb.af.mil> - * 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. +Wed Feb 25 15:48:51 1998 Karl Berry <karl@cs.umb.edu> -Sat Sep 14 16:17:35 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\doprintindex): Change catcode of @ before \read, + in case of \initial{@} being the line that is read. + Reported by: Drew Csillag <drew_csillag@geocities.com> - * texinfo.texi: Document multitables, new ISBN number. + * texinfo.tex (\dotable): Add \leftskip to \hsize in the first column. + Don't inherit \rightskip from surrounding environment. + Set \item to \crcr to avoid empty first row. + Prepend \parskip glue before table. + Set \everycr locally outside of alignment, don't reset it + explicitly in \Emultitable. + All from Andreas Schwab, to avoid overfull hboxes. -Wed Sep 11 18:01:24 1996 Karl Berry <karl@cs.umb.edu> + Also, work on leading commentary in file a bit. - * 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. +Tue Feb 24 17:48:29 1998 Karl Berry <karl@cs.umb.edu> - * 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.tex: \!: Save and restore this for @tex. + From: Jean-Pierre Moreau <jpmoreau@ciframedical.com> + Date: Fri, 22 Aug 1997 16:47:36 -0400 - * texinfo.texi: First cut at macro documentation. - Change accent doc to use tables. - Remove whitespace experiments, they are now the default. + * texinfo.tex (\angleleft, \angleright): New macros. + (\refx, \email, \key): Use them. + From: Stephen Gildea <gildea@intouchsys.com> + Date: Fri, 26 Dec 1997 11:43:32 EST -Mon Sep 9 14:16:24 1996 Karl Berry <karl@cs.umb.edu> +Mon Feb 23 17:34:23 1998 Karl Berry <karl@cs.umb.edu> - * makeinfo/makeinfo.c: Use putc instead of fprintf where possible. - (cm_accent): Put _ from @ubaraccent after argument. + 1997-08-28 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> + * doc/texinfo.tex (xrdef): Read the second argument with \ + as an escape character. - * util/texindex.c (strerror) [!strerror]: Conditionalize - declaration. +1998-01-22 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> -Sat Sep 7 14:13:24 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\tocentry): Don't \turnoffactive before typesetting + the arguments, it causes special characters to be printed + incorrectly. - * makeinfo/makeinfo.c (commandTable): Obsolete @setchapterstyle. +Mon Jan 19 10:58:25 1998 Karl Berry <karl@cs.umb.edu> -Thu Sep 5 15:45:11 1996 Karl Berry <karl@cs.umb.edu> + * texi2html: Correct version number, home page reference. - * makeinfo/makeinfo.c (convert_from_loaded_file): Oops, fix - wording of initial output comment. +Sat Jan 17 15:12:03 1998 Karl Berry <karl@cs.umb.edu> - * makeinfo/makeinfo.c (cm_angle_brackets): Rename from cm_key. - (commandTable): @email should produce angle brackets. - @key: Change name. + * texi2html: Version 1.54. Handle @image better, etc. + * From: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>. -Tue Sep 3 14:52:17 1996 Karl Berry <karl@cs.umb.edu> +Wed Dec 24 13:59:07 1997 Karl Berry <karl@cs.umb.edu> - * texinfo.tex (\hsize): Decrease. - (\hoffset): Increase. - (\setleading): Decrease dramatically. - This change affects 8.5x11 format only. + * texinfo.tex (\dots, \enddots): Use current font instead of + always using math italic. From Stephen Gildea. - * texinfo.texi: Document accent commands. +Tue Dec 23 11:33:07 1997 Karl Berry <karl@cs.umb.edu> -Mon Sep 2 11:10:49 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex: Spurious xepsf.tex should be epsf.tex. - * makeinfo/makeinfo.c (commandTable): Deprecate @ichapter and - @titlespec. - Move all the deprecated @i<section> commands to the end of the list. +Mon Oct 13 15:49:28 1997 Karl Berry <karl@cs.umb.edu> - * texinfo.texi: Document @pounds{} and @centerchap{}. + * texinfo.tex (\titlefont): Explicitly set \rm. - * 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. +Sat Jul 26 15:12:37 1997 Karl Berry <karl@cs.umb.edu> -Sun Sep 1 15:01:49 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\email): Let to \uref instead of \code, as a second + optional argument makes sense for this, too. - * texinfo.texi: Document @<whitespace>, rearrange spacing section. +Mon Jul 14 13:43:43 1997 Karl Berry <karl@cs.umb.edu> - * 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-<sentence-ender>. + * texinfo.tex (\indexdummies): Add \value. -Fri Aug 30 18:55:30 1996 Karl Berry <karl@cs.umb.edu> +Thu Jul 10 13:34:30 1997 Karl Berry <karl@cs.umb.edu> - * texinfo.texi: Document @- and @hyphenation{}. - Miscellanous fixes. + * texinfo.tex (\authorrm): Must use \def instead of \let, as + \secrm is not yet defined. - * makeinfo/makeinfo.c (commandTable): Define @- as cm_no_op, since - makeinfo doesn't do hyphenation. +1997-07-09 Richard Stallman <rms@psilocin.gnu.ai.mit.edu> -Thu Aug 29 13:05:38 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\titlefont): Define again, using \titlefonts. - * texinfo.tex (\key): Do not uppercase the argument; key names - can be mixed case, e.g., `Control'. +Wed Jul 9 16:45:30 1997 Karl Berry <karl@cs.umb.edu> - * 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. + * texinfo.tex (\startcontents): Leave ^ catcode as other. - * makeinfo/makeinfo.c: Rename @d to @udotaccent, since this is - relatively infrequently used. +Sat Jul 5 17:16:40 1997 Karl Berry <karl@cs.umb.edu> -Tue Aug 27 14:58:56 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\titlefonts): New macro to set title font styles, + so italic etc. work in @title. + (\titlefont): No longer needed. + (\titlepage): Call \titlefonts instead of \titlefont. + (\chapsf, \ssecsy, \ssecttsl): Correct magstep values. + From: Stephen Gildea <gildea@intouchsys.com>. - * info/info.c (print_short_help), - * util/install-info.c (print_help), - * util/texi2dvi, - * makeinfo/makeinfo.c (usage) Include bug reporting address. + * texinfo.tex (\onepageout): Back up to 2\baselineskip per Stephen. + (\kbdinputstyle): New command. -Mon Aug 26 15:27:17 1996 Karl Berry <karl@cs.umb.edu> +1997-04-03 00:07:28 1997 Richard Stallman <rms@gnu.ai.mit.edu> - * makeinfo/makeinfo.c (commandTable): Remove @input, @medbreak, - @smallbreak, @overfullrule, @br. + * texinfo.tex (\kbdfont, \kbdexamplefont): New macros, parms that + tell @@kbd what to do. + (\setkbdinputdistinct, \setkbdinputexample): New commands set them. + (\kbd): Use those parms. -Sun Aug 25 17:25:48 1996 Karl Berry <karl@cs.umb.edu> +Thu Jul 3 16:52:39 1997 Karl Berry <karl@cs.umb.edu> - * 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.tex (\onepageout): Leave only one line space above the + footline, to be more like plain. Suggested by Stephen Gildea. + (\evenfootline): Left one too many line spaces here, so reduce by two. - * texinfo.texi: Document @ifhtml ... @end ifhtml. Change - `PlainTeX' to `plain TeX'. + (\ifnottex): Another ignore command. + (\ifnothtml,\ifnotinfo): New commands. + (\doignore): Ignore brace characters, so mismatched braces in ignored + text do not cause complaints. -Fri Aug 23 16:03:16 1996 Karl Berry <karl@cs.umb.edu> +Fri Jun 27 15:09:16 1997 Karl Berry <karl@cs.umb.edu> - * 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. + * texinfo.tex (\image): New definition for new @image command. - * makeinfo/makeinfo.c (cm_special_char): @pounds{} prints a #. - (commandTable): Add new command @pounds. +Wed Jun 18 15:58:20 1997 Karl Berry <karl@cs.umb.edu> -Tue Aug 20 13:47:20 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\oddfootingxxx), + (\onepageout): Leave space for the footline if present. + (\everyfootingxxx, \everyheadingxxx): Call \oddfootingxxx and + \evenfootingxxx instead of repeating their code. From: Stephen + Gildea <gildea@intouchsys.com>. - * makeinfo/makeinfo.c (CommandTable): Restore "!", accidentally - removed previously. + (\setfilename): Read texinfo.cnf if present. - * 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. + (\indexdummies, \indexnofonts): No-op additional commands @result @equiv + @expansion @print @error @point. From: Dave Bodenstab + <imdave@ais.net> (for texi2www doc). -Wed Aug 14 16:59:23 1996 Karl Berry <karl@cs.umb.edu> +Fri Jun 6 10:31:34 1997 Karl Berry <karl@cs.umb.edu> - * texinfo.texi: Propagate change from rms. + * texinfo.tex (\setmultitablespacing): Restore bad typing mistake + from yesterday. -Tue Aug 13 11:33:27 1996 Karl Berry <karl@cs.umb.edu> +Thu Jun 5 18:04:26 1997 Karl Berry <karl@cs.umb.edu> - * texinfo.texi: Propagate change from rms. + * texinfo.tex (\uref): Write real definition, taking one mandatory + argument and one optional one. - * texinfo.texi: Document other @headings options. +Wed Jun 4 17:16:09 1997 Karl Berry <karl@cs.umb.edu> -Sun Aug 11 13:19:42 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\mainmagstep): Define this as a \count variable + instead of with \let, to make changing to \magstep1 more transparent. + From: HERBERT@boevm4.vnet.ibm.com. + (\uref): New command a la \url. - * 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. +Sat May 24 18:06:41 1997 Karl Berry <karl@cs.umb.edu> -Fri Aug 9 14:12:07 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\deftypemethod, \deftypemethodheader): New macros + to implement new commands @deftypemethod and @deftypemethodx. + Suggestion from: KHMarbaise@p69.ks.fido.de (Karl Heinz Marbaise). - * 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.) +Wed May 21 17:17:52 1997 Karl Berry <karl@cs.umb.edu> -Mon Aug 5 13:52:39 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\opnr, \clnr): Increment/decrement \parencount, for + @defun lines with nested parens. From Bill Schelter + <wfs@fireant.ma.utexas.edu>. + (\itemizeitem): Correct \errmessage. - * 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. +Mon May 19 17:34:40 1997 Karl Berry <karl@cs.umb.edu> -Sun Aug 4 16:46:10 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\codeunder): Use \_ and \ifusingtt to avoid + dotaccent from _ in roman fonts, e.g., @deftypefn. + (\tex): Remove spurious spaces at the end of subdefinitions. + From: "John W. Eaton" <jwe@bevo.che.wisc.edu>. + (\url, \email): \let to \code; no quotes or angle brackets. - * makeinfo/makeinfo.c (flush_output): Mask out eighth bit, that we - turned on in non-sentence enders. +Mon May 5 17:06:35 1997 Karl Berry <karl@cs.umb.edu> -Sat Aug 3 14:03:10 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\onepageout): \ifcropmarks, center the page body. + Lost this when merged \croppageout with \onepageout. Found by + Arnold. - * texinfo.tex (\HEADINGSdouble, \HEADINGSsingle, - HEADINGSdoubleafter, \HEADINGSsingleafter, \CHAPPAGoff, - \CHAPPAGon, \CHAPPAGodd): Set \contentsalignmacro, analogous to - \pagealignmacro. - (\startcontents): Call \contentsalignmacro instead of \pagealignmacro. + (\doprintindex): Do not bother to go into double column mode unless + there actually is a non-empty index. -Mon Jul 29 14:44:33 1996 Karl Berry <karl@cs.umb.edu> + (\begindoublecolumns): Include any existing \partialpage in the new one, + lest we lose a whole page of output. Found by M J Morley + <mjm@scs.leeds.ac.uk>. - * 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). + (\chapternofonts): Remove spurious spaces, both in the definitions that + get output to the aux file(s) and in this macro. -Sun Jul 28 13:37:05 1996 Karl Berry <karl@cs.umb.edu> + Fix comments and rationalize whitespace in various other places. - * 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. +Sun Apr 27 15:41:16 1997 Karl Berry <karl@cs.umb.edu> + + * texinfo.tex (\chapter, etc.): Avoid expansion of section title + when writing the toc. + +Thu Apr 24 16:35:46 1997 Karl Berry <karl@cs.umb.edu> - * texinfo.texi: Update the `Obtaining TeX' node. + * texinfo.tex (\onepageout): Integrate cropmarks case here, + instead of having a completely different routine. + (\croppageout): Remove this. -Fri Jul 26 14:11:48 1996 Karl Berry <karl@cs.umb.edu> +Sun Jun 9 14:26:42 1996 Karl Berry <karl@cs.umb.edu> - * util/texi2dvi: Do macro expansion with makeinfo before running TeX. - Various expansion safety measures added for test; avoid use of -o. + * texinfo.tex (\ignoremorecommands): Ignore \defcodeindex, and do + not ignore \message. - * makeinfo/makeinfo.c (usage): More usage message tweaks. +Thu Apr 11 12:59:42 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu> -Fri Jul 26 11:55:37 1996 Karl Berry <karl@laurie> + * texinfo.tex (\macro): New macro. + (\enddots, \endldots): New macros. + (\centerchap, \centerchapyyy): New macros. + (\centerchfplain, \centerchfopen): New macros. + (\CHAPFplain, \CHAPFopen): Set \centerchapmacro. - * util/texi2dvi: Format usage message to conform to the other *utils. +Wed Mar 13 11:42:17 1996 Karl Berry <karl@cs.umb.edu> -Thu Jul 25 17:05:47 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\url): New macro, like \samp for now. - * emacs/Makefile.in: Do not compile the Elisp by default. We - don't install it, so it confuses people to compile it. +Sun Mar 10 13:05:08 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu> -Sun Jul 21 07:20:09 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex: Changes in @multitable code. + Change meaning of @multitablelinespace. - * util/Makefile.in (install-info): Dependency should be - install-info.o, not install-info. Also, update copyright years. +Tue Mar 5 18:56:08 1996 Dave Love <d.love@dl.ac.uk> - * makeinfo/makeinfo.c (cm_printindex): Don't call execute_string - to print index entries, we've already done the expansion now. + * texinfo.tex (\set): Set catcode of space explicitly (inside a + group) to avoid losing inside @example, say. - * 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. +Sun Mar 3 17:01:27 1996 Karl Berry <karl@cs.umb.edu> -Fri Jul 19 10:35:22 1996 Karl Berry <karl@cs.umb.edu> + * texinfo.tex (\itemxpar): Protect the \vskip here with \nobreak, + to avoid a possible page break at an @itemx. - * info/info.c: Update copyright date. +Sun Feb 25 14:53:15 1996 Karl Berry <karl@cs.umb.edu> - * info/info.texi, - * util/install-info.c, - * emacs/Makefile.in, - * emacs/texnfo-tex.el, - * emacs/Makefile.in: Change FSF address. + * texinfo.tex (\obstexwarn): Use \global to avoid ever getting the + warning twice. - * Merged changes from bfox -- below, plus multitable changes, plus - lots more. + * texinfo.tex (\include): Allow underscores and other such + characters we made active in the file name argument. - Sun Apr 14 08:49:50 1996 Brian J. Fox <bfox@nirvana.samsara.com> +Tue Feb 6 15:06:27 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu> - * 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. + * texinfo.tex (\afourlatex): Delete the old duplicate definition + of \afourlatex. - Mon Feb 12 17:35:38 1996 Brian J. Fox <bfox@nirvana.samsara.com> +Sun Feb 4 15:20:16 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu> - * makeinfo/makeinfo.c (push_node_filename): Clean up calls to - xmalloc and xrealloc. Only have to call xrealloc. + * texinfo.tex (\tab): New definition. + (\setuptable): Fix previous change. + (\multitablecolspace): Renamed from \multitablecolmargin. + (\multitablelinespace): Renamed from \multitablelineskip. - Fri Jan 26 08:00:38 1996 Brian J. Fox <bfox@nirvana.samsara.com> +Fri Feb 2 02:20:16 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu> - * info/session.c (info_input_buffer_space_available): Fix typo - which forced the limitation of the sizeof (int) instead of sizeof - (buffer). + * texinfo.tex (\multitableparskip): Renamed from \intableparskip. + Allocate with \newskip. + (\multitableparindent): Renamed from \intableparindent. Use \newskip. + (\multitablelineskip): Renamed from \spacebetweenlines. Use \newskip. + (\multitablecolmargin): Renamed from \spacebetweencols. + (\columnfractions): Renamed from \percentofhsize. + (xcolumnfractions): Renamed from \xpercentofhsize. - * Makefile.in (PACKVER): now at 3.8. Add TERMIOS support to - Info. Minor bugs fixed in Makeinfo. + * texinfo.tex (\setuptable): Handle >1 digits after @percentofsize. + (\pickupwholepercent): New macro. -Sat Jul 13 11:58:57 1996 Karl Berry <karl@cs.umb.edu> +Sun Jan 28 21:14:46 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu> - * texinfo.texi (ftable vtable): Mention example. + * texinfo.tex (\key, \kbdfoo): Use \ttsl unconditionally. + (\setkeyfont): Definition deleted. -Sun Jun 30 14:59:51 1996 Karl Berry <karl@goldman.gnu.ai.mit.edu> +Tue Jan 23 14:57:23 1996 Karl Berry <karl@cs.umb.edu> - * makeinfo/makeinfo.c (cm_email): New function for new @email command. - * texinfo.texi (email): New node documenting it. + * texinfo.tex: @kbd within @example selects slanted tty font: + (\ttsl, \ttslshape): Define this new font shape. + (\kbdfoo): Set the font to \ttsl if already using \tt. + (\setkeyfont, \ifmonospace): New macros. -Wed Apr 17 18:07:34 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu> +Wed Jan 17 23:57:48 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu> - * 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. + * texinfo.tex (\changepagesizes): Additional arg for topskip. + (\afourlatex): Total rewrite. + (\afourwide): Pass new arg to \changepagesizes. -Sat Apr 13 23:22:05 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu> +Wed Jan 3 17:15:00 1996 Stephen Gildea <gildea@x.org> - * util/install-info.c (main): Fatal error if no input file spec'd. - Look for START-INFO-DIR-ENTRY, not BEGIN-INFO-DIR-ENTRY. + * texinfo.tex (\slbshape, \itbshape): Use bold slant and and + bold italic in titles to match the bold roman. Do not use + bold sf or bold tt, which would be too heavy. -Thu Apr 11 18:21:50 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu> + * texinfo.tex (\setfont): Pass font name in more pieces. + (\*shape): New macros defining symbolic names for all font + shapes so can use other font families with different naming + conventions. - * makeinfo/makeinfo.c (cm_enddots): New function. - (self_delimiting): Accept -, ^ and ". - (CommandTable): Add commands -, ^, ", enddots, centerchap. +Wed Jan 3 15:52:18 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu> -Sun Mar 24 12:18:32 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu> + * texinfo.tex (\ignoremorecommands): Turn off @everyheading and + friends, @headings, @setchapternewpage, @setchapterstyle. - * 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. +Sat Dec 30 17:20:48 1995 Karl Berry <karl@cs.umb.edu> -Sun Mar 24 11:10:05 1996 Karl Berry <karl@spiff.gnu.ai.mit.edu> + * texinfo.tex (\inmargin): Don't allow a break before the vertical + kern. Do allow a whole paragraph of marginal text, not just one line. + Use \inmarginspacing. - * makeinfo/makeinfo.c (cm_url): New function for new @url command. +Thu Dec 28 23:22:08 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu> -Fri Feb 23 21:14:40 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu> + * texinfo.tex (\inmargin): New command @inmargin. + (\dircategory): Ignore @dircategory. - * info/Makefile.in (install, uninstall): Use manprefix. +Tue Dec 12 17:25:36 1995 Karl Berry <karl@cs.umb.edu> -Fri Feb 23 19:50:18 1996 Richard Stallman <rms@whiz-bang.gnu.ai.mit.edu> + * texinfo.tex (\lvvmode): Remove this; use \leavevmode as usual, + so spaces/underscores at beginnings of lines inside @example work. + Bogus index entries should be (and now are, I think) handled in + other ways. - * util/Makefile.in (install-info, install-info.o): New targets. - (all): Depend on install-info. - (install, uninstall): Operate on install-info. +Mon Nov 13 16:07:09 1995 Karl Berry <karl@cs.umb.edu> - * install-info.c: New file. + * texinfo.tex (\xrefX): Test for xref-automatic-section-title + being @set correctly, and remove spurious redefinition of + \printednodename in that case. -Wed Jan 3 10:01:45 1996 Brian J. Fox <bfox@nirvana.datawave.net> +Mon Oct 16 15:16:34 1995 Karl Berry <karl@cs.umb.edu> - * makeinfo/makeinfo.c (make_index_entries_unique): Be a little bit - stricter about what makes two index entries identical. + * texinfo.tex (\unsepspaces): New macro to make active space + expand into a normal space char in index entries. + (\indexdummies): Use \unsepspaces. -Fri Dec 29 13:00:24 1995 Brian J. Fox <bfox@wizard.datawave.net> +Thu Oct 12 14:56:52 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu> - * makeinfo/makeinfo.c (Whole File): Add @detailmenu for allowing - detailed menu listings to appear while still defaulting nodes. + * texinfo.tex (\tie): Use \lvvmode, not \leavevmode. + Don't use \@M directly either. -Wed Dec 27 13:54:30 1995 Brian Fox <bfox@albert.gnu.ai.mit.edu> +Sun Aug 27 21:17:09 1995 Paul Eggert <eggert@twinsun.com> - * makeinfo/makeinfo.c (cm_code): Always notice that we are in - fixed_width_font, even if other formatting changes are not to take - place. + * texinfo.tex (\appendixsection): Fix misspelled defn. -Sat Dec 23 11:48:43 1995 Brian J. Fox <bfox@wizard.datawave.net> +Mon Jul 31 23:57:57 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu> - * info/man.c: (clean_manpage) Remove ^L's from page. + * texinfo.tex (\ttfont): Don't call \nohyphenation. - * makeinfo/makeinfo.c (get_brace_args): Change some memcpy's to - memmoves. +Sun Jul 30 18:30:47 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu> - * info/info.c (main): Prefer caseless matches over partial - matches. + * texinfo.tex (\tocentry): Use \turnoffactive. - * Makefile.in (All Subdir Targets): Change suggested by Debian - people which allows errors in recursive makes to kill the - top-level make. +Sun Feb 5 05:34:13 1995 Richard Stallman <rms@pogo.gnu.ai.mit.edu> - * makeinfo/Makefile.in (makeinfo.dvi): New target. + * texinfo.tex (\boldbraxnoamp): New function. + (\deftypefunargs): Use that, not \boldbrax. - * info/info.c (main): Print version of containing texinfo package. +Tue Jan 31 12:15:28 1995 Karl Berry <karl@cs.umb.edu> - * makeinfo/makeinfo.c (flush_output): Don't strip high-bit from - sentence_enders. - Print the version number of the containing texinfo package. + * texinfo.tex (\set): Use \gdef, not \xdef. - * info/man.c (locate_manpage_xref): Count the 0th entry. +Sat Jan 21 16:39:36 1995 Richard Stallman <rms@pogo.gnu.ai.mit.edu> - * makeinfo/makeinfo.c (cm_menu): If a menu is seen before a node - has been defined, warn, and create the node `Top'. + * texinfo.tex: Initially make _ and + \active, + then later make them \other. + (\otherifyactive): New command. -Wed Jun 21 03:19:39 1995 Brian Fox <bfox@albert.gnu.ai.mit.edu> +Thu Jan 19 21:59:22 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu> - * makeinfo/makeinfo.c (cm_infoinclude): Clean up after printing - error if the file couldn't be included. - (discard_braces): Print errors only for those unmatched open - braces that belong to a texinfo command. + * texinfo.tex (\afourwide): New command. - * */Makefile.in: Use @CFLAGS@ and @LDFLAGS@. +Mon Jan 16 09:29:38 1995 Stephen Gildea <gildea@x.org> - * makeinfo/makeinfo.c: End `node_search_string' and friends with a - terminating null character. + * texinfo.tex: Initially make + and _ "other" characters. + (\fixbackslash, \everyjob): Make + and _ active characters. -Wed Jun 21 01:23:49 1995 Jim Meyering (meyering@comco.com) +Tue Jan 10 19:16:09 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu> - * makeinfo/makeinfo.c: Close comment after #endif. + * texinfo.tex: At beginning, \input plain if necessary. + (\deftypefunargs): Use \boldbrax, not \functionparens. -Tue Jun 20 04:58:26 1995 Brian Fox <bfox@albert.gnu.ai.mit.edu> +Sun Dec 18 16:40:11 1994 Richard Stallman <rms@mole.gnu.ai.mit.edu> - * emacs/Makefile.in (install): Fix typo: "fle" -> "file". + * texinfo.tex (\indsc): Use csc10 (at 9pt), not indrm. - * Makefile.in (VERSION): Bump to 3.6 +Mon Oct 31 00:51:20 1994 Richard Stallman <rms@pogo.gnu.ai.mit.edu> - * info/clib.c: Include general.h for `info_toupper' and friends. + * texinfo.tex (\changepapersizes): Fix definition syntax. + (\fontprefix): Define only if not yet defined. - * info/clib.h: strncmp and strncascmp return an int. What kind of - drugs was I on? + * texinfo.tex (\margin): Define a new insert. + (\SETmarginindex): Initialize to \relax. + (\doindex): Optionally put the entry in the margin. + (\pagecontents): Print the index entries put in the margin. -Mon Jun 19 23:34:47 1995 Brian Fox <bfox@albert.gnu.ai.mit.edu> +Sat Oct 29 19:50:10 1994 Richard Stallman <rms@mole.gnu.ai.mit.edu> - * makeinfo/makeinfo.c (make_index_entries_unique): Copy the last - index entry. + * texinfo.tex (\auxhat): New macro. + (\dosetq): Use \auxhat. + (reading the aux file): Give ^ catcode 7. -Mon Jun 19 21:55:49 1995 Noah Friedman <friedman@prep.ai.mit.edu> +Wed Oct 26 03:28:04 1994 Richard Stallman <rms@mole.gnu.ai.mit.edu> - * util/texi2dvi (--version): New option. - Cosmetic changes. + * texinfo.tex (\setfont): New macro. Use it for specifying + most of the fonts that are normally cm fonts. + (\fontprefix): New macro, normally `cm'. -Mon Jun 19 16:06:40 1995 Brian Fox <bfox@albert.gnu.ai.mit.edu> +Mon Oct 24 01:27:09 1994 Richard Stallman <rms@mole.gnu.ai.mit.edu> - * makeinfo/makeinfo.c (cm_macro): Fix typo. `x != y' is not the - same as `x |= y'. + * texinfo.tex (\startcontents): Set catcode of ^. - * info/Makefile.in (exec_prefix): Use @exec_prefix@ not $(prefix). - * makeinfo/Makefile.in (exec_prefix): Use @exec_prefix@ not $(prefix). - * util/Makefile.in (exec_prefix): Use @exec_prefix@ not $(prefix). - * libtxi/Makefile.in (exec_prefix): Use @exec_prefix@ not $(prefix). +Thu Oct 13 02:19:43 1994 Richard Stallman <rms@mole.gnu.ai.mit.edu> - * emacs/Makefile.in (uninstall): New target. - (install): Use the definition of $(lispdir), don't dynamically - find it. Use INSTALL_DATA not cp. - (exec_prefix): use @exec_prefix@ not $(prefix). + * texinfo.tex (\ifhtml, \html, \enddots, \?, \!): New commands. - * makeinfo/makeinfo.c (apply): If there isn't an actual argument - for a named argument, default it to "". +Fri Sep 16 16:30:52 1994 Richard Stallman <rms@mole.gnu.ai.mit.edu> - * Makefile.in (VERSION): Now at 3.5. - (texinfo): Make ./makeinfo/makeinfo depend on sub-all for parallel - makes. + * texinfo.tex (\defheaderxcond): New macro. + (\deftypefnheaderx): Use defheaderxcond when calling defname. + (\deftypefunheaderx, \deftypevarheader, \deftypevrheader): Likewise. - * emacs/Makefile.in (ELISP_OBJS): Explictly declare .el and .elc - in the SUFFIXES list. +Fri Aug 26 03:08:08 1994 Amy Hendickson <amyh@ai.mit.edu> - * makeinfo/makeinfo.c (cm_today): Special case for losing alpha. - * (minor_version): Increase to 63. + * texinfo.tex (\multitable): New command. - * info/info.c (version_string): Now at 2.14. - * info/tilde.c: Declare getenv to return (char *). - * info/window.c (build_message_buffer): Jump through hoops to keep - DEC Alpha's happy. +Mon Aug 1 14:28:57 1994 Richard Stallman <rms@mole.gnu.ai.mit.edu> - * info/xmalloc.c: Declare malloc and realloc as (void *) returning - functions. + * texinfo.tex (\changepagesizes, \afourlatex): New macros. -Sun Jun 18 12:47:21 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu> +Tue Jul 12 11:45:58 1994 Karl Berry (karl@cs.umb.edu) - * emacs/detexinfo.el (detexinfo-line-cmds-without-arg): - Handle ifhtml. + * texinfo.tex (\quotation): Set \parskip to zero to avoid extra + space below the environment. + (\quotation): Clean up comments and indentation. -Fri Jun 16 13:48:14 1995 Brian Fox <bfox@albert.gnu.ai.mit.edu> +Wed Jul 13 05:36:40 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * util/texindex.c: Update TEXINDEX_VERSION_STRING for texinfo 3.4 + * texinfo.tex (\xrefX): Put back, and correct, the test of + SETxref-automatic-section-title. - * (All *.c *.h *.in): Change FSF old address to new. - * texinfo.texi (Obtaining TeX): Change FSF old address to new - address. Change Old phone numbers to new phone numbers. +Thu Jul 7 15:57:52 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * Makefile.in (VERSION): Change to 3.4. + * Set catcodes of chars 128-255 to \other. -Thu Jun 15 22:49:07 1995 Robert J. Chassell <bob@hill.gnu.ai.mit.edu> +Mon Jul 4 15:32:41 1994 Karl Berry (karl@cs.umb.edu) - * texinfo.texi, emacs/=development/cover.texi: update - Texinfo distribution package version number + * texinfo.tex (\tie): Set \catcode of @ to 11 before using \@M. -Thu Jun 15 09:23:02 1995 Brian J. Fox <bfox@wizard.datawave.net> + * texinfo.tex (\xrefX): Undo \turnoffactive while printing the node + name, so _ in node names doesn't come out as the dot accent. - * info/info.c: (minor_version): Set to 13. +Sat Jul 2 14:49:26 1994 Karl Berry (karl@cs.umb.edu) - * info/clib.c,h: New files gather together replacement functions - for those POSIX-style C library functions that are not present on - the target system. + * texinfo.tex (\tie): Ensure we're in horizontal mode before the + \penalty. - * info/Makefile.in (SRCS): Add clib.c and clib.h. makedoc now - needs clib.o to build on systems missing various string.h stuff. +Tue May 10 01:21:28 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * info/variables.c (whole file): Call strdup, not savestring. - * info/tilde.c (whole file): Call strdup, not savestring. - * info/search.c (whole file): Call strdup, not savestring. - * info/nodes.c (whole file): Call strdup, not savestring. - * info/nodemenu.c (whole file): Call strdup, not savestring. - * info/man.c (whole file): Call strdup, not savestring. - * info/makedoc.c (whole file): Call strdup, not savestring. - * info/m-x.c (whole file): Call strdup, not savestring. - * info/info.c (whole file): Call strdup, not savestring. - * info/indices.c (whole file): Call strdup, not savestring. - * info/echo_area.c (whole file): Call strdup, not savestring. - * info/session.c (whole file): Call strdup, not savestring. - * info/filesys.c (whole file): Call strdup, not savestring. + * texinfo.tex (\donoderef, \unnumbnoderef, \appendixnoderef): + Set \lastnode globally. - * makeinfo/makeinfo.c (minor_version): Change to 1.62. - * makeinfo/makeinfo.c (get_execution_string): Initialize `i' to 0 - in case there are no execution_strings. +Sun Apr 17 15:35:43 1994 Karl Berry (karl@ra.cs.umb.edu) -Wed Jun 14 17:48:06 1995 Brian J. Fox <bfox@wizard.datawave.net> + * texinfo.tex (\~): Define to be a tie. + (\ptextilde): New defn to save the plain's tilde accent. + (\tex): Restore plain tilde. - * texinfo.texi: include "texinfo.tex", not "texinfo". - * info/session.c (forget_window_and_nodes): Place a sequence point - in between "info_windows[i] = info_windows[++i];" as per various - compiler experts. +Sun Mar 27 23:35:17 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * makeinfo/makeinfo.c (strdup): Create this function if the system - doesn't have it. - (discard_insertions): Use the insertion's filename, not the - current input file. - (push_insertion): Remember the current input file with each - insertion. - (pop_insertion): Free storage used by remembered input file. + * texinfo.tex (\smallbook): Set \defbodyindent and \deftypemargin. - * makeinfo/makeinfo.c (whole file): Use `strdup' instead of - `savestring'. - * configure.in: Check for `strdup'. +Sun Mar 20 19:47:59 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) -Wed Jun 14 15:58:51 1995 Brian Fox <bfox@albert.gnu.ai.mit.edu> + * texinfo.tex (\xrefX): Define and use \correctnodename. + (@turnoffactive): Move after @ becomes available + and turn off backslash as well as other chars. Use @realbackslash. + (@normalturnoffactive): Like @turnoffactive but use @normalbackslash. - * libtxi/Makefile.in (prefix): Use @prefix@, not /usr/local/ +Sat Mar 19 12:26:25 1994 Karl Berry (karl@cs.umb.edu) -Wed Jun 14 10:50:57 1995 Brian J. Fox <bfox@wizard.datawave.net> + * texinfo.tex (\singlespaceskip): Increase to 12.5pt. + (\singlespace): Call \setleading instead of just assigning to + \baselineskip, so the strut box will be reset. + (\smalllispx): Likewise. - * Makefile.in (DISTFILES): Don't include *.elc files in the list - of files to distribute. - (installdirs): Include `emacs' in the list of sub-dirs with - Makefile.in's. +Sun Mar 13 20:32:28 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * emacs/elisp-comp: Shell script which batch compiles the *.el files. - * emacs/Makefile.in: New file contains targets to build the elc files. - * configure.in: Add `emacs/Makefile' to the list of created makefiles. - * makeinfo/makeinfo.c (whole file): Give every function a return - type. All cm_xxx functions are now void. Add declarations for - functions to top of file. + * texinfo.tex (\dots): Change back to \ldots. -Mon Jun 12 12:00:57 1995 Brian J. Fox <bfox@wizard.datawave.net> +Sat Mar 12 22:34:10 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * info/man.c (reference_section_starters): Add versions of "SEE - ALSO" and "RELATED INFORMATION" with tabs instead of spaces as - well. + * texinfo.tex (\indexnofonts): Add %'s to suppress newlines after \def. - * util/texindex.c: Back out changes for OFF_T. Explicity coerce - the result of lseek to a long, and use longs everywhere. +Sat Feb 26 15:51:37 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * texinfo.texi: Change "@end shorttitlepage" to "@end titlepage". - * makeinfo/makeinfo.c: Make @shorttitlepage ignore the rest of the - line. + * texinfo.tex (\deftexinfoversion): New macro. + (\texinfoversion): Define using \deftexinfoversion. - * util/texindex.c (strrchr): Create if not present. - Test for HAVE_STRCHR and HAVE_STRING_H. - (main): Make PROGRAM_NAME be just the last path componenet of argv[0]. - (decode_command): Rewrite. - (usage): Rewrite. Now texindex handles --version. +Wed Jan 26 12:40:52 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * makeinfo/makeinfo.c (make_index_entries_unique): Rewrite from - scratch. + * texinfo.tex (\putwordSee, \putwordInfo, \putwordfile) + (\putwordChapter, \putwordAppendix, \putwordSection) + (\putwordsection, \putwordpage) + (\putwordTableofContents, \putwordShortContents): New macros. + Used in various places instead of fixed words. - * Don't distribute created info files with texinfo. After all, - the user will have the tools necessary to create them, yes? +Mon Jan 24 22:51:36 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * Makefile.in (distclean): Remove *.log + * texinfo.tex (\ignoremorecommands): Turn off @item and @message. - * info/man.c (read_from_fd): Change timeout value for select to 15 - seconds. Some systems (e.g., albert.ai.mit.edu) actually need - more than 10 seconds to format a man page. +Thu Jan 20 17:01:53 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * info/tilde.c: Fix typo in declaration for - `tilde_expansion_failure_hook'. + * texinfo.tex (\indexnofonts): Treat accents as dummies. + Turn modified European letters into one or more ordinary letters. -Wed Jun 7 13:36:53 1995 Brian Fox <bfox@albert.gnu.ai.mit.edu> +Tue Jan 18 14:54:32 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * info/tilde.h: Change type of tilde_expansion_failure_hook to - a pointer to a function returning a (char *). - * info/tilde.c: Change type of tilde_expansion_failure_hook to a - pointer to function returning a (char *). + * texinfo.tex (\indexdummies): Handle tex accents and European letters. - * makeinfo/makeinfo.c (get_execution_string): Don't use `i' in the - latter assignment, use `execution_strings_index' instead. +Wed Nov 24 16:11:51 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * texinfo.tex (\dots): Use $\,$ for spacing. + +Sun Nov 21 22:16:21 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * texinfo.tex (\dots): Avoid using \ldots; use periods and kern. + (\indexdotfill): Use italic periods. + +Fri Nov 19 20:50:31 1993 Roland H. Pesch (pesch@apple-gunkies.gnu.ai.mit.edu) + + * texinfo.tex (\deftypefunargs): use \tclose rather than \code to + avoid side effects on active chars - * info/man.c (read_from_fd): Change logic to avoid using FIONREAD. +Tue Sep 28 16:01:58 1993 Roland H. Pesch (pesch@apple-gunkies.gnu.ai.mit.edu) - * info/xmalloc.c (xrealloc): Use (void *), not (caddr_t *). - * info/xmalloc.c (xmalloc): Use (void *), not (caddr_t *). + * texinfo.tex (\obeyedspace defn): remove blank after \sepspaces + (left destructive penalty in vertical list) - * Makefile.in (DISTFILES): Don't find RCS no "=" directories. +Mon Aug 30 14:17:27 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - * util/Makefile.in (prefix): Use @prefix@ as the value. - * info/Makefile.in (prefix): Use @prefix@ as the value. - * makeinfo/Makefile.in (prefix): Use @prefix@ as the value. + * texinfo.tex (\setref, \unnumbsetref, \appendixsetref): Uncomment + \dosetq for title. + (\Ytitle): Define as \thissection instead of \thischapter. + (\xrefX): If there is no printed-title arg given, and @ifset + xref-automatic-section-title, try to use the real section title. -Wed Jun 7 12:29:28 1995 Robert J. Chassell <bob@hill.gnu.ai.mit.edu> +Tue Jul 27 12:47:24 1993 Charles Hannym (mycroft@trinity.gnu.ai.mit.edu) - * texinfo.texi: Correct minor typos. + * texinfo.tex (\ifitemxneedsnegativevskip): New \if; set immediately + following a short \item. + (\itemxpar): \par and then if \ifitemxneedsnegativevskip is set, do + a \vskip-\parskip. + (\internalBitemx, \internalBxitemx, \internalBkitemx): Use \itemxpar + rather than \par. + (\itemzzz): Set \ifitemxneedsnegativevskip as appropriate. - * emacs/texinfmt.el: Don't require @shorttitlepage to be inside - of @iftex ... @end iftex +Thu Jul 22 16:08:33 1993 Charles Hannum (mycroft@trinity.gnu.ai.mit.edu) -Mon May 8 18:33:52 1995 Brian J. Fox <bfox@wizard.datawave.net> + * texinfo.tex (\titlezzz, \finishtitlepage): Explicitly make hrules + have a width of \hsize so they aren't too long in smallbook format. - * info/nodes.c: #include "man.h" if HANDLE_MAN_PAGES. - (info_get_node_of_file_buffer): If the file buffer is one - associated with manpages, call the manpage node finding - function instead. - (info_find_file_internal): If the file buffer is one associated - with manpages, avoid doing any file I/O. - (info_reload_file_buffer_contents): Ditto. - (info_find_file_internal): Call create_manpage_file_buffer instead - of info_load_file_internal. +Tue Jun 29 15:56:19 1993 Roland H. Pesch (pesch@fowanton.cygnus.com) - * info/info.c: #include "man.h" if HANDLE_MAN_PAGES. - (main): If the initial node cannot be found, perhaps find it as a - manpage. - * info/info-utils.c: #include "man.h" if HANDLE_MAN_PAGES. - (info_xrefs_of_node): If handling man pages, and this is a manpage - node, use xrefs_of_manpage. + * texinfo.tex (\deftypefnheaderx): call \normalparens to permit + normal typesetting of strings (e.g. for C++ docn) containing `&' - * info/session.c (info_set_input_from_file): Only fclose (stream) - if it is non-null and not stdin. - #include "man.h" if HANDLE_MAN_PAGES. - (info_menu_or_ref_item): If handling man pages, and this is a - manpage node, get the xrefs from manpage_xrefs_in_binding. - (info_man): Compile in for M-x man if handling man pages. - (info_move_to_xref): If handling man pages, and the current node - is a manpage node, use locate_manpage_xref to get xrefs. +Fri Jun 25 14:08:44 1993 Roland H. Pesch (pesch@fowanton.cygnus.com) -Thu May 4 08:55:23 1995 Brian J. Fox <bfox@wizard.datawave.net> + * texinfo.tex (\nestedignore): turn off \ind... fonts too + (primarily for use within @smallexample) - * info/info.c (main): If the output device is not a terminal, and - no output filename has been specified, make user_output_filename - be "-", so that the info is written to stdout, and turn on the - dumping of subnodes. +Wed Jun 23 11:58:48 1993 Jim Kingdon (kingdon@wombat.gnu.ai.mit.edu) -Thu Apr 13 18:05:06 1995 Daniel Hagerty <hag@churchy.gnu.ai.mit.edu> + * longopts.table: Update GDB options. - * texinfo.texi: Fixed @end titlepage/@end shorttitlepage +Sun Jun 20 22:00:11 1993 Roland McGrath (roland@churchy.gnu.ai.mit.edu) -Sat Apr 8 12:51:49 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> + * lgpl.texinfo: Use @smallexample instead of @example. Reformat + example disclaimer to avoid overfull \hbox. - * makeinfo/makeinfo.c [! HAVE_STRERROR] (strerror): New function, - snarfed from ../info/filesys.c. - (cm_infoinclude): Use strerror instead of sys_errlist. +Mon Jun 14 04:09:47 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) -Tue Apr 4 18:44:00 1995 Brian J. Fox <bfox@wizard.datawave.net> + * texinfo.tex (\entry): Don't make a line of dots + if there are no page numbers. - * util/texindex.c (sort_offline): Change TOTAL to be an off_t. - * util/texindex.c (sort_in_core): Change TOTAL to be an off_t. - * util/texindex.c (MAX_IN_CORE_SORT): Cast to off_t. +Fri Jun 11 16:35:23 1993 Karl Berry (karl@cs.umb.edu) -Sun Apr 2 16:20:13 1995 Brian J. Fox <bfox@wizard.datawave.net> + * texinfo.tex (\defparsebodycommon): New macro from \defvrparsebody. + (\deftpparsebody): Call it; can't use \defvrparsebody. + (\deftpheaderline, \removeemptybraces): New macros. - * info/Makefile.in: Define DEFAULT_INFOPATH in case we are - compiling in the current directory. - * info/Makefile.in (info.o): Add filesys.h because of DEFAULT_INFOPATH. - * info/(search.c,h, nodes.c info-utils.c) Use strcasecmp and - strncasecmp instead of stricmp and strnicmp. Define strcasecmp - and strncasecmp in search.c if !HAVE_STRCASECMP. - * info/search.c: If HAVE_STRING_H include it. - * info/nodes.c: If HAVE_STRING_H include it. - * info/info-utils.c: If HAVE_STRING_H include it. - * info/info.h: If HAVE_STRING_H include it. - * configure.in (AC_HAVE_FUNCS): Check for strcasecmp. - * makeinfo/makeinfo.c (strcasecmp): Define if !HAVE_STRCASECMP. - * makeinfo/makeinfo.c (entire file): Use `strcasecmp' instead of - `stricmp'. - * makeinfo/makeinfo.c (cm_ifeq): New command takes three args. - Compares first two, executes remainder if the first two are - string-wise eq. - * makeinfo/makeinfo.c (ifhtml): Add to command list. Shouldn't be - used, but it is by people who don't want to hack macros. +Sat May 8 10:49:25 1993 Karl Berry (karl@cs.umb.edu) -Sat Apr 1 09:20:14 1995 Brian J. Fox <bfox@wizard.datawave.net> + * texinfo.tex (\itemzzz): Only change \parskip temporarily, and + unskip by it later if the item text is on its own line. - * makeinfo/makeinfo.c (begin_insertion): Fix reversed arguments to - line_error. + * texinfo.tex (\tablez): Do \afterenvbreak before the \endgroup, + so the \parskip value is the table's, not the surrounding text's. + (\vtable, \ftable, \itemizey): Likewise. + Note: for most environments, \nonfillfinish deals with this. - * info/info-stnd.texi: Use "end" footnote style instead of "separate". + * texinfo.tex (\smalllisp): New definition for non-small case, a + la @smallexample. - * info/Makefile.in: Change "rm -f" to $(RM). + * texinfo.tex: Delete \message{} at beginning; it does nothing. - * info/general.h: Define zero_mem in terms of memset if we have - it, else in terms of bzero if we have that, else as inline code. + (These changes are all trying to make space above and below + environments more equal.) + * texinfo.tex (\singlespace): Don't insert a kern. + (\group): Do \offinterlineskip, and reset \par to insert a blank + line's worth of space. + (\lisppar): Delete meaningless call to \obeyspaces before making + the definition. + (\Elisp [the outer one]): Rename to \nonfillfinish, and end the + paragraph before the group. + (\lisp): Set \Elisp (the inner one) to \nonfillfinish + (\example, \smallexample, \display, \format, \flushleft, + \flushright, \quotation): Use \nonfillfinish. + (\lineskipfactor, \strut{height,depth}percent): Set to more exact + values. + (\setleading): Set \normallineskip and call \normalbaselines, for + cleanliness. - * info/NEWS: Updated to reflect changes in 2.11. +Thu May 6 16:00:59 1993 Jeffrey Osier (jeffrey@deneb.cygnus.com) -Fri Mar 31 22:38:31 1995 Brian J. Fox <bfox@wizard.datawave.net> + * texinfo.tex (\ignoremorecommands): Turn off \set and \clear. - * Makefile (DISTFILES): Don't include *.a, *orig, nor *.e - files. - (DISTFILES): +Tue Apr 20 17:02:34 1993 Roland H. Pesch (pesch@apple-gunkies.gnu.ai.mit.edu) -Sat Mar 4 12:16:29 1995 Brian J. Fox <bfox@wizard.datawave.net> + * texinfo.tex (\codex): Delete space. - * Makefile.in: Use @prefix@ instead of hardwired `/usr/local'. - Clean up makefile rules which make in subdirs. - (ALL_SUBDIRS): Add makeinfo/macros to list of subdirectories. +Thu Apr 15 14:59:04 1993 Roland H. Pesch (pesch@fowanton.cygnus.com) - * configure.in (AC_CHECK_FUNCS): Add `bcopy' to list of things to - check for. + * texinfo.tex (\ignoremorecommands): Turn off @raisesections, @up, + @lowersections, @down within false conditionals. -Fri Mar 3 13:54:10 1995 Robert J. Chassell <bob@hill.gnu.ai.mit.edu> +Sun Apr 18 04:33:13 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * texinfo.texi: Minor changes for incremental new edition 2.20. + * texinfo.tex (\code): Define - and _ to permit line-breaking + despite the fact that hyphenation is disabled. + (\codex, \codedash, \codeunder): New macros. -Fri Mar 3 19:01:36 1995 Brian J. Fox <bfox@wizard.datawave.net> +Tue Mar 16 18:19:16 1993 Roland H. Pesch (pesch@fowanton.cygnus.com) - * filesys.c (filesys_read_info_file): Local variable ST_SIZE is a - long which has the value of finfo->st_size casted to it. - * nodes.c (whole file): Similar changes. + * texinfo.tex (\ignoremorecommands): Turn off @printindex within + false conditionals. - These changes and the following for makedoc.c were required for - proper operation on HPm68k NetBSD. +Sun Mar 14 10:47:36 1993 Karl Berry (karl@cs.umb.edu) -Mon Feb 27 15:16:27 1995 Brian J. Fox <bfox@wizard.datawave.net> + * texinfo.tex (\footnote): Don't bother to take the footnote text + as an argument, and hence don't define as \long. + (\footnotezzz): Do \footstrut after we start the paragraph. + (Also reformat these macros to make them easier to read.) - * makedoc.c (process_one_file): Local variable FILE_SIZE is a long - which has the value of finfo.st_size casted to it. +Fri Feb 26 13:02:44 1993 Roland H. Pesch (pesch@fowanton.cygnus.com) + * texinfo.tex (@include): Use \thisfile rather than #1 as \input arg. -Fri Mar 3 18:58:38 1995 Brian J. Fox <bfox@wizard.datawave.net> + * texinfo.tex (\readauxfile): Call \warnedobstrue to turn off warning + re TeX 3.0 on second and subsequent runs. - * makeinfo.c (find_and_load): Cast fileinfo.st_size to a long for - internal use. This makes things work on NetBSD. +Thu Feb 25 18:03:38 1993 Karl Berry (karl@cs.umb.edu) + * texinfo.tex (\realeverypar): Delete, as it was unused. -Fri Mar 3 13:54:10 1995 Robert J. Chassell <bob@hill.gnu.ai.mit.edu> + * texinfo.tex (\group): Do a \strut in \everypar. - * texinfo.texi: Minor changes for incremental new edition 2.20. +Mon Feb 22 17:10:06 1993 Karl Berry (karl@claude.cs.umb.edu) -Fri Mar 3 09:41:39 1995 Brian J. Fox <bfox@wizard.datawave.net> + * texinfo.tex (\obeyedspace): Define to be whatever \sepspaces + does (and move the definition to after \sepspaces). - * configure.in (TERMLIBS): Use AC_CHECK_LIB instead of - AC_HAVE_LIBRARY. +Wed Feb 17 01:55:20 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) -Mon Jan 9 16:55:31 1995 Brian Fox <bfox@churchy.gnu.ai.mit.edu> + * texinfo.tex (\nonfillstart): Do \singlespaces and \let\par + before \obeylines. - * Makefile.in (DISTFILES): Add the directory EMACS-BACKUPS to the - list of things to avoid distributing. +Fri Feb 12 12:32:56 1993 Roland H. Pesch (pesch at el_bosque.cygnus.com) -Tue Nov 29 17:48:37 1994 David J. MacKenzie <djm@duality.gnu.ai.mit.edu> + * texinfo.tex (\obstexwarn): issue message re bug in TeX 3.0. + (\nullfont): commented-out redefinition, to enable w/TeX 3.0. + (\nestedignore): call \obstexwarn for manuals that may trip bug - * configure.in: Check for off_t. - * util/texindex.c (main): Use it. + * texinfo.tex (\nestedignore): avoid @tex contents with \doignore -Fri Nov 11 14:46:28 1994 David J. MacKenzie <djm@duality.gnu.ai.mit.edu> +Thu Feb 11 15:41:06 1993 Roland H. Pesch (pesch@fowanton.cygnus.com) - * configure.in: Update for Autoconf v2. + * texinfo.tex (\indexdummies): enable @dfn and @emph in index entries -Thu Oct 13 02:17:38 1994 Richard Stallman <rms@mole.gnu.ai.mit.edu> +Thu Feb 11 13:32:32 1993 Roland H. Pesch (pesch@fowanton.cygnus.com) - * emacs/detexinfo.el (detexinfo): Handle @!, @?, @^, @". + * texinfo.tex (\ignoremorecommands): ignore @include within + failing conditionals -Mon Aug 1 03:26:13 1994 Richard Stallman <rms@mole.gnu.ai.mit.edu> +Sat Feb 6 19:44:28 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * texindex.c: Move the memset define down past string.h include. + * texinfo.tex (\nestedignore): Set \globaldefs--make all defs local. -Tue Jun 28 14:21:43 1994 David J. MacKenzie (djm@churchy.gnu.ai.mit.edu) +Tue Feb 2 15:57:37 1993 Roland H. Pesch (pesch@fowanton.cygnus.com) - * makeinfo/makeinfo.c: Add --help option. - (usage): Take args for stream and error code. - Change callers. - (print_version_info): Write to stdout, not stderr. + * texinfo.tex (@raisesections, @lowersections): new commands. + * (@up, down): original BFox synonyms for above. + * (\numhead, \apphead, \unnmhead): internal macros to map headings + to appropriate level + * (@nwnode): new synonym for @node, used in newest + makeinfo -Wed May 18 18:55:24 1994 Brian J. Fox (bfox@ai.mit.edu) +Tue Jan 26 17:05:02 1993 Roland H. Pesch (pesch@fowanton.cygnus.com) - * info/session.c (forget_window_and_nodes): Negate test for - internal_info_node_p. We only want to free the text if it is - not an internal node. + * texinfo.tex (\include): avoid group around file contents -Thu Mar 10 03:07:18 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) +Tue Jan 19 18:58:56 1993 Roland H. Pesch (pesch@fowanton.cygnus.com) - * texindex.c (memset): Fix invalid parm name (was 0). + * texinfo.tex (\ignoremorecommands, used in \nestedignore): also + ignore cross-ref commands and \settitle + (\setyyy, used in @set): make definitions global + (\clearxxx, used in @clear): clear definitions globally -Thu Feb 10 12:56:52 1994 Noah Friedman (friedman@prep.ai.mit.edu) +Thu Jan 14 17:43:32 1993 Michael I Bushnell (mib@geech.gnu.ai.mit.edu) - * makeinfo/makeinfo.c (current_item_function): Don't loop if elt - is NULL. + * texinfo.tex: Added \shorttitlepage. -Wed Feb 9 12:21:09 1994 Brian J. Fox (bfox@ai.mit.edu) +Sat Jan 2 15:01:45 1993 Karl Berry (karl@cs.umb.edu) - * makeinfo/makeinfo.c (minor_version): Release now at 1.60. + * texinfo.tex (\tclose): Use \spaceskip instead of modifying + \fontdimen's to normalize the interword space. - * makeinfo/makeinfo.c (expand_filename): Additional fixes. Now - when called with NULL filename, makes an output filename from the - input filename. - (convert_from_loaded_file): If REQUIRE_SETFILENAME is #defined (no - longer the default case) then error if no @setfilename was found - in the file. If REQUIRE_SETFILENAME is not #defined, the input - file starts either at the first line, or at the second line if the - first line contains the text "\input", and the output filename is - the input file name without directory and with ".info" replacing - any extension found. - (convert_from_loaded_file): Fixed bug in search for first - occurence of "@setfilename". + * texinfo.tex (\t, \key, \tclose): Use \hyphenchar instead of + \exhyphenpenalty, to turn off hyphenation for real. + (\{no,restore}hyphenation): New macros. -Tue Feb 8 14:16:58 1994 Noah Friedman (friedman@prep.ai.mit.edu) +Sat Jan 2 15:01:45 1993 Karl Berry (karl@cs.umb.edu) - * configure.in: Check for sys/file.h. - info/dir.c, info/filesys.c, info/makedoc.c, info/nodes.c, - info/session.c, info/termdep.h, makeinfo/makeinfo.c - [HAVE_SYS_FILE_H]: Include <sys/file.h>. + * texinfo.tex (\t, \key, \tclose): Use \hyphenchar instead of + \exhyphenpenalty, to turn off hyphenation for real. + (\{no,restore}hyphenation): New macros. - * makeinfo/makeinfo.c (convert_from_loaded_file): Print - real_output_filename instead of output_filename, so user knows - exactly where output file is going. +Tue Jan 5 19:15:46 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) - Fri Jun 11 14:34:30 1993 Ian Lance Taylor (ian@cygnus.com) - * configure.in: Check for sigprocmask and sigsetmask. - * info/signals.h (HAVE_SIGSETMASK): Don't define. - (HAVE_SIGPROCMASK): Use instead of _POSIX_VERSION. - (BLOCK_SIGNAL, UNBLOCK_SIGNAL): If neither HAVE_SIGPROCMASK nor - HAVE_SIGSETMASK is defined, define these to do nothing. - * info/signals.c (sigprocmask): Don't compile if HAVE_SIGSETMASK - is not defined. + * texinfo.tex (\deftpparsebody): Make synonymous with \defvrparsebody. - * info/terminal.c (terminal_prep_terminal): Don't clobber VINTR - and VQUIT in conditionals. +Sun Dec 27 09:40:08 1992 Karl Berry (karl@cs.umb.edu) -Mon Feb 7 18:10:22 1994 Brian J. Fox (bfox@ai.mit.edu) + * texinfo.tex (\inforef, \inforefzzz): Use the \ignorespaces + primitive instead of \losespace. + (\losespace): Delete. - * makeinfo/makeinfo.c (full_pathname): Correct to really return - the full pathname of the input argument. Now makeinfo - /foo/bar.texi, where /foo/bar.texi contains "@setfilename - bar.info", correctly leaves the output file in "./bar.info". - Note that "@setfilename ../bar.info" still works; this is already - an absolute pathname. + * texinfo.tex (\menu, \direntry): Handle like \ifinfo. -Sat Feb 5 13:04:05 1994 Brian J. Fox (bfox@ai.mit.edu) + * texinfo.tex (\unmatchedenderror, \defineunmatchedend): New macros. + (\endxxx): Call it, instead of just doing it inline. + (\conditionalsucceed, \nece): More new macros. + (\iftex): Call \conditionalsucceed. + (\Eiftex): Define to give an error at the outer level. - * makeinfo/makeinfo.c: Version 1.59 released. + * texinfo.tex (\ignoremorecommands, \nestedignore): New macros. + (\ifset, \ifclear): Expand a macro on success as well as failure; + also switch to using expansion instead of assignments to act after + the conditional. + (\if{set,clear}succeed): Call \conditionalsucceed. + (\if{set,clear}fail): Call \nestedignore instead of \doignore. - * makeinfo/makeinfo.c (whole file): Large number of changes allow - the "-E filename" option to be used to write a macro expanded - output file. On a file which contains no @include's and no - @macro's, the output file is identical to the input file. + * texinfo.tex (\clear): Don't insert a spurious space. - * makeinfo/makeinfo.c (declarations): Remove cm_tex (). It is - never used since it is implemented with `command_name_condition'. + * texinfo.tex (\value): Put comment next to definition. - * makeinfo/makeinfo.c (add_char): Shift braces following the - current break point if we have deleted any characters. - (adjust_braces_following): New function adjusts all of the markers - in the brace stack which follow HERE by AMOUNT. This fixes a bug - where (for example) @var{} immediately following a line break - which is the end of a sentence modified the output incorrectly. + * texinfo.tex (\setyyy): Call \setzzz, and define the variable as + simply the parameter, no \unskip. + (\setzzz): New macro; do not globally define the variable. -Wed Feb 2 14:14:03 1994 Brian J. Fox (bfox@ai.mit.edu) +Thu Dec 3 17:24:05 1992 Roland H. Pesch (pesch@fowanton.cygnus.com) - * makeinfo: Version 1.58. + * texinfo.tex (croppageout): use same escape-char switching as + default output routine. Permits using _ in TOC entries. - * makeinfo/makeinfo.c (cm_node): Add extra hair to allow - backtracking through execution strings. Add extra hair to allow - the first node seen after a @top node is seen to adjust the - sectioning level of the @top node and associated menus. - Fix a few typos. - Add facility for macros to invoke the original definition. This - works by not allowing a single macro to recurse. Mutual recursion - is also disallowed with this plan. +Fri Nov 13 17:35:38 1992 Charles Hannum (mycroft@gnu.ai.mit.edu) - * makeinfo/macros: New directory contains shippable macros. - * makeinfo/macros/simpledoc.texi: Macros which simplify the most - common uses of TeXinfo. See the example file. - Macros are now a reasonable way to get people started using - TeXinfo. + * texinfo.tex (indexing): Rewrote double-column mode to fix a + rare breakage. -Mon Jan 31 12:54:36 1994 Brian J. Fox (bfox@ai.mit.edu) +Sun Oct 25 07:13:31 1992 Karl Berry (karl@cs.umb.edu) - * makeinfo/makeinfo.c (minor_version): Increase to 57. + * texinfo.tex (\obeyedspace): No need to define with \gdef, we're + at the outer level. - * makeinfo/makeinfo.c (cm_node): Call execute_string on the node, - next, prev, and up pointers. - (reader_loop): Change logic for `@bye'. No longer required at the - ends of executed strings. - (execute_string): Do not append `@bye' to the string to execute. +Fri Oct 16 18:04:40 1992 Roland McGrath (roland@geech.gnu.ai.mit.edu) - * makeinfo/makeinfo.c (whole file): Use COMMAND_PREFIX instead of - hardcoding `@' character in strings and searches. + * lgpl.texinfo: Change "This program" to "This library" in example + copying notice. - * makeinfo/makeinfo.c (read_command): If HAVE_MACROS is defined, - then recognize and execute macros here. - (CommandTable): Add "macro" and "unmacro" to table if HAVE_MACROS - is defined. +Sat Oct 10 09:43:45 1992 Karl Berry (karl@cs.umb.edu) - * makeinfo/makeinfo.c (cm_macro, cm_unmacro, execute_macro) - makeinfo/makeinfo.c (get_macro_args, find_macro, add_macro) - makeinfo/makeinfo.c (delete_macro, array_len, apply): - New functions implement macro facility if HAVE_MACROS is - defined. + * texinfo.tex (\bullet, \minus): Use \implicitmath instead of $. - * makeinfo/macro.texi (new file): Examples of using the new macro - facility. +Fri Oct 2 08:35:51 1992 Karl Berry (karl@cs.umb.edu) -Mon Jan 31 10:24:52 1994 Noah Friedman (friedman@prep.ai.mit.edu) + * texinfo.tex (\Egroup): Don't do the \strut and \nointerlineskip. - * makeinfo/makeinfo.c (executing_string): Restore global - declaration. +Sat Sep 26 09:08:59 1992 Karl Berry (karl@cs.umb.edu) -Mon Jan 24 23:48:26 1994 Noah Friedman (friedman@prep.ai.mit.edu) + * texinfo.tex (\doignore, \enddoignore): New macros. + (\ifinfo): Call \doignore. + (\ifxinfoxxx): Deleted. + (\ignore, \ifsetfail, \ifclearfail): use \doignore. - * texinfo.texi: Various typo fixes from Bob Chassell - <bob@gnu.ai.mit.edu>. + * texinfo.tex (\unnumbered): Expand the arg only once for the \message. -Thu Jan 6 13:34:21 1994 Noah Friedman (friedman@prep.ai.mit.edu) + * texinfo.tex (\deftpparsebody, \parsetpheaderline): New macros. + (\deftp): Call \deftpparsebody. - * texinfo.texi: Turned on smallbook format and @set smallbook. +Thu Sep 24 10:12:45 1992 Karl Berry (karl@cs.umb.edu) -Wed Dec 15 20:08:43 1993 Noah Friedman (friedman@prep.ai.mit.edu) + * texinfo.tex (\entry): Do \par first; add comments. + (\short{chap,unnumbered}entry,\do{chap,sec,subsec,subsubsec}entry): + Call \tocentry, instead of using \vbox. + (\tocentry): New macro. - * info/filesys.h (DEFAULT_INFOPATH): Added /usr/local/info, - /opt/gnu/info, /usr/share/info, and /usr/local/share/info. +Sat Sep 19 14:36:11 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) -Tue Dec 14 19:10:20 1993 Noah Friedman (friedman@prep.ai.mit.edu) + * texinfo.tex (\`, \'): Definitions deleted. - * libtxi/Makefile.in (ALLOCA): Define from configure. +Fri Sep 18 14:33:09 1992 Roland H. Pesch (pesch@cygnus.com) -Fri Dec 10 04:33:12 1993 Noah Friedman (friedman@prep.ai.mit.edu) + * texinfo.tex (\ifset, \ifclear): Standardize catcode of space as + for \ignore. - * util/texi2dvi: Put under RCS control. +Fri Sep 11 15:25:01 1992 Karl Berry (karl@hayley) -Sun Dec 26 11:55:46 1993 Brian J. Fox (bfox@ai.mit.edu) + * texinfo.tex (\finalout): Move out of final section of file, + which claims not to define new control words. - * info/session.c (info_numeric_digit_arg_loop): Fix doc string. + * texinfo.tex (\setleading): New macro. + (outer level, @smallbook, @afourpaper): Call it, instead of + setting \baselineskip directly. - * info/infodoc.c (create_internal_info_help_node): Print out list - of functions which have to keystroke equivalent if we support - NAMED_FUNCTIONS. + * texinfo.tex (\|): New definition for changebars. - * info/filesys.c (compress_suffixes): Add ".gz" for "gunzip" to - alist. +Tue Sep 1 17:32:48 1992 Karl Berry (karl@hayley) - * info/footnotes.c (make_footnotes_node): If refs[i] doesn't have - a nodename, then it couldn't be a reference to a footnote. + * texinfo.tex (\begindoublecolumns): Exactly double \vsize. - * info/nodemenu.c (get_visited_nodes): Handle the case where - filter_func has left no possible buffers to select. +Sat Aug 29 10:12:16 1992 Karl Berry (karl@hayley) -Sat Dec 25 10:35:56 1993 Brian J. Fox (bfox@ai.mit.edu) + * texinfo.tex (\group): Define \Egroup to use struts instead of + letting TeX do its own interline spacing. - * info/infodoc.c (create_internal_info_help_node): Conditionalize - generation of the help node based on the #define - HELP_NODE_GETS_REGENERATED. When this is not set (the default) - the help node is generated exactly once, and is not gc'able. - Otherwise, a new node is always created for the help window, and - the old node gets garbage collected by the gc system. - (info_find_or_create_help_window): Conditionalize window node - selected based on the #define HELP_NODE_GETS_REGENERATED. + * texinfo.tex (\{remove,ignore}activespaces): New macros. + (\end): Call \removeactivespaces; give the correct error messages; + don't try to expand a nonexistent \E... macro. - * info/dir.c (add_menu_to_file_buffer): Place exactly one blank - line between directory entries. + * texinfo.tex (\EMsimple): End the help message with a period. - * info/info.c (version_string): Update minor version to "11". + * texinfo.tex (\gobble): New macro. + (\lisp): Call it (instead of defining it every time). + (\example, \smallexample): Define \E... within the macro. - * info/info.h: Update comment to "2.11". +Tue Aug 25 11:56:26 1992 Roland H. Pesch (pesch@fowanton.cygnus.com) - * info/dir.c (maybe_build_dir_node): Only add the contents of a - new file if it is not identical to the file of the DIR buffer. + * texinfo.tex (\readauxfile): Make + normal while reading aux file. - * info/nodes.c (info_get_node): Call `maybe_build_dir_node' on - "dir" as well as "localdir" to mimic emacs-19.22 "dir" merging - behaviour. +Thu Aug 20 21:32:34 1992 Karl Berry (karl@hayley) -Fri Dec 3 13:41:44 1993 Brian J. Fox (bfox@ai.mit.edu) + * texinfo.tex (\doublecolumnhsize): Compute value in + \begindoublecolumns. + (\afourpaper, \smallbook, <outer level>): Remove these (virtually + identical) computations. - * info/info-utils.c (canonicalize_whitespace): Suppress whitespace - found at the start of STRING. + * texinfo.tex (\doublecolumnvsize): Deleted. + (\afourpaper, \smallbook): Don't compute it. + (\begindoublecolumns): Just double \vsize here (thus decreasing + the value considerably from the old value of 19.1in, which was far + too large.) -Sat Nov 20 14:00:50 1993 Brian J. Fox (bfox@hippie) +Fri Aug 14 10:16:42 1992 Karl Berry (karl@hayley) - * info/indices.c (DECLARE_INFO_COMMAND): Fix typo in assignment to - `old_offset' (= instead of ==). + * texinfo.tex (\parseargx): Use \expandafter instead of + \aftergroup to continue the processing. + (\parsearglinex): Renamed to \parseargline, since the former + \parseargline is no longer needed. -Tue Nov 2 12:22:40 1993 Brian J. Fox (bfox@ai.mit.edu) + * texinfo.tex (\parseargline) Remove a trailing @c or @comment. + (\argremovec, \argremovecomment): New macros. - * makeinfo/makeinfo.c (make_index_entries_unique): New function - makes a sorted array have all unique entries by appending numbers - to the ends of strings. - (sort_index): Call `make_index_entries_unique'. +Thu Aug 6 11:28:55 1992 Roland H. Pesch (pesch@fowanton.cygnus.com) -Mon Sep 20 12:04:05 1993 Brian J. Fox (bfox@ai.mit.edu) + * texinfo.tex: extended @set to define expandable vars; + @value expands same. Auxiliary macros \setxxx, \setyyy + used for @set. - * makeinfo/makeinfo.c (get_execution_string): New Function returns - a pointer to an EXECUTION_STRING structure. - (execute_string): No longer uses a static string; call - `get_execution_string' instead in order to get a free buffer for - consing. +Sun Aug 2 14:34:48 1992 Karl Berry (karl@hayley) -Sun May 23 07:00:20 1993 Noah Friedman (friedman@prep.ai.mit.edu) + * texinfo.tex (\entry): do line-breaking on the index entry. - * Texinfo 3.1 released. +Wed Jul 1 17:05:26 1992 Karl Berry (karl@claude.cs.umb.edu) -Sat May 22 18:21:27 1993 Noah Friedman (friedman@prep.ai.mit.edu) + * texinfo.tex (\lparen, \rparen): new definitions. + ((,[,],)): new global definitions for these four active + characters, so parens and brackets can be used in @deffn names. - * info/info.c (info_patch_level): Increment constant to 1. +Sat Jun 27 11:32:58 1992 Karl Berry (karl@hayley) - * info/Makefile.in (DEFAULT_INFOPATH): Default definition deleted. - Makefile.in: Put it here instead. - * Makefile.in (MDEFINES): Add DEFAULT_INFOPATH. + * texinfo.tex (\shortchaplabel): new macro to align chapter and + appendix labels. + (\shortchapentry): call it. + (\shortappendixwidth): new dimen register. - * configure.in: check for vfprintf and vsprintf. +Wed Jun 24 09:45:34 1992 Karl Berry (karl@hayley) - * makeinfo/makeinfo.c: Version 1.55. + * texinfo.tex (\afterenvbreak): make the same as \aboveenvbreak, + so space below environments doesn't get lost. + (\aboveenvskipamount): rename to \envskipamount, since it's used + both above and below. - * makeinfo/makeinfo.c (add_word_args, execute_string) [HAVE_VARARGS_H]: - Don't use this definition unless HAVE_VSPRINTF is also defined. - (error, line_error, warning) [HAVE_VARARGS_H]: Don't use this - definition unless HAVE_VFPRINTF is also defined. - Remove indentation of all cpp directives, except for #pragma. +Wed Jun 24 09:45:34 1992 Karl Berry (karl@hayley) -Fri May 21 14:34:24 1993 Noah Friedman (friedman@prep.ai.mit.edu) + * texinfo.tex (\group): do @comment at the end, to avoid excessive + white space when called inside @group. - * texinfo.texi: Rename to texi.texi. - Change @setfilenname and START-INFO-DIR-ENTRY to `texi.info'. +Wed Jun 24 16:36:04 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * Makefile.in (MDEFINES): Pass LDFLAGS to sub-makes. - (realclean): Delete `configure'. - Changed all references to texinfo.info to texi.info + * texinfo.tex (\startcontents): End page before setting pageno. - * configure.in: Add AC_PROG_RANLIB, and AC_CONST. - Check for `rindex' function. - Check for varargs.h. - Clean up symbol names for header files so a single AC_HAVE_HEADERS - can be used. - (AC_INIT): Use texi.texi instead of makeinfo/makeinfo.c +Thu May 28 20:27:25 1992 Robert J. Chassell (bob@hill.gnu.ai.mit.edu) - * info/info-utils.h: Copy definitions of bcopy, index, and rindex - (with appropriate #ifdef wrappers) from termdep.h. These are - included by a mutually exclusive set of files. + * texinfo.tex (\vtable): Like @ftable, but for variables. - * info/termdep.h [HAVE_SYS_PTEM]: Use HAVE_SYS_PTEM_H instead. +Fri May 22 07:04:32 1992 Karl Berry (karl@hayley) - * info/terminal.c, info/termdep.h [HAVE_TERMIO]: Use HAVE_TERMIO_H - instead. + * texinfo.tex (\w): do \leavevmode before the \hbox. - * info/makedoc.c, info/filesys.c [!O_RDONLY]: Include fcntl.h or - sys/fnctl.h, depending on whether HAVE_SYS_FCNTL_H is set. +Sat May 16 11:16:27 1992 Karl Berry (karl@hayley) - * info/termdep.h: Remove all indentation in #-exprs. - Remove old assumptions about bcopy, index, and rindex. - [HAVE_BCOPY]: Define bcopy. - [HAVE_RINDEX]: Define index and rindex. + * texinfo.tex (\smallbook): decrease \topskip somewhat. - * info/nodes.c (info_get_node): Don't call stricmp if nodename is - NULL. Remove indentation in #-exprs. + * texinfo.tex (\group): use \vtop instead of \vbox. - * info/echo_area.c (echo_area_stack_depth): Declare static. + * texinfo.tex (\newlinechar): define for use in help strings. + (\groupinvalidhelp): define this for use with \errhelp. + (\group): set \errhelp to above. - * info/Makefile.in (DEFAULT_INFOPATH): Make separate Makefile - variable so it can be overridden more easily by the user. Add `.' - to beginning of path. - (clean): Delete core.* (386bsd core files). - (MAKEDOC): Variable removed. Refer to `makedoc' explicitly. - (funs.h): Add `:' commands after if, to avoid spurious nonzero - exit statuses. +Thu Apr 30 16:19:17 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * info/userdoc.texi: Improved comments explaining its purpose. + * texinfo.tex (\need): Rewritten by karl. - * makeinfo/makeinfo.c [HAVE_VARARGS_H]: Include varargs.h. - (error, line_error, warning, add_word_args, - execute_string)[HAVE_VARARGS_H]: New versions that - use varargs. From bfox. +Sat Apr 18 16:24:00 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * makeinfo/Makefile.in (clean): Delete core.* (386bsd core files). + * texinfo.tex (\exdentamount): New var, set by environments. + (\exdent, \exdentyyy): Define suitably for filled environments. + Always exdent by innermost indentation step. + (\nofillexdent, \nofillexdentyyy): Alternates for nofill envs. + (\lisp, \smalllispx, \display): Set \exdent to \nofillexdent. - * util/Makefile.in (clean): Remove core.* (386bsd core files). +Thu Apr 2 15:04:15 1992 Robert J. Chassell (bob@kropotkin.gnu.ai.mit.edu) - * libtxi/Makefile.in: Remove all references to $(common). - (RANLIB): New variable, set from autoconf. - (libtxi.a): Use $(RANLIB) instead of `ranlib' in target rules. - (clean): Delete core.* (386bsd core files). + * texinfo.tex (\Esmalllisp): Smaller baseline skip for smallexamples. -Tue May 18 12:08:24 1993 Robert J. Chassell (bob at grackle.stockbridge.ma.us) +Sun Mar 29 20:44:49 1992 Brendan Kehoe (brendan@cs.widener.edu) - * emacs/texinfmt.el (texinfo-format-refill): Do not fill a section - title line with the asterisks, hyphens, etc. that underline - it in any circumstance. + * texinfo.tex (\startcontents): Always close contentsfile and + adjust the page. -Sun May 16 13:53:43 1993 Noah Friedman (friedman@prep.ai.mit.edu) +Fri Mar 27 17:41:52 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * util/mkinstalldirs: handle relative pathnames. + * texinfo.tex (\chapternofonts): Deal with \result, \equiv, etc. -Fri May 14 20:18:49 1993 Noah Friedman (friedman@prep.ai.mit.edu) +Sat Mar 21 08:22:29 1992 Karl Berry (karl at hayley) - * util/mkinstalldirs: initialize IFS if unset. + * texinfo.tex (\entry): format entries better if the page number + and entry text don't fit on one line. -Tue May 11 06:33:14 1993 Noah Friedman (friedman@prep.ai.mit.edu) + * texinfo.tex (\loggingall, \gloggingall): new macros to help with + debugging. - * makeinfo/makeinfo.c (cm_item): don't dereference item_func if NULL. +Fri Mar 20 15:35:42 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) -Mon May 10 14:50:31 1993 Noah Friedman (friedman@prep.ai.mit.edu) + * texinfo.tex (\result, \expansion, \print, \equiv): + Don't copy prefabricated boxes; must adapt to current font. + (\dblarrowbox, \longdblarrowbox, \pushcharbox, \equivbox): Deleted. + (\bullbox): Deleted. - * Texinfo 3.0 released. +Thu Mar 19 22:17:14 1992 Robert J. Chassell (bob@kropotkin.gnu.ai.mit.edu) - * Makefile.in (ALLOCA): Provide for substitution. + * texinfo.tex (\widowpenalty, \clubpenalty): Set them to 10000, since + 8000 did not work. -Mon May 10 10:12:53 1993 Noah Friedman (friedman@prep.ai.mit.edu) +Fri Mar 6 13:26:36 1992 Robert J. Chassell (bob@kropotkin.gnu.ai.mit.edu) - * emacs/texinfmt.el (texinfmt-version): Updated year. + * texinfo.tex (\widowpenalty, \clubpenalty): Set them to 8000, since + 2000 did not work (but \widowpenalty at 20000 did work). -Fri Apr 16 04:48:03 1993 Noah Friedman (friedman@prep.ai.mit.edu) +Thu Feb 27 12:27:14 1992 Karl Berry (karl@wombat.gnu.ai.mit.edu) - * makeinfo/makeinfo.c: Version 1.54 from bfox. + * texinfo.tex (\widowpenalty): set to 2000, not 20000. - * util/fixfonts: Replace instances of `[..]' with `test'. - Use more portable `test' arguments: `z$foo = z' instead of `! $foo'. - Robustify quoting in eval assignments. - (textfmdir, texpkdir, texgfdir): Don't override definition from - environment, if any. - Trap EXIT, SIGHUP, SIGINT, SIGQUIT, SIGTERM to delete temp files - instead of trying to remove them explicitly before calling exit. - When changing cwd, do so in subshell, in case various tex*dir - variables are relative. - Don't use `head', `dirname', or `basename'. These don't behave - consistently and/or don't even exist on some systems. They can - all be emulated with `sed' anyway. - (tempfile2_line1): New variable. Use it instead of running - process to extract first line out of tempfile2 multiple times. - Eliminate some gratuitous uses of $tempfile2, such as in for loops. +Sat Feb 8 14:34:45 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) -Fri Mar 26 23:25:13 1993 Noah Friedman (friedman@prep.ai.mit.edu) + * texinfo.tex (\widowpenalty, \clubpenalty): Set them to 2000. + (\itemizeitem): Use penalty 1200. + (\itemzzz): Add \nobreak near beginning. - * texinfo.texi: @setfilename texinfo.info. + * texinfo.tex (\quotation): Increase right margin, instead of + left margin twice. - * makeinfo/makeinfo.c (reader_loop, end_insertion): Fix typos in - comments. - (handle_variable_internal): Handle the case that there further - menu text after a false ifset/ifclear. +Wed Feb 5 12:08:30 1992 Karl Berry (karl at hayley) - * util/texi2dvi: Version 0.4 - Replace all instances of `[ ... ]' with `test'. - Updated bug-reporting address. + * texinfo.tex (\alphaenumerate, \capsenumerate): redefine as a call + to \enumerate. + (\{lower,upper}caseenumerate): Rename from \{alpha,caps}enumerate. -Thu Mar 25 12:31:30 1993 Noah Friedman (friedman@prep.ai.mit.edu) +Sun Feb 2 21:07:19 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * info/Makefile.in (install): Install info.1 man page. - (uninstall): Remove installed info.1 man page. + * texinfo.tex (\itemzzz): Compensate in line-by-itself case for + a table that is indented. - * info/infoman.texi: Standalone manual renamed to info-stnd.texi. - Makefile.in: Targets updated appropriately. +Mon Jan 13 21:04:07 1992 Richard Stallman (rms at mole.gnu.ai.mit.edu) - * info/Makefile.in (LDEFS): New variable. Use it for info-local - macros, since DEFS will be inherited from parent make and any - local definitions will get clobbered. + * texinfo.tex: Use 26 instead of control-z as character constant. - * info/RELEASE: Renamed to info/NEWS. +Sat Jan 11 02:20:58 1992 Roland McGrath (roland@albert.gnu.ai.mit.edu) - * README: New file. + * gpl.texinfo: Unfilled Yoyodyne example. - * Makefile.in (topclean): New target. +Sat Dec 7 16:16:54 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - * Getting-started: Renamed to INTRODUCTION. Former name is too - long (over 14 chars). + * texinfo.tex (\cartouche): Set \nonarrowing. + (\lisp, \smalllisp, \quotation, \display): If set, don't narrow. - * New-features: Renamed to NEWS. +Mon Dec 2 08:15:08 1991 Karl Berry (karl at hayley) - * Makefile.in (MDEFINES): Set it. + * texinfo.tex (\itemzzz): don't start a paragraph if the item text + is on a line by itself; don't allow a page break after that + line; always do \par before typesetting anything. - * Makefile.in (dist): Use --gzip option to tar to make sure - resulting file is compressed with gzip. Change tar file - extension from `.Z' to `.z'. +Tue Nov 26 15:13:13 1991 Roland McGrath (roland@albert.gnu.ai.mit.edu) - * Makefile.in (DISTFILES): Filter out any file or directory names - starting with `='. + * lgpl.texinfo: @ifset lgpl-appendix, use @appendix instead of + @unnumbered. - * fixfonts: Moved to util/fixfonts. +Sun Nov 10 12:00:06 1991 Karl Berry (karl at hayley) - * RELEASE: Deleted. + * texinfo.tex (\doprintindex): only \read if the file existed; + \closein the test stream in all cases. + (\initial, \entry): do not \outer, so that \read does not get an + error if the index exists. - * makeinfo/Makefile.in (VPATH): Use $(srcdir), not @srcdir@. - (common): Use ../libtxi, not ../common. - (makeinfo.in): Run makeinfo with --no-split. +Fri Nov 8 18:13:28 1991 Michael Bushnell (roland@churchy.gnu.ai.mit.edu) - * makeinfo/makeinfo.texi: Changes from bob. + * texinfo.tex (\itemizey): missing %'s in macro defn. + Also, add \begingroup; accidentally deleted by Karl Berry. - * util/Makefile.in (VPATH): Use $(srcdir), not @srcdir@. - (common): Use ../libtxi, not ../common. +Thu Nov 7 11:41:25 1991 Karl Berry (karl at hayley) - * util/fixfonts: Moved from top-level directory. + * texinfo.tex (\doprintindex): \read from the index file to make + \ifeof true when the file exists but is empty. -Wed Mar 24 10:21:31 1993 Robert J. Chassell (bob at grackle) +Tue Nov 5 08:29:13 1991 Robert J. Chassell (bob at grackle) - * emacs/texinfmt.el (texinfo-format-region): Do not require - `@setfilename' line; delete `\input texinfo' line if part of - region. + * texinfo.tex (@thischaptername): Provide default value for when + @chapter not defined. - * emacs/texinfmt.el (texinfo-raise-lower-sections): Raise or lower the - hierarchical level of chapters, sections, etc. according to - `@raisesections' and `@lowersections' commands. +Sat Nov 2 17:59:02 1991 Karl Berry (karl at hayley) -Thu Mar 18 16:02:27 1993 Robert J. Chassell (bob at grackle) + * texinfo.tex (\itemizezzz): do \begingroup here, since \itemizey + can't any longer. - * emacs/texinfo.el (texinfo-show-structure): Indent *Occur* buffer - according to the structure of the file. +Tue Oct 29 12:17:41 1991 Robert J. Chassell (bob at grackle) -Sat Mar 6 05:16:44 1993 Noah Friedman (friedman@prep.ai.mit.edu) + * texinfo.tex: @paragraphindent defined as a no op. - * util/texi2dvi: use ${1+"$@"}, not just "$@". +Fri Oct 25 15:19:47 1991 Karl Berry (karl at hayley) -Tue Feb 2 08:38:06 1993 Noah Friedman (friedman@prep.ai.mit.edu) + * texinfo.tex (\enumeratey): allow any lowercase letter, uppercase + letter, or number as argument; initialize \itemno and begin the + environment's group here. + (\itemizey): don't initialize \itemno here. + (\numericenumerate, \startenumeration): new macro. - * info/Makefile.in: Replace all "--nosplit" arguments to makeinfo - with "--no-split" +Wed Oct 23 16:26:30 1991 Richard Stallman (rms@mole.gnu.ai.mit.edu) -Sun Jan 31 18:16:58 1993 Noah Friedman (friedman@prep.ai.mit.edu) + * texinfo.tex (\ifclear, \ifset): Remove \outer. - * util/texi2dvi: Don't put .dvi and related auxillary files in same - directory as source files. Put them in current directory instead. - (TEXINPUTS_orig): New variable. - (file_texi): Variable removed. - (filename_texi): New variable. - (command_line_filename): Use this wherever references to file_texi - occured except in setting filename_noext. - (TEXINPUTS): Current directory and source directory where input - file resides prepended to standard path before invoking TeX. + * texinfo.tex (\afourpaper): Set various parameters. -Wed Jan 27 16:24:37 1993 Noah Friedman (friedman@prep.ai.mit.edu) +Tue Oct 22 18:42:31 1991 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * util/Makefile.in: overhauled. + * texinfo.tex (\alphaenumerate, \capsenumerate): + Let @end enumerate end these. + (\Ealphaenumerate, \Ecapsenumerate): Aliases for \Eenumerate. -Tue Jan 26 21:04:23 1993 Noah Friedman (friedman@prep.ai.mit.edu) +Sun Oct 20 18:23:18 1991 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * Makefile.in, info/Makefile.in, makeinfo/Makefile.in: Overhauled. + * texinfo.tex (\mainmagstep): New parameter macro. + (Defining fonts): Use that parameter to scale them. + If \bigger is defined, use 12 point fonts. - * configure.in: Renamed from texinfo.in. - Incorporated makeinfo/makeinfo.in, info/info.in, and - util/util.in. Create all child Makefiles. +Tue Sep 24 00:30:07 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu) - * makeinfo/makeinfo.in, info/info.in: Deleted (incorporated into - top configure.in). + * texi2dvi: Iterate over the right variable to look for new idx files. - * util/util.in: Deleted (incorporated into ../configure.in). + * texi2dvi: GPL 2. -Mon Jan 25 10:59:49 1993 Brian Fox (bfox@cubit) + * texi2dvi: Fix 2nd invocation of texindex to pass right args. - * info/info.c: New version 2.9; new variable INFO_PATCH_LEVEL - appears in the version string if it is non-zero. New function - version_string () produces the current version string, as in 2.8-p1. +Wed Sep 11 20:52:42 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - * info/dir.c: New file implements Gillespies `localdir' hacks. + * texinfo.tex (\cartouche): New macro. - * info/nodes.c (info_get_node): Now calls maybe_build_dir_node () - if the file name to look for is "dir". +Fri Aug 23 16:13:46 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - * info/nodes.h: New flag N_CannotGC unconditionally prevents garbage - collection of a file buffer's contents. Used when "dir" is made - from at least one "localdir". + * texinfo.tex (\section, \subsection, \subsubsection): + Initially define for numbered chapters. -Fri Jan 22 11:36:42 1993 Brian Fox (bfox@cubit) +Fri Aug 2 01:46:09 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - * info/footnotes.c: Do not declare auto_footnotes_p as "extern" in - this file. + * texinfo.tex (\footnote): Use \unskip instead of \removelastskip. -Thu Jan 21 08:57:08 1993 Brian Fox (bfox@cubit) +Mon Jul 29 14:06:54 1991 Roland H. Pesch (pesch at cygint.cygnus.com) - * info/info.c: New version 2.8. + * texinfo.tex (\majorheadingzzz, \chapheadingzzz, \chfplain, + \unnchfplain, \unnchfopen, \secheadingi, \subsecheadingi, + \subsubsecheadingi): allow line breaks in headings. + (\shortchapentry, \shortunnumberedentry, \dochapentry, \dosecentry, + \dosubsecentry, \dosubsubsecentry): allow line breaks in table of + contents entries. - * info/userdoc.texi, info/infoman.texi, info/info.texi: Fully - document Info; create both online and printed manual versions. - "userdoc.texi" contains exactly the documentation for GNU Info 2.x. - "infoman.texi" is a wrapper for that file; it is meant to produce - printed documentation. "info.texi" has the user documentation as a - complete chapter within itself, but continues to contain the Info - tutorial. +Thu Jul 18 19:01:53 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - * info/makedoc.c: Convert "ea_" into "echo_area_" when creating the - command name. + * texinfo.tex (\secfonts, \indexfonts): Fix typos. -Fri Jan 15 16:50:35 1993 Brian Fox (bfox@cubit) +Sun Jul 7 16:36:28 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - * info/search.c (skip_node_characters): New argument NEWLINES_OKAY if - non-zero says that newlines should be skipped over during parsing. + * texinfo.tex (\afourpaper): New command. - * info/info-utils.c (info_parse_node): New argument NEWLINES_OKAY if - non-zero says that newlines should be skipped while parsing out - the nodename specification. + * texinfo.tex (\numberedsec): Renamed from \section. + (\numberedsubsec): Renamed from \subsection. + (\numberedsubsubsec): Renamed from \subsubsection. + (\chapter, \appendix, \unnumbered): Define \section, \subsection, + and \subsubsection here according to type of chapter. -Wed Jan 13 14:42:33 1993 Brian Fox (bfox@cubit) +Thu Jul 4 14:19:32 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - * info/makedoc.c: Remove "info_" from the front of the command name - before installing it. + * texinfo.tex (\defvarparsebody, \defvrparsebody, \defopvarparsebody): + New functions. + (\defvar, \defvr, \defopt, \defcv, \defivar): Use them. + (\deftypevar, \deftypevr): Likewise. - * info/session.c (info_menu_or_ref_item): A label of "Menu" is okay if - the builder is not info_menu_of_node (); +Mon Jul 1 13:49:25 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - * info/m-x.c: New function replace_in_documentation () replaces \\[foo] - with the keystrokes you type to get that command. Now used in - indices.c, info.c, infodoc.c. + * texinfo.tex (\group): Report error if used outside @example, etc. -Mon Jan 11 10:27:41 1993 Brian Fox (bfox@cubit) + * texinfo.tex (\defname): Reduce \leftskip + to cancel temporarily the increase made in \defparsebody. - * info/variables.c, h: New files contain describe-variable and stuff - moved out of m-x.c. + * texinfo.tex (\enumerate): Allow optional arg to specify type + of counting. - * info/m-x.c: Move VARIABLE_ALIST and variable functions into - variables.c. Add documentation string to variable definition. + * texinfo.tex (\set, \clear): New commands. - * info/echo_area.c (push_echo_area): Zero the contents of - echo_area_completion_items after pushing the vars. +Mon Jun 24 12:22:44 1991 Roland McGrath (roland@albert.gnu.ai.mit.edu) -Sat Jan 9 11:59:47 1993 Brian Fox (bfox@cubit) + * texinfo.tex (\eleterate): Renamed to \alphaenumerate. Sigh. + (\ecapitate): Likewise \capsenumerate. - * info/Makefile.in: Add footnotes.c,h,o to the appropriate Makefile - variables. +Thu Jun 6 20:02:48 1991 Roland McGrath (roland@geech.gnu.ai.mit.edu) - * info/window.c (window_tile_windows): New function divides the - available space among the visible windows. + * lgpl.texinfo: Created from /fsf/rms/gnuorg/lgpl.text. - * info/session.c (info_tile_windows): New function calls - window_tile_windows. + * gpl.texinfo: Created from /fsf/rms/gnuorg/gpl.text (GPL v2). - * info/footnotes.c, footnotes.h: New file implements functions for - aiding automatic footnote display when entering a node which has - footnotes. + * texinfo.tex (\eleterate, \ecapitate): New commands, like @itemize, + but with [a..z] or [A..Z] instead of [1..n]. - * info/m-x.c: New user-variable "automatic-footnotes". +Tue May 21 15:46:32 1991 Karl Berry (karl at hayley) - * info/window.c (window_physical_lines) New function counts the - carriage returns found in NODE. + * texinfo.tex (\dmn): new command to typeset a dimension. -Wed Jan 6 11:24:19 1993 Brian Fox (bfox@cubit) +Tue May 21 20:58:22 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - * info/general.h: #include <unistd.h> if we have it. + * texinfo.tex (\doind, \dosubind): Make new group around \indexdummies + and most of body, excluding the \penalty commands. -Tue Jan 5 11:12:33 1993 Brian Fox (bfox@cubit) +Mon May 20 21:16:32 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) + + * texinfo.tex (\tex): Typo in redefining \@. + + * texinfo.tex (\_): Use \lvvmode, not \leavevmode. + (\lvvmode): New macro. + + * texinfo.tex (\authorrm, \titlerm): Move to after section fonts. + +Tue May 14 21:13:29 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - * info/info-utils.c (info_concatenate_references): If either arg is - NULL, return the other arg. + * texinfo.tex (\defunargs): Set \hyphenchar in \tensl, not \sl. - * info/indices.c (info_indices_of_file_buffer): Simplified and - corrected loop through tags/nodes of file buffer looking for - indices. +Thu May 9 17:07:08 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - * info/search.c (skip_node_characters): Rewrite "if" statement for - clarification and conciseness. + * texinfo.tex (\ignore): Standardize catcode of space. -Fri Jan 1 03:18:26 1993 Brian Fox (bfox@cubit) +Wed May 8 13:49:45 1991 Karl Berry (karl at hayley) - * info/info.in: Check for setvbuf (), and check to see whether the args - are reversed. + * texinfo.tex (\sffam, \sf): New macros; support sans serif + type style in math. + (top level): Set up \textfonts early on, so we can create boxes w/ it. + (\tenrm...\tensf): Define these to be \textrm...\textsf instead. + (\df, \textfonts, \chapfonts, \secfonts, \subsecfonts): + (\indexfonts): Redefine \tenrm (etc.) instead of just \rm, so that + the math family assignment doesn't get lost; call \resetmathfonts. + (\resetmathfonts): New macro; redefines \textfont of each math family. + (\indsc, \indi, \indsy \chapsc, \chapi, \chapsy, \secsc, \seci): + (\secsy, \ssecsc, \sseci, \ssecsy): New font definitions. - * info/dribble.c (open_dribble_file) Check HAVE_SETVBUF and - SETVBUF_REVERSED when setting the buffering on info_dribble_file. +Mon May 6 21:30:19 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) -Thu Dec 31 20:14:13 1992 Brian Fox (bfox@cubit) + * texinfo.tex (\indexdummies): Write \_ when an _ is seen. - * info/session.c (info_select_reference) If the node couldn't be found, - look for the label as a filename (i.e., "(LABEL)Top"). +Mon Apr 29 01:41:44 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) -Wed Dec 30 01:57:50 1992 Brian Fox (bfox@cubit) + * texinfo.tex (\defname): Use \dimen2, \dimen3 for outer margins. + Use outer margins for influencing \rightline. + (\tclose, \key, \t): Turn off line breaks at hyphens. - * New Version 2.7 Beta. +Fri Apr 12 03:12:14 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - * info/echo_area.c: Numerous functions now do something with the - numeric argument. Kill ring implemented, as well as yank and - yank_pop. Also transpose-chars. + * texinfo.tex (\authorrm): Move definition to top level; copy \secrm. - * info/window.c (window_make_modeline): Check node->flags for - N_IsCompressed and display "zz" in the modeline if the node comes - from a file which is compressed on disk. +Tue Apr 2 22:48:39 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) -Mon Dec 28 17:33:12 1992 Brian Fox (bfox@cubit) + * texinfo.tex (\defname): Adjust size of \rlap box, not \dimen0 + or \dimen1, for current width. - * info/filesys.c, info/nodes.c: New member of FILE_BUFFER "FILESIZE" - contains the size of file_buffer->contents. finfo.st_size is no - longer relied upon to read the contents of files, since the new - function (filesys_read_info_file) can read compressed files. + * texinfo.tex (\Yappendixletterandtype): End with {}. - * info/filesys.c (info_find_fullpath) If a file starts with a slash (or - tilde expansion causes it to start with a slash) still call - info_find_file_in_path () on it so that we can find files with - compression suffixes. +Sat Mar 30 16:13:25 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - * info/m-x.c: New variable "gc-compressed-files". + * texinfo.tex (\xrefX): Really use \cite. + (\inforefzzz): Use \samp for node name. -Tue Dec 22 03:45:28 1992 Brian Fox (bfox@cubit) + * texinfo.tex (\defname): Use current width for \dimen0, \dimen1. - * info/info.c: Version 2.6 Beta. + * texinfo.tex (\doprintindex): Put lots of whitespace before index. - * info/indices.c (info_index_next): Improve the final search for the - matched index entry. +Fri Mar 29 17:00:58 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - * info/session.c (move_to_screen_line): New function implements `M-r'. - Given a numeric argument, move point to the start of that line in - the current window; without an arg, move to the center line. - * infomap.c: Put move_to_screen_line () on `M-r'. + * texinfo.tex (\xrdef): Take out last change. - * info/nodes.c (adjust_nodestart): Don't set N_UpdateTags unless the - node came from a tags table. + * texinfo.tex (\needx): Turn off \baselineskip. Use kern, and no glue. - * info/nodes.c (info_find_file_internal): If the filename being looked - for doesn't start with a `/', then additionally compare the - filename against the fullpath of the file buffer sans the - directory name. This can happen when selecting nodemenu items. + * texinfo.tex (\shortcontrm): Renamed from \truesecrm. + (\shortcontbf, \shortcontsl): New fonts for short contents lines. + (\summarycontents): Use them. -Mon Dec 21 10:07:18 1992 Brian Fox (bfox@cubit) + * texinfo.tex (\defname): Don't set \leftskip to 0; just decrease by + one indent level. + (\defparsebody, \def*parsebody): Increment both margins by one level. - * info/session.c, info/display.c: Remove all references to - active_window_ch, active_window_cv, cursor_h, and cursor_v. The - single function display_cursor_at_point () is used for all cursor - movement, and to place the terminal's cursor at the right location - on the screen. +Tue Mar 26 22:41:38 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) -Sat Dec 19 12:01:33 1992 Brian Fox (bfox@cubit) + * texinfo.tex (\xrdef): Change catcode before reading args. - * info/nodemenu.c: New file implements a few functions for manipulating - previously visited nodes. `list-visited-nodes' produces a menu of - the nodes that could be reached by info_history_node () in some - window. `select-visited-node' is similar to `list-visited-node' - followed by `info-menu-item', but doesn't display a window with - the visited nodes menu. +Wed Mar 20 14:21:57 1991 Roland McGrath (roland at geech.gnu.ai.mit.edu) - * info/session.c (info_numeric_arg_digit_loop): If redisplay had been - interrupted, then redisplay all of the windows while waiting for - input. + * texi2dvi: Use p modifier in sed -n command, so it works. + Duplicate code to find the index files, instead of being smart in + one place and dumb in another. - * info/display.c (display_was_interrupted_p): New variable keeps track - of interrupted display. Used in - info/session.c:info_numeric_arg_digit_loop (). +Thu Mar 7 17:08:32 1991 Richard Stallman (rms at mole.ai.mit.edu) - * info/session.c (info_global_next, info_global_prev): Use the numeric - argument passed to determine how many nodes to move. + * texinfo.tex (\defaultparindent): New variable. + (\footnotezzz): Reset \parindent to default. + (\xrefX): Use \cite for printed manual and node names. - * info/session.c (info_scroll_forward, info_scroll_backward): If the - invoking key is not SPC or DEL only do Page Only scrolling. +Tue Mar 5 13:39:34 1991 Richard Stallman (rms at mole.ai.mit.edu) -Thu Dec 17 01:34:22 1992 Brian Fox (bfox@cubit) + * texinfo.tex (\emergencystretch feature): Use \thisisundefined. - * info/display.c (display_update_one_window): Allow W_NoWrap to affect - window display. +Mon Mar 4 00:35:57 1991 Richard Stallman (rms at mole.ai.mit.edu) - * info/window.c (calculate_line_starts): Now takes a WINDOW * as an - argument, and simply does the calculation, placing the results - into window->line_starts and window->line_count. It also handles - W_NoWrap in window->flags. + * texinfo.tex (\ftablex): Define \Eftable; undefine \Etable. -Mon Dec 14 02:18:55 1992 Brian Fox (bfox@cubit) + * texinfo.tex (\footnote): Discard preceding whitespace. - * info/session.c (info_backward_scroll): Don't try to get previous node - if the top of the node isn't currently being displayed. + * texinfo.tex: Use the \emergencystretch feature if available. - * info/window.c (window_adjust_pagetop) Use new variable - "window_scroll_step" to attempt to control the amount which the - window scrolls. +Fri Feb 22 03:50:58 1991 Richard Stallman (rms at mole.ai.mit.edu) - * info/m-x.c (info_variables) Add "scroll-step" to the list. + * texinfo.tex (\tex): Make + not active. -Thu Dec 10 08:52:10 1992 Brian Fox (bfox@cubit) +Fri Feb 15 10:05:24 1991 Roland McGrath (mcgrath at cygint.cygnus.com) - * info/m-x.c: New variable entry show-index-matches. When set to - non-zero the matched portion of the search string is indicated - with ` and '. Perhaps I should use `|' inst|ea|d? + * texi2dvi: Use $TEXINFO in place of $TEX (falling back to $TEX + if $TEXINFO is undefined). - * info/echo_area.c (ea_possible_completions): Always build completions - before checking to see how many there were. + * texi2dvi: Renamed from texinfo. Bob (I believe) did this at some + point at and didn't make a ChangeLog entry. I'd shoot him myself if + he weren't the person who signs my paychecks. - * info/info-utils.c: (info_concatenate_references): New utility - function concatenates references. +Sun Feb 10 22:51:52 1991 Richard Stallman (rms at mole.ai.mit.edu) - * info/Makefile.in: Add indices.c and indices.h to SRCS and HDRS. - Add indices.c to CMDFILES. + * texinfo.tex (\doprintindex): If index is empty, print a dummy. + (\need): Use vskips and penalties; don't use \pagetotal. - * info/indices.c, info/indices.h: New file implements `i' and `,' - commands of info, and provides index searching capabilities. +Fri Feb 8 17:36:53 1991 Richard Stallman (rms at mole.ai.mit.edu) - * info/echo_area.c (info_read_completing_in_echo_area): Split off into - separate callable function info_read_completing_internal (). + * texinfo.tex (\ignoresections): + Turn off \contents, \smallbook and \titlepage. - * info/echo_area.c (info_read_maybe_completing): New function calls - info_read_completing_internal () with non-forcing argument. + * texinfo.tex (\Etitlepage): Do a page break before ending the group. - * info/session.c: Rename down_next_upnext_or_error () and - prev_up_or_error () to forward_move_node_structure (), and - backward_move_node_structure (). Implement new commands - info_global_next () and info_global_prev (). + * texinfo.tex (\setref, \unnumbsetref, \appendixsetref): + Comment out recording the chapter title. - * info/infomap.c (initialize_info_keymaps): Bind `[' and `]' to - backward_, forward_move_node_structure () respectively. +Thu Jan 24 23:28:41 1991 Richard Stallman (rms at mole.ai.mit.edu) - * info/session.c (info_menu_digit): Called with "0" as arg, select the - last menu item. + * texinfo.tex (\top): Synonym for \unnumbered. + (\infotop): Synonym for \infounnumbered. + (\ignoresections): Handle \top. - * info/infomap.c (initialize_info_keymaps): "0" calls - info_menu_digit (). +Thu Jan 24 12:41:33 1991 Richard Stallman (rms at mole.ai.mit.edu) - * info/session.c (info_move_to_xref): Take dir into account when there - are xrefs and menu items in the node and we are wrapping - backwards. + * texinfo.tex: Delete spurious character at beginning. -Tue Dec 8 09:57:58 1992 Brian Fox (bfox@cubit) +Thu Jan 17 16:34:25 1991 Roland McGrath (roland at cygint.cygnus.com) - * info/info.c: Version 2.5 Beta. + * texinfo: Check the exit status of tex and texindex. Don't procede + after a failing run. - * info/terminal.c (terminal_insert_lines, terminal_delete_lines) Do not - expect tgoto to return a new string; it returns the address of a - static buffer. +Thu Jan 10 15:16:47 1991 Richard Stallman (rms at mole.ai.mit.edu) - * info/infodoc.c (info_find_or_create_help_window) Correct check for - prior existing help node. + * texinfo.tex (\xrefX): Get rid of blank line. - * info/m-x.c (set_variable): Allow variables to have a list of choices. - Add new variable scroll-behaviour. +Wed Jan 9 18:06:20 1991 Richard Stallman (rms at mole.ai.mit.edu) - * info/session.c (down_next_upnext_or_error, prev_up_or_error) New - functions implement user-controlled behaviour when attempting to - scroll past the bottom or top of a node. New variable - info_scroll_behaviour is user visible as "scroll-behaviour". + * texinfo.tex (\entry, \secondary): Use \indexdotfill. + (\indexdotfill): New macro. - * info/session.c (info_scroll_forward, info_scroll_backward) Call new - functions for user-controlled scroll behaviour. +Tue Jan 8 17:44:01 1991 Richard Stallman (rms at mole.ai.mit.edu) - * info/terminal.c (terminal_initialize_terminal) Set PC from BC not - from BUFFER. + * texinfo.tex (\donoderef): Define a ...-title cross-reference. + (Ytitle): Subroutine for that. + (xrefX): Use the real title by default (but this is commented out). -Mon Dec 7 11:26:12 1992 Brian Fox (bfox@cubit) +Tue Jan 1 23:18:21 1991 Richard Stallman (rms at mole.ai.mit.edu) - * util/texindex.c: Change EXIT_SUCCESS and EXIT_FATAL to TI_NO_ERROR - and TI_FATAL_ERROR respectively. This avoids namespace conflicts - on NeXT 2.0. + * texinfo.tex (\indexnofonts): Delete troublemaking blank line. -Sat Dec 5 00:07:59 1992 Brian Fox (bfox@cubit) +Sat Dec 22 00:47:21 1990 Richard Stallman (rms at mole.ai.mit.edu) - * info/info.c: New option "--subnodes" says to recursively dump the - menus of the nodes that you wish to dump. Menu items which point - to external nodes are not dumped, and no node is dumped twice. + * texinfo.tex (\xrefX): Prevent extra space. -Thu Dec 3 16:11:02 1992 Brian Fox (bfox@cubit) +Fri Dec 21 21:14:50 1990 Richard Stallman (rms at mole.ai.mit.edu) - * info/session.c (info_error) Don't ring the bell if - info_error_rings_bell_p is zero. (info_abort_key) Ring the bell - if printing "Quit" in the echo area wouldn't do it. + * texinfo.tex (\comment, \commentxxx): Ignore @ in comment. - * info/m-x.c (set_variable) New functions allows setting of - variables in the echo area. Currently, only visilble-bell and - errors-ring-bell are implemented. +Thu Dec 13 22:38:31 1990 Chris Hanson (cph at kleph) -Wed Dec 2 13:11:37 1992 Brian Fox (bfox@cubit) + * texinfo.tex (\defivarheader): Capitalize "Variable". - * info/nodes.c, info/makedoc.c: If O_RDONLY is not defined by - sys/file.h, include sys/fcntl.h. +Sun Dec 2 01:46:04 1990 Richard Stallman (rms at mole.ai.mit.edu) - * info/filesys.c (info_file_in_path): Expand leading tildes found - within directory names. + * texinfo.tex (\indexdummies, \indexnofonts): Handle \t like \r. - * info/terminal.c (terminal_initialize_terminal) Set ospeed to 13 if - not settable any other way. It is an index into an array of - output speeds. + * texinfo.tex (heading fonts): New fonts based on cm...12. - * info/display.c (free_display) Do not free a NULL display. +Tue Nov 27 16:59:35 1990 Richard Stallman (rms at mole.ai.mit.edu) - * info/display.c (string_width): New functions returns the width of - STRING when printed at HPOS. + * texinfo.tex (\indexnofonts): Also supersede \TeX and \dots. -Sun Nov 29 01:24:42 1992 Brian Fox (bfox@cubit) +Sun Nov 18 16:18:14 1990 Richard Stallman (rms at mole.ai.mit.edu) - * info/info.c: New version 2.4 beta. + * texinfo.tex (\*): End with \ignorespaces. - * info/general.h: #define info_toupper and info_tolower which check - their arguments before performing any conversion. +Fri Nov 2 17:41:48 1990 Richard Stallman (rms at mole.ai.mit.edu) - * info/search.c, info/echo_area.c: Use info_toupper. + * texinfo.tex (\*): Output empty hbox to avoid losing whitespace. + (\deftypevarheader, \deftypevrheader): End the paragraph + with suitable penalties. + (\deftypevrheader): Do print the data type. -Sat Nov 28 14:23:24 1992 Brian Fox (bfox@cubit) +Thu Nov 1 12:04:52 1990 Richard Stallman (rms at mole.ai.mit.edu) - * info/session.c (info_scroll_forward, info_scroll_backward) If at - last/first page of the node, and the last command was - forward/backward, do info_next/prev/_node. + * texinfo.tex (\defmethodheader): Print `method', not `operation'. - * info/session.c: New function info_select_reference_this_line gets - menu or cross reference immediately. +Fri Oct 26 17:11:08 1990 Richard Stallman (rms at mole.ai.mit.edu) - * info/infomap.c (initialize_info_keymaps): Add info_keymap[LFD] to - invoke info_select_reference_this_line (). + * texinfo.tex (\indexdummies): Temporarily redefine \_. + (\ptexdots): Copy of plain tex \dots. + (\tex): Temporarily reinstall that. - * info/session.c (info_last_reference) Rename to - info_history_reference. Wrote info_last_reference, and - info_first_reference which go to the last or first node of an info - file. +Fri Oct 19 16:57:48 1990 Richard Stallman (rms at mole.ai.mit.edu) -Fri Nov 27 00:59:02 1992 Brian Fox (bfox@cubit) + * texinfo.tex (\subsubsecheadingi, \subsecheadingi): New subroutines. - * info/info.c: New version 2.3. Completed implementing contents of - TODO file. +Mon Oct 8 13:34:19 1990 Richard Stallman (rms at mole.ai.mit.edu) - * info/session.c (info_redraw_display): Fix C-l with numeric arg. + * texinfo.tex (active _): Use \normalunderscore. -Thu Nov 26 20:14:18 1992 Brian Fox (bfox@cubit) +Tue Sep 25 22:32:55 1990 Richard Stallman (rms at mole.ai.mit.edu) - * info/m-x.c: New file implements reading named commands in the echo - area, along with a new function "info-set-screen-height". - Compilation of this file and some code in others controlled by the - Makefile variable NAMED_COMMANDS (set to -DNAMED_COMMANDS). + * texinfo.tex (\deftypefn, \deftypevar, \deftypevr): New macros. + Their subroutines also new. - * info/window.c (window_new_screen_size) Rewrite from scratch, allowing - clean growth and shrinkage of the screen. New variable - window_deletion_notifier is a pointer to a function to call when - the screen changes size, and some windows have to get deleted. - The function is called with the window to be deleted as an - argument, and it should clean up dangling references to that - window. +Tue Sep 25 16:42:52 1990 Roland McGrath (roland at geech.ai.mit.edu) - * info/session.c (initialize_info_session): Set - window_deletion_function to forget_window_and_nodes. + * texinfo: Recognize `.tex' as a suffix. - * info/display.c (display_update_one_window): If the first row of the - window to display wouldn't appear in the_screen, don't try to - display it. This happens when the screen has been made - unreasonably small, and we attempt to display the echo area. +Tue Sep 25 01:46:54 1990 Richard Stallman (rms at mole.ai.mit.edu) -Tue Nov 24 00:47:20 1992 Brian Fox (bfox@cubit) + * texinfo.tex (\deftypefun): New macro. + (\deftypefunheader, \deftypefunheaderx, \deftypefunargs): Also new. - * Release Info 2.2. +Fri Sep 14 00:38:28 1990 Roland McGrath (roland at churchy.ai.mit.edu) - * info/session.c: New functions implement reading typeahead and - implement C-g flushing typed ahead characters. - (info_search_internal): allows C-g to exit multi-file searches. + * texinfo: Weed out files that have two-letter extensions but don't + start with a backslash, and therefore aren't index files. -Mon Nov 23 01:53:35 1992 Brian Fox (bfox@cubit) + * texinfo: Handle index files that have any two-letter extension, + rather than using a static list of extensions. - * info/nodes.c: Remove calls to sscanf (), replacing them with calls to - atol (), since that is much faster. - (get_nodes_of_tags_table) Only check for "(Indirect)" if we - haven't parsed any nodes out of the tags table. Increase the - amount that file_buffer->nodes grows to 100 from 50. These two - together sufficiently speed up the parsing process. + * texinfo: Handle .texi extension as well as .texinfo. - * info/nodes.c: info_get_node_of_file_buffer_tags (), - info_get_node_of_file_buffer_nodes (): Search the appropriate list - and return a node. This was simply a cut and paste edit to - functionalize the code. + * texinfo: New file, a sh script to do .texinfo -> .dvi. - * info/TODO: Remove suggestion for partial tag parsing, since tag - parsing is much faster now. +Mon Sep 10 13:14:39 1990 Richard Stallman (rms at mole.ai.mit.edu) -Sat Nov 21 02:48:23 1992 Brian Fox (bfox@cubit) + * texinfo.tex (\math): New macro. - * info/makedoc.c: New File replaces makedoc.sh shell script. +Tue Sep 4 07:43:33 1990 Karl Berry (karl at hayley) - * info/infomap.c: Install info_isearch (on C-s) and - info_reverse_isearch (on C-r) for Info windows. + * texinfo.tex (\chfplain): Do not print a period after the chapter + number, for consistency with sections et al. - * info/session.c (incremental_search, info_isearch, - info_reverse_isearch) New functions implement incremental - searching. + * texinfo.tex (\refX): hyphenate `undefined' so that the ligature + is not lost. -Fri Nov 20 00:01:35 1992 Brian Fox (bfox@cubit) + * texinfo.tex (_): use \_ unless we're in tt. + (\ifusingtt): new macro for such conditionalization. - * info/terminal.c (terminal_initialize_terminal): Declare and set up - `ospeed'. Turn off C-s and C-q processing. + * texinfo.tex (\xrefX): don't use \unhbox to print the node names, + since that loses on hyphens. + Use \ignorespaces rather than \losespace. - * info/session.c (info_show_point) When this function is called, the - desired result is to show the point immediately. So now it calls - set_window_pagetop () if the new pagetop is not the same as the - old one. This means that info_prev_line (), info_next_line (), - info_forward_word (), and info_backward_word () can all scroll the - window if they have to. +Thu Aug 2 07:03:26 1990 Karl Berry (karl at hayley) -Thu Nov 19 12:27:07 1992 Brian Fox (bfox@cubit) + * texinfo.tex (\linenumber): new macro. + (\refx): give the line number in the message. - * info/session.c (set_window_pagetop): Add scrolling to make this - faster. +Tue Jul 31 09:13:32 1990 Karl Berry (karl at hayley) - * info/echo_area.c (push/pop_echo_area): Remember the list of items to - complete over. + * texinfo.tex (\refx): improve warning messages, remove + unnecessary groups, and improve logic. - * info/session.c (info_forward_char): Don't let point get equal to - nodelen, only to nodelen - 1. +Thu Jul 26 20:53:38 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - * info/display.c: New function display_scroll_display () scrolls the - rmembered display as well as the text on the actual display. + * texinfo.tex (\subheading, \subsubheading): Missing macros defined. - * info/terminal.c: New functions terminal_scroll_terminal (), - terminal_scroll_down (), and terminal_scroll_up (). All - implemented using "al" and "dl" termcap capabilities. (i.e., - insert and delete line). +Thu Jul 19 22:48:26 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Wed Nov 18 15:05:14 1992 Brian Fox (bfox@cubit) + * texinfo.tex (\titlepage): Don't print rule for \page unless already + printed a rule. + (\abstract): Deleted. + (\direntry): New command, much like \ignore. - * info/termdep.h: Only define HAVE_FCNTL_H if !aix and !ultrix. +Sun Jul 15 16:28:42 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Tue Nov 17 20:35:08 1992 Brian Fox (bfox@cubit) + * texinfo.tex (\abstract): New construct; trivial in tex. - * First Beta Release of Info 2.0. +Sun Jun 17 01:03:16 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Sun Nov 1 02:21:05 1992 Noah Friedman (friedman@prep.ai.mit.edu) + * texinfo.tex (\defcv): Protect space before `of'. + (\defspec): Capitalize `Form'. - * util/texi2dvi (--force): Option removed. Always run tex at least - once, don't bother checking if .dvi file is newer than source. +Sat Jun 16 19:36:56 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Fri Oct 30 02:16:28 1992 Noah Friedman (friedman@prep.ai.mit.edu) + * texinfo.tex (\kbd, \kbdfoo): Use \par to term. arg to \kbdfoo. - * util/texi2dvi (-D): debugging option renamed from '-d'. - Made check to enable debugging more terse. - When checking if index files have changed, use - variable $this_file instead of $file in for loop. - (file_texi): wherever the variable $file was used to reference - the texinfo file, substituted $file_texi. +Fri Jun 15 10:47:12 1990 Robert J. Chassell (bob at pogo.ai.mit.edu) -Sat Oct 17 07:30:34 1992 Brian J. Fox (bfox@helios) + * texinfo.tex (\defcv): Use \defcvarheader instead of (undefined) + \defcvheader. - * util/texindex.c: Remove references to USG replacing them with a - define declaring the actual feature required or missing. +Fri May 25 18:04:31 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Thu Oct 15 16:17:47 1992 Robert J. Chassell (bob@nutrimat.gnu.ai.mit.edu) + * texinfo.tex (\xrefX): Use \turnoffactive. - * emacs/texinfmt.el (texinfo-format-setfilename): Remove date from - Info file header so regression testing is easier. +Mon May 21 21:17:34 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Tue Sep 15 16:28:35 1992 Robert J. Chassell (bob at grackle) + * texinfo.tex (\turnoffactive): New command. + (\normaldoublequote, ...): New commands. + (\dosetq): Use \turnoffactive. - * emacs/texinfmt.el (texinfmt-version): New variable. - (texinfo-format-setfilename): Include date and - version in Info file header. - Better documentation for @definfoenclose - Handle whitespace after @end iftex, etc. +Sat May 19 12:31:17 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Thu Sep 3 09:25:37 1992 Robert J. Chassell (bob at grackle) + * texinfo.tex (\indit): Use slanted font, not italic. + (\smalllispx): Do \indexfonts. - * emacs/texnfo-upd.el: Fix typo re `texinfo-sequential-node-update.' +Fri May 4 17:35:04 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Tue Aug 18 08:56:24 1992 Robert J. Chassell (bob at grackle) + * texinfo.tex (\footnote, \footnotezzz): Make it \long. - * emacs/texinfmt.el (texinfo-value): Revise syntax. +Wed May 2 01:19:55 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - * emacs/texnfo-upd.el (texinfo-start-menu-description): - New function to insert title as description in a menu. - (texinfo-make-menu-list): Remove automatic title insertion. + * texinfo.tex (\titlerm): Go back to cmbx10 scaled \magstep5. + (\hsize): Don't set it, use the default. - * emacs/texinfo.el (texinfo-mode-map): Add keybinding for - texinfo-start-menu-description. +Fri Mar 23 21:07:02 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Wed Jul 29 11:58:53 1992 Robert J. Chassell (bob at grackle) + * texinfo.tex (\footnote): Read arg in braces, not as a line. - * emacs/texinfmt.el (texinfo-set): Revise to set a string to the flag. - (texinfo-value): @value{flag}: New command which inserts the - string to which the flag is set. +Mon Mar 19 19:30:08 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Tue Jul 7 15:10:52 1992 Robert J. Chassell (bob at grackle) + * texinfo.tex (\unnumbsubsubsecentry): Typo in name being defined. - * emacs/texnfo-upd.el (texinfo-master-menu): Error message if file - contains too few nodes for a master menu. - (texinfo-insert-master-menu-list): Only attempt to insert detailed - master menu if there is one. +Tue Mar 13 18:49:27 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Wed Jun 10 15:26:18 1992 Robert J. Chassell (bob at grackle) + * texinfo.tex (\defvarargs): Add penalty at end. - * emacs/texinfmt.el (texinfo-append-refill): Refill properly when lines - begin with within-paragraph @-commands. + * texinfo.tex (\synindex, \syncodeindex): Copy one index file name + into the other. -Tue Jun 9 12:28:11 1992 Robert J. Chassell (bob at grackle) +Tue Mar 6 16:58:54 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - * emacs/texinfmt.el: Add `texinfo-deffn-formatting-property' and - `texinfo-defun-indexing-property' to @deffn commands. + * texinfo.tex (\deftt): Make this a distinct font. -Mon Jun 8 11:52:01 1992 Robert J. Chassell (bob at grackle) + * texinfo.tex (\initial): Define \tt like \tentt. - * emacs/texnfo-upd.el: Replace `(mark-whole-buffer)' with - `(push-mark (point-max) t) (goto-char (point-min))' - to avoid `Mark set' messages. + * texinfo.tex (\ifinfo): End with \losespace. + (\ignore, \ifsetfailxxx, \ifclearfailxxx): Likewise. -Fri Jun 5 15:15:16 1992 Robert J. Chassell (bob@kropotkin.gnu.ai.mit.edu) +Sun Mar 4 19:55:57 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - * emacs/texnfo-upd.el (texinfo-check-for-node-name): Offer section - title as prompt. - (texinfo-copy-next-section-title): Copy title correctly. + * texinfo.tex (\lbrb, \rbrb): Use \bf. -Thu May 28 20:34:17 1992 Robert J. Chassell (bob@hill.gnu.ai.mit.edu) +Sat Mar 3 17:53:22 1990 Richard Stallman (rms at geech) - * emacs/texinfmt.el: @vtable defined, parallel to @ftable, for - variables. - (texinfo-append-refill): set case-fold-search nil so @TeX is not - confused with @tex. + * texinfo.tex (\onepageout): Set \escapechar here. -Thu Mar 26 21:36:41 1992 Robert J. Chassell (bob@kropotkin.gnu.ai.mit.edu) + * texinfo.tex (\rawbackslash): Define using \chardef. - * emacs/makeinfo.el: Rename temp buffer from `*Makeinfo*' back to - `*compilation*' so `next-error' works; unfortunately, - `*compilation*' is written into the code as the name - `next-error' needs. - Rename `makeinfo-recenter-makeinfo-buffer' back to - `makeinfo-recenter-makeinfo-buffer' + * texinfo.tex (\@): Use ttfont. -Thu May 14 21:14:25 1992 Noah Friedman (friedman@prep.ai.mit.edu) +Thu Mar 1 16:37:46 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - * util/fixfonts: Enclosed most variable references with "" to prevent - potential globbing and other weirdness. Eliminated uses of - ${var-value}, which unfortunately isn't portable. + * texinfo.tex (Ysectionnumberandtype, Yappendixletterandtype): + Capitalize "chapter", "appendix" and "section". - * util/texi2dvi: rewritten from scratch. +Mon Feb 19 20:26:22 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Sat Apr 18 23:46:25 1992 Charles Hannum (mycroft@hal.gnu.ai.mit.edu) + * texinfo.tex (\xkey): Attempt to eliminate spurious space from + output. Look at y-or-n-p. - * util/fixfonts: Re-evaluate prefix and libdir if inherited (to resolve - variable references from make). - (texlibdir): Don't add '/tex', since it's already there. +Mon Feb 12 16:34:00 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Fri Apr 10 14:51:23 1992 Noah Friedman (friedman@prep.ai.mit.edu) + * texinfo.tex (\errorbox): Get \dimen0 from \tentt. - * util/fixfonts: set prefix and libdir only if they are not already - defined (i.e. not inherited from the environment). - Changed default path for libdir to be consistent with Makefile. +Sun Feb 11 15:11:57 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Tue Mar 3 13:17:42 1992 Robert J. Chassell (bob at grackle) + * texinfo.tex (\defunargs): Use ragged right for args. + Add large penalty at end. - * emacs/texnfo-upd.el (texinfo-insert-master-menu-list): Insert a - master menu only after `Top' node and before next node. - (texinfo-copy-menu): Error message if menu empty. + * texinfo.tex: Make active definition for = using \tt, but disable. + (\defparsebody): Make = active. + (\defunheader, etc.): Make inactive again. -Mon Feb 24 15:47:49 1992 Robert J. Chassell (bob at grackle) + * texinfo.tex (\errorbox): Try to equalize outside space to both sides. - * emacs/texinfmt.el (texinfo-format-region): Make sure region ends in a - newline. - (texinfo-itemize-item): Recognize all non-whitespace on same line - as @item command. +Fri Feb 2 14:47:21 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Sat Feb 22 02:15:00 1992 Brian Fox (bfox at gnuwest.fsf.org) + * texinfo.tex (\appendix): Don't use \the before \appendixletter. - * util/texindex.c: New version 1.45 has cleanups, should compile under - VMS quietly. +Sat Dec 16 14:02:56 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Wed Feb 12 10:50:51 1992 Robert J. Chassell (bob at grackle) + * texinfo.tex (\chapter, \appendix): Make defn of \thischapter + refer to \thischaptername, and store actual name there. + (\chapternofonts): Turn off more macros. + (\indexdummies): Likewise. - * emacs/makeinfo.el: Rename temp buffer as *Makeinfo*. - Rename `makeinfo-recenter-compilation-buffer'. - (makeinfo-buffer): Offer to save buffer if it is modified. - (makeinfo-compile): Do not offer to save other buffers. - (makeinfo-compilation-sentinel): Switch to Info file. +Sun Nov 19 15:29:47 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Tue Feb 4 13:07:39 1992 Robert J. Chassell (bob at grackle) + * texinfo.tex (\titlerm): There were two definitions of this command. + Put them together and commented out one of them. + (\subtitlerm): Was same as \tenrm, so just copy that. + (\ninett): Always define this. + (\indtt): Copy from \ninett. - * emacs/texinfmt.el (texinfo-print-index): Format so that node names in - the index are lined up. +Sat Nov 18 22:57:37 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Mon Feb 3 09:08:14 1992 Robert J. Chassell (bob at grackle) + * texinfo.tex (\ssecrm, etc.): Scale by 1315, rather than to 13pt. - * emacs/texinfmt.el (texinfo-itemize-item): Format entry when text - is on the same line as @item command. Also, handle @-commands. - (texinfo-format-region, texinfo-format-buffer-1): Set fill column - to local value of Texinfo buffer. +Wed Nov 8 18:38:33 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - * emacs/texnfo-upd.el (texinfo-pointer-name): Find only those - section commands that are accompanied by `@node' lines. + * texinfo.tex (\titlepage): Turn on iffinishedtitlepage so + bottom rule is not printed. + (\titlezzz): Turn it off, so bottom rule is printed. -Tue Jan 14 16:10:16 1992 Robert J. Chassell (bob at grackle) +Mon Nov 6 09:23:29 1989 Karl Berry (karl at hayley) - * emacs/texnfo-upd.el: Ensure that no commands depend on the value of - case-fold-search. + * texinfo.tex (\chapterzzz, \appendixzzz): include `Chapter + \the\chapno' and `Appendix \appendixletter' in \thischapter; use + \xdef instead of \gdef to define \thischapter, to avoid timing + problems with \chapno or \appendixletter. + (\startcontents): don't bother putting `Table of Contents' or + `Short Contents' in the headline. -Fri Jan 10 15:13:55 1992 Robert J. Chassell (bob at kropotkin) +Fri Oct 20 09:11:35 1989 Karl Berry (karl at hayley) - * emacs/texinfmt.el (texinfo-append-refill): Replace use of - unsupported function `looking-at-backward' with - `re-search-backward'. + * texinfo.tex (\titlepage): remove obsolete code for subtitles. + (\titlezzz): end with \relax, to avoid misinterpretation of a + following `plus' or `minus' + (\page (inside \titlepage)): call \finishtitlepage. + (\Etitlepage): call \finishtitlepage, if it hasn't been. + (\finishtitlepage): new macro to print a rule and leave some space + at the bottom of the title page. + (\iffinishedtitlepage): new; says whether \finishtitlepage has been + called. -Mon Dec 23 23:46:42 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) +Mon Nov 6 21:35:34 1989 Robert J. Chassell (bob at rice-chex) - * util/texindex.c: Change POSIX ifdefs to HAVE_UNISTD_H and - _POSIX_VERSION. + * texinfo.tex: Replaced `GNU CC' in the copyleft of this file with + the phrase `this texinfo.tex file'. -Mon Dec 16 15:01:36 1991 Robert J. Chassell (bob at grackle) +Fri Oct 27 10:36:32 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - * emacs/texinfmt.el (texinfo-append-refill): New function appends - @refill to all appropriate paragraphs so you no longer need to - append @refill command yourself. - (texinfo-format-region, texinfo-format-buffer-1, - texinfo-format-include): Call `texinfo-append-refill'. + * texinfo.tex (\setfilename): Do nothing except 1st time used. + (\titlepage): Brace misplaced in \titlezzz. + (\indexdummies, \indexnofonts): Handle @w. -Fri Dec 6 01:25:09 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) + (\readauxfile): Set \ifhavexrefs true. + (\refX): Warn for every use of an undefined xref, + but if no xref values are known, warn just once that none are known. - * util/texindex.c: Conditionalize on _AIX (which is predefined) instead - of AIX, just like makeinfo does. +Tue Sep 19 04:12:51 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Tue Nov 26 10:21:04 1991 Robert J. Chassell (bob at grackle) + * texinfo.tex (\xrefX): Go back to `section N [Foo], page M'. + (\exp): Delete it. - * emacs/texnfo-upd.el (texinfo-section-types-regexp): `@subtitle' no - longer treated as subsection. +Mon Sep 18 15:29:30 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Sat Nov 16 08:27:42 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) + * texinfo.tex (\chapentryfonts): Try using \rm for chap title. - * util/fixfonts: New file, from Karl Berry. +Tue Sep 12 03:41:10 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Tue Nov 12 16:13:24 1991 Robert J. Chassell (bob at grackle) + * texinfo.tex (\titlepage): Missing closeparen after \title. + Delete excess paren after \page. - * emacs/texinfmt.el: Create @end smalllisp. + * texinfo.tex (\samp): Use \tclose. -Mon Nov 11 16:50:13 1991 Robert J. Chassell (bob at grackle) +Mon Sep 11 23:28:04 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - * emacs/texinfo.el (texinfo-environment-regexp): Add all other block - enclosing Texinfo commands. + * texinfo.tex (\tclose): Make `@ ' a full-width space. -Thu Nov 7 10:23:51 1991 Robert J. Chassell (bob at grackle) +Sat Sep 9 20:11:29 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - * emacs/texinfo.el (texinfo-insert-@end): Attempt to insert correct end - command statement, eg, @end table. Fails with nested lists. - (texinfo-insert-*): Accept prefix arg to surround following N - words with braces for command. + * texinfo.tex (\balancecolumns): Handle properly the case where + the index ends before one page is output, so \partialpage is nonempty. + In this case we may need to output two pages if the data + would just barely fit if not for \partialpage. -Thu Oct 31 21:31:41 1991 Robert J. Chassell (bob at kropotki) +Wed Aug 30 22:45:31 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - * emacs/texinfmt.el (texinfo-clear): Clear flag even if flag not - previously set. + * texinfo.tex (\refx): New 2nd operand, output if xref is non-null. + (\xrefX): Use that to output the comma after the section number. + (\appendixnoderef, \appendixsetref, \Yappendixletterandtype): + Define xrefs for appendices that say "Appendix N". + Used in \appendix, \appendixsec, etc. -Wed Oct 23 11:15:58 1991 Robert J. Chassell (bob at grackle) + * texinfo.tex (\smartitalic): The actual italic correction was omitted. - * emacs/texinfo.el (texinfo-mode): page-delimiter now finds top node as - well as chapters. +Mon Aug 28 00:21:33 1989 Richard Stallman (rms at apple-gunkies.ai.mit.edu) -Tue Oct 22 11:46:12 1991 Robert J. Chassell (bob at grackle) + * texinfo.tex (\ref): New kind of cross-reference. + (\xrefX): Put single quotes around section name. + (\refx): Allow hyphenation in `undefined'. - * emacs/texinfmt.el (texinfo-do-flushright): Test whether a line is too - long for the flush right command (line length must be less than - the value of fill column). + * texinfo.tex (+): Make it active. + (Altmode): Delete active defn. - * emacs/texnfo-tex.el (texinfo-tex-buffer): Prompt for original file - even if point moved to *texinfo-tex-shell*. - texinfo-tex-original-file: variable to hold file name. + * texinfo.tex (\defunargs): Prevent hyphenation at `-' in args. + Move the penalty at the end so that it works. + (\defvarargs): Move the penalty at the end so that it works. -Wed Oct 16 08:32:05 1991 Robert J. Chassell (bob at grackle) + * texinfo.tex (\defparsebody): Do increase right margin. - * emacs/texinfmt.el (texinfo-format-center): Expand string before - centering so @-commands not included. + * texinfo.tex (\defbodyindent): Now .4 inch. -Thu Oct 10 22:01:47 1991 Robert J. Chassell (bob at kropotki) + * texinfo.tex (\point, \result, \expansion, \print, \equiv, \error): + New macros for Lisp manual. - * emacs/texnfo-tex.el (texinfo-show-tex-print-queue): Do not kill a - running process; do start a process none exists. + * texinfo.tex (\tex): Set = to code 12. -Thu Sep 26 21:58:47 1991 Robert J. Chassell (bob at kropotki) + * texinfo.tex (\entry): Hairier way to output dots. - * util/texi2dvi: Misc. bugs fixed. + * texinfo.tex (\kbd): If arg consists of one \key command, be a no op. - * emacs/texinfo.el: Remove extraneous references to TeX. + * texinfo.tex (\sc): Delete spurious \. -Thu Sep 19 20:45:29 1991 Robert J. Chassell (bob at kropotki) + * texinfo.tex (\smartitalic): New macro, does italic correction at end. + (\i, \var, \dfn, \emph, \cite): Use that. - * emacs/texinfmt.el: add @cartouche as a noop (makes box with rounded - corners in TeX) + * texinfo.tex (\node): Do \ENVcheck. -Tue Sep 10 20:44:57 1991 Robert J. Chassell (bob at grackle) + * texinfo.tex (\initial): Infinite penalty at end. - * emacs/texnfo-upd.el (texinfo-make-one-menu): Copy node-name correctly - for message. + * texinfo.tex (\chapternofonts): New macro, sets \code, etc. to + output selves into file. Also undef \frenchspacing and \rawbackslash. + (\xhapterzzz, etc.): Call that. Make a group to undo it. + (\indexdummies): Do like \chapternofonts. -Thu Aug 29 17:54:07 1991 Robert J. Chassell (bob at kropotki) +Sun Aug 27 16:05:23 1989 Richard Stallman (rms at apple-gunkies.ai.mit.edu) - * emacs/texnfo-tex.el (texinfo-quit-tex-job): Do not set mark. + * texinfo.tex (\frenchspacing): Our own definition, using + decimal numbers for all character codes. The standard one fails. -Wed Aug 21 10:36:21 1991 Robert J. Chassell (bob at grackle) + * texinfo.tex (\indexnofonts): Handle \file, \tt, and many more. - * emacs/texnfo-upd.el: (texinfo-copy-menu-title): Copy title as it - should rather than node line. +Fri Aug 25 22:05:24 1989 Richard Stallman (rms at apple-gunkies.ai.mit.edu) -Mon Aug 5 15:27:12 1991 Robert J. Chassell (bob at grackle) + * texinfo.tex (\chapter, etc.): Undefine \tclose around \edef\temp. - * emacs/texinfmt.el (texinfo-format-convert): Changed regexp that - looks for three hyphens in a row to find those between word - constituent characters, as now, for Oxford Univ. style dashes and - also between spaces, for Cambridge Univ. Press style dashes. +Mon Aug 21 15:42:47 1989 Richard Stallman (rms at apple-gunkies.ai.mit.edu) - * emacs/texnfo-tex.el (texinfo-tex-start-shell): Runs "/bin/sh" so - `explicit-shell-file-name' is not set globally. + * texinfo.tex (\tclose): Like \t but make space same width + as in surrounding text. + (\code, \kbd): Use \tclose. - * emacs/texnfo-upd.el: Rewrite messages. - (texinfo-find-higher-level-node): Stop search at limit. - (texinfo-copy-menu-title): Rewrite to handle outer include files. - (texinfo-multi-file-update): Update all nodes properly; - rewrite doc string and interactive. +Tue Jul 4 20:53:52 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Sat Aug 3 10:46:13 1991 Robert J. Chassell (bob at grackle) + * texinfo.tex (titlepage): Don't set \everypar; start just one group. + See comments in the code. - * emacs/texnfo-upd.el (texinfo-all-menus-update): Fixed typo that - caused the function to create a master menu when it shouldn't. + * texinfo.tex (defop,defcv): Use defopparsebody. + * texinfo.tex (defopparsebody): Like defmethparsebody but defines + def...x for more arguments. - * emacs/texinfo.el (texinfo-mode): Make `indent-tabs-mode' a local - variable and set to nil to prevent TABs troubles with TeX. +Sat Jun 17 13:49:13 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Wed Jul 31 11:07:08 1991 Robert J. Chassell (bob at grackle) + * texinfo.tex (\titlepage): Rename @subtext, etc., to @subtitle, etc. - * emacs/texnfo-tex.el (texinfo-quit-tex-job): New function: quit - currently running TeX job, by sending an `x' to it. - (texinfo-tex-shell-sentinel): New function to - restart texinfo-tex-shell after it is killed. - (texinfo-kill-tex-job): Rewrite to use kill-process rather than - quit-process; uses `texinfo-tex-shell-sentinel' to restart - texinfo-tex-shell after it is killed. - (texinfo-tex-region, texinfo-tex-buffer): Replace - texinfo-kill-tex-job with quit-process. + * texinfo.tex (\titlepage): Don't print the title automatically. + Define @title to print it, and the rule underneath it. + This should make @titlepage upward compatible with the old one. - * emacs/texinfo.el (texinfo-define-common-keys): Add keybinding for - texinfo-quit-tex-job + * texinfo.tex (\titlepage): Revert local definition of @page + to previous. Don't print a rule. -Wed Jul 10 15:15:03 1991 Robert J. Chassell (bob at grackle) +Mon Jun 12 20:49:17 1989 Karl Berry. (karl at mote) - * emacs/texinfmt.el: New commands @set, @clear, @ifset...@end - ifset, and @ifclear...@end ifclear. - Definition functions rewritten to make them easier to - maintain. + * texinfo.tex (\titlepage): allow intensional definition of the + items on the title page. New control sequences (allowed only + within the titlepage environment:) + (@subtext): may take either a paragraph (e.g., a brief + description of the program) or just a line (e.g., the date). + May appear more than once. + (@author): must come after all the @subtext's. Can appear more + than once, also. + Also, use the title defined by @settitle. + (\subtextfont, \authorfont): switch to using the appropriate + fonts with appropriate leading. + (\titlepagetopglue, \titlepagebottomglue): define space that + never stretches or shrinks. + (\realeverypar): formatting for the @subtext's. -Wed Jul 3 19:37:04 1991 Robert J. Chassell (bob at kropotki) +Sun Jun 4 15:04:59 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - * emacs/texinfmt.el (texinfo-format-deftypefn-index): Remove reference - to data-type to make consistent with texinfo.tex and makeinfo. - texinfo.el: Fix page-delimiter and texinfo-chapter-level-regexp - variables. + * texinfo.tex (\shortchapentry, \shortunnumberedentry): + Use dots, right justify page numbers. Don't use italics. -Thu Jun 27 18:35:36 1991 Robert J. Chassell (bob at nutrimat) +Fri Jun 2 14:40:28 1989 Karl Berry. (karl at mote) - * emacs/texinfmt.el: Add @dmn as `texinfo-format-noop'. - texinfo2.texi: Document @dmn. - texinfmt.el (texinfo{,-end}-{eleterate,ecapitate} renamed - {alphaenumerate, capsenumerate}. + * texinfo.tex (\entry, \secondary): use plain TeX \dotfill for + better leaders than the homegrown one. + (\Dotsbox): Deleted. + (\dotfill): Deleted; use Plain TeX definition. -Fri Jun 14 12:46:32 1991 Robert J. Chassell (bob at churchy.gnu.ai.mit.edu) +Wed May 31 17:19:30 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - * emacs/texinfmt.el (texinfo-format-defun-1): @defivar prints name - correctly. + * texinfo.tex (ignore): Undefine the chapter/section macros + while reading the args, since they are \outer. + (ifinfo): Likewise + (ifsetxxx, ifclearxxx): Call another macro to parse the + conditionalized text, and do to that macro as with \ignore. -Thu Jun 6 21:38:33 1991 Robert J. Chassell (bob at churchy.gnu.ai.mit.edu) +Tue May 30 15:04:37 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - * emacs/texinfo.el (texinfo-mode): Set page delimiter to - 'texinfo-chapter-level-regexp' so that page commands work by - chapter or equivalent. + * texinfo.tex (unnumbered): Change back from \long to \outer. - * emacs/texinfmt.el (texinfo-format-defun-1): @defop prints name - correctly. - (batch-texinfo-format): replace unsupported - 'buffer-disable-undo' with 'buffer-flush-undo' + * texinfo.tex: Changes by Karl Berry for toc format. + Rewrite the table of contents for appearance's sake. Add a + synonym for \summarycontents, \shortcontents, since that is the + traditional name. Two subroutines are now shared by \contents and + \summarycontents: \prepareforcontents, to reset the page number + and such; and \startcontents, which begins the \unnumbered and + resets catcodes before \input \jobname.toc. Some other macros -- + \labelspace, \dopageno, \shortpageno -- are shared by the printing + macros. -Fri Apr 5 15:17:17 1991 Robert J. Chassell (bob at wookumz.gnu.ai.mit.edu) + * texinfo.tex (\truesecrm): New font, section-size roman, used in the + new toc. (cmr12) - * emacs/makeinfo.el (makeinfo-compilation-sentinel): Check for - existance of makeinfo-temp-file to avoid harmless error message. - texinfo2.texi: Minor typos fixed. +Sun May 28 07:25:42 1989 Karl Berry. (karl at mote) -Thu Mar 28 19:13:24 1991 Robert J. Chassell (bob at pogo.gnu.ai.mit.edu) + * texinfo.tex (\eatinput): Do not print the `\input texinfo' if a + .fmt file is being used; ignore it, instead. This is the initial + definition for `\' now. + (\fixbackslash): on the other hand, subsequent backslashes should + be printed, and if the file does not have an `\input texinfo', the + first one should be printed. This new macro makes the definition + for `\' be \normalbackslash, if it is \eatinput. + (\setfilename): use \fixbackslash. - * util/texi2dvi: Revised. +Wed May 24 15:34:59 1989 Joseph Arceneaux (jla at apple-gunkies.ai.mit.edu) -Mon Mar 11 12:35:51 1991 Robert J. Chassell (bob at grackle) + * texinfo.tex: Changed def of unnumbered from \outer to \long. - * emacs/texinfmt.el: (@footnotestyle): New command to set - footnotestyle. - (@paragraphindent): New command to set indentation. - (texinfo-format-refill): Add indentation feature so as to - indent paragraph or leave indentation asis before refilling - according to value set by @paragraphindent command. - (texinfo-format-region): Insert header, if any, into Info buffer. - (texinfo-format-separate-node, texinfo-format-end-node): Run - texinfo-format-scan on footnote text only once. - (texinfo-format-scan): Shorten `---' to `--'. +Tue May 23 12:27:59 1989 Karl Berry. (karl at mote) - * emacs/texinfo.el: Define key for `texinfo-master-menu'; define - start and end of header expressions. + * texinfo.tex: Allow one to make a texinfo.fmt file (with the + invocation: + initex \&plain texinfo + and then saying + @dump + after texinfo.tex has been read. + Changes: + (\setfilename): Instead of being a no-op, read the xref info, and + open the contents and index files. These actions were done as + texinfo.tex was read before. + (\opencontents, \openindices): new macros to open those files. + (\readauxfile): and one to read the aux file. - * emacs/texnfo-upd.el (texinfo-all-menus-update): Update - pre-existing master menu, if there is one. +Sat Apr 29 22:28:02 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Fri May 11 14:36:07 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + * texinfo.tex: `@headings on' no longer does a page break. - * util/texindex.c: Rename `lines' to `nlines'. - (bzero): Pass arg to lib$movc5 through non-register var. - (perror_with_file, pfatal_with_file): Move extern decls and includes - to top of file. - [VMS]: If not using VMS C, define away `noshare' keyword. - Include perror.h. +Sun Apr 2 11:22:29 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) -Mon Jul 11 18:02:29 1988 Chris Hanson (cph at kleph) + * texinfo.tex: Defined `@headings single' and `@headings double'. + `@headings on' picks one of them: `@setchapternewpage odd' + says `@headings on' means double; otherwise it means single. + +Mon Jan 30 22:00:35 1989 Robert J. Chassell (bob at rice-krispies.ai.mit.edu) - * util/texindex.c (indexify): when comparing to initial strings to - decide whether to change the header, must use `strncmp' to avoid - comparing entire strings of which initials are a substring. + * texinfo.tex: Changed the size of the subsection fonts so they + are scaled at13pt rather than at magstep 2. This makes them + smaller than the section fonts, which are scaled at magstep 2. + In addition, changed the ssecrm font from cmbx to cmb. + +Fri Jan 6 15:00:44 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + + * texinfo.tex: Changed @lisp, @smalllisp, @display not to change + the right margin. + +Mon Dec 5 22:01:49 1988 Robert J. Chassell (bob at rice-krispies.ai.mit.edu) -Sun Jun 26 18:46:16 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) + * texinfo.tex: Tested the use of `cmbx10' vrs `cmb10' font and + stayed with cmb10 font since cmb10 looks better when the bold face + is part of a sentence although the cmbx10 font looks better on its own. - * util/texindex.c (sort_in_core, sort_offline, parsefile): - Give up on input file if any line doesn't start with backslash. +Mon Aug 15 14:33:51 1988 Robert J. Chassell (bob at spiff) + + * texinfo.tex: Changed the (undocumented) @today command from a + Month Day, Year format to a Day Month Year format. Left old + version commented out. + + +Local Variables: +mode: indented-text +left-margin: 8 +fill-column: 76 +version-control: never +End: diff --git a/contrib/texinfo/INSTALL b/contrib/texinfo/INSTALL index a2c8722ccaff..50dbe439d099 100644 --- a/contrib/texinfo/INSTALL +++ b/contrib/texinfo/INSTALL @@ -1,181 +1,183 @@ Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' - Do not print messages saying which checks are being made. + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. diff --git a/contrib/texinfo/INTRODUCTION b/contrib/texinfo/INTRODUCTION index 13e24f7cff61..0a9e0a412238 100644 --- a/contrib/texinfo/INTRODUCTION +++ b/contrib/texinfo/INTRODUCTION @@ -1,96 +1,105 @@ +Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000, 01 +Free Software Foundation. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation; with no +Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. + + Getting Started with Texinfo ============================ "Texinfo" is a documentation system that uses a single source file to produce both on-line information and printed output. Using Texinfo, you can create a printed document with the normal features of a book, including chapters, sections, cross references, and indices. From the same Texinfo source file, you can create a menu-driven, on-line Info file with nodes, menus, cross references, and indices. The name of the Texinfo source documentation file is `texinfo.txi'. You can produce both on-line information and printed output from this source file. The documentation describes Texinfo in detail, including how to write Texinfo files, how to format them for both hard copy and Info, and how to install Info files. To get started, you need to create either a printed manual or an on-line Info file from the `texinfo.txi' file. You do not need to create both, although you will probably want both eventually. To learn how to use Info, read the info documentation. You can do this in one of two ways: using the standalone `info' program, or using Info mode in GNU Emacs. * If you want to use the `info' program, run info -f info-stnd * If you want to use Emacs, start up emacs and type `C-h i' [M-x info]. Follow the instructions to learn how to use Info. After learning how to use Info, you can read the Texinfo documentation. Using the standalone `info', type the following at the shell prompt: info -f texinfo To use read this manual in Emacs, you first need to edit the Info-directory menu (the file `dir' in the system info directory) to contain the appropriate node. To learn how to do this, see node: Add in the Info documentation. The Texinfo documentation describes Texinfo in detail; among other things, it tells how to install Info files in the usual manner. (See node: Install an Info File.) The `info-stnd.info' file describes the standalone Info reader in detail. To read this file, type $ info -f info-stnd To create a printed manual ========================== You need: * The `tex' program, which typesets the manual using TeX. * The `texinfo.tex' definition file that tells TeX how to typeset a Texinfo file. * The `texindex' program, which sorts the unsorted index files created by TeX. * A printing program such as `lp' or `lpr', * A printer. This Texinfo distribution package contains `texinfo.tex', the C source for `texindex', and the handy shell script `texi2dvi'. The `tex' program is not part of this distribution, but is available separately. (See `How to Obtain TeX' in the Texinfo documentation.) * Install `tex'. (`texindex' is installed automagically by `make install' in this distribution.) * Move the `texinfo.tex' file to an appropriate directory; the current directory will do. (`/usr/local/lib/tex/inputs' might be a good place. See ``Preparing to Use TeX'' in the Texinfo manual, for more information.) After following those instructions, type the following to make the .dvi files: $ (cd doc; make dvi) You can then print the resulting .dvi files with the `lpr' or `lp' commands, or maybe `dvips'. For example, the command to print the texinfo.dvi file might be: $ lpr -d texinfo.dvi The name of the printing command depends on the system; `lpr -d' is common, and is illustrated here. You may use a different name for the printing command. Please report bugs to bug-texinfo@gnu.org. Happy formatting. diff --git a/contrib/texinfo/NEWS b/contrib/texinfo/NEWS index 18423d501217..5a1bd8cea0b4 100644 --- a/contrib/texinfo/NEWS +++ b/contrib/texinfo/NEWS @@ -1,447 +1,482 @@ +Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000, 01, 02 +Free Software Foundation. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation; with no +Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. + This file records noteworthy changes. +4.1 (4 March 2002) +* Language: + . new commands @verbatim and @verb for printing verbatim inserts. + . new command @verbatiminclude for verbatim include of files. + . new environment @documentdescription for defining the HTML description. + . new command @afivepaper for the A5 paper size. +* makeinfo: + . supports xml and docbook output. + . supports HTML splitting by node, which is now the default. + . new option --split-size to control maximum size of split info files. +* info: + . user-specified key bindings supported. + . ANSI escape sequences (as produced by groff) removed from man output + by default; use --raw-escapes to let them through if your terminal + supports them. +* texinfo.tex: + . @math implies @tex, so all the usual plain TeX math is supported. + . smaller fonts for @smallexample, in all page sizes. + . improvements in the PDF support. +* texi2dvi: + . new option -o to explicitly specify output filename. +* Distribution: + . switch to GNU Free Documentation License (http://www.gnu.org/copyleft/). + . update to GNU gettext 0.11, autoconf 2.52, and automake 1.5. + . Danish, Swedish, and Hebrew message translations. + 4.0 (28 September 1999) * Language: . New command @anchor for cross references to arbitrary points. . New commands @documentlanguage sets the main document language, and @documentencoding sets the document input encoding (although not much is done yet with either). . New command @pagesizes allows limited control of text area for typesetting. . New command @acronym for abbreviations in all caps, such as `NASA'. . New command @alias for simple command aliases. . New command @definfoenclose for better control of info output. . New commands @deftypeivar for typed instance variables of a class and @deftypeop for typed operations of a class. . New command @novalidate suppresses cross-reference checking and (in TeX) auxiliary file creation. . New commands @setcontentsaftertitlepage and @setshortcontentsaftertitlepage to force printing the table of contents after @end titlepage. Also, @contents and @shortcontents themselves can now appear at the beginning of the document as well as the end. . New markup commands: @env (for environment variables), @command (for command names), @option (for command-line options). . New commands @smallformat and @smalldisplay, a la @smallexample. . New command @exampleindent to set indentation of example-like environments a la @paragraphindent. . @uref takes an optional third argument of text to show instead of (rather than in addition to) the url for info and dvi output. . @footnote works in an @item for a @table. * texinfo.tex: . latest version always at ftp://ftp.gnu.org/gnu/texinfo.tex (and mirrors). . implements @macro. . implements @paragraphindent (except asis). . @emph and @i use true italic type (cmti) instead of slanted (cmsl). . implements pdf output when run with pdftex. . better support for internationalization via txi-??.tex files. + . footnotes now set in a smaller point size. * makeinfo: . supports HTML output with the --html option. . implication of --html: @top nodes should be wrapped in @ifnottex rather than @ifinfo. @ifinfo conditionals are not expanded with --html. . new option --number-sections to output chapter/section numbers. . dashes and quotes are not treated specially in node names. . new option --commands-in-node-names to allow @-commands in node names. (Not implemented in TeX, and most likely never will be.) . @emph output uses _underscores_. . @image looks for .png files before .jpg. . only output `Making ... file' line when verbose. . allow -v as synonym for --verbose. . new command line options to specify which conditionals to process (but --iftex is not fully implemented). . warns if @var contains any of ,[](). . @quote-arg implicitly done for all one-argument macros, so commas in the argument text are allowed. . \\ required in macro body to get single \, no other `escapes' defined. * info: . ISO Latin 1 characters are displayed and input as-is by default. . new option --vi-keys to enable vi-like and less-like key bindings. . new command S does case-sensitive searching. . new commands C-x n and C-x N repeat last search, respectively, in the same and in reverse direction, without prompting for the string. These commands are bound to n and N under --vi-keys, like in Less. . new command G menu1 menu2 ... searches for menu items from (dir), as allowed on the command line. . new command O (capital o, not zero) goes directly to the node that describes command-line options. . new command-line option --show-options causes the node which describes command-line options to be the first node displayed. . M-prior and M-DEL do new command info-scroll-other-window-backward. . / searches like s does. . If the search string includes upper-case letters, in both incremental and non-incremental search, the search is case-sensitive. . S searches case-sensitively even if the search string is all lower-case. . - makes the argument negative (so e.g. `- /' searches backward). . l restores point in the window returned to. . SPC/DEL do not move outside the current document. . foo.info is found before foo. . `info foo --index-search=bar' now searches for bar in foo's index. . support for files compressed with bzip2. * install-info: . handles gzipped dir files. . sort entries into alphabetical order. . install direntries only in preceding dircategory, not in all. . --delete does not require the info file to exist. . --delete can handle XEmacs-style dir entries. * texi2dvi: . bug fixed: now uses only the @iftex and @tex parts of the source. . process LaTeX source as well as Texinfo source. . output PDF (using pdftex) with new option --pdf. . handles --OPTION=ARG style of command line arguments. . new option --batch for progress reports but no interaction. . new option --clean to remove all auxiliary files. . new option --quiet for silence (unless there are errors). . new option -I for specifying directories for @include to search. . handles LaTeX files (running BibTeX etc.). * Fixes to util/gen-dir-node and util/fix-info-dir (formerly util/update-info). * Distribution: . Man pages included. . Czech and Norwegian message translations. . Various translations for texinfo.tex fixed words included. . DJGPP support. 3.12 (3 March 1998) * Elisp files removed, since they are only usefully distributed with Emacs. * Restore inclusion of compile-time $(infodir) to INFOPATH. * install-info creates a proper dir file. * Various portability fixes. 3.11 (31 July 1997) * New commands: - @uref to make a reference to a url; @url now only indicates such. - @image to include graphics (epsf for TeX). - @deftypemethod and @deftypemethodx to document methods in strongly typed object-oriented languages, such as C++. - @html for raw HTML. - @ifnothtml @ifnotinfo @ifnottex for more precise conditionals. - @kbdinputstyle to control when @kbd uses the slanted typewriter font. - @email takes second optional argument. * texinfo.tex reads texinfo.cnf (if present) for site-wide TeX configuration; for example, A4 paper sizes. * info: - arrow keys supported. - trailing : in INFOPATH appends default path. - new option --index-search for online help support. * makeinfo: - output files removed if errors unless (new option) --force. - new option -P to prepend to search path. - macro expansion file can be standard output. * install-info creates a new dir file if necessary. * update-info script to create a dir file from all info files. * Elisp: texnfo-tex.el and detexinfo.el removed from the distribution; - texnfo-tex features are now part of standard TeX & Texinfo packages; - makeinfo --no-headers does a better job than detexinfo.el. * Documentation: - Updates, revisions, corrections in the manual. - makeinfo.texi removed, as it was a copy of what was in texinfo.texi. * gettext support in sources, French and German translations included. * info man page removed; use the Texinfo manual. * Automake used, other portability fixes. 3.10 (nonexistent) 3.9 (4 October 1996) * 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: @ @<TAB> @<NEWLINE> 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. 3.0: first release of Texinfo version 2, with many new commands. Here is the separate NEWS for old releases of Info: Version 2.11, Sat Apr 1 09:15:21 1995 Changes since 2.7 beta: Although the basic code remains the same, there are numerous nits fixed, including some display bugs, and a memory leak. Some changes that have taken place with larger impact include the way in which the (dir) node is built; I have added in support for "localdir" directories among other things. Info files may be stored in compressed formats, and in their own subdirectories; menu items which do not explicitly name the node to which they are attached have the menu item name looked up as an Info file if it is not found within the current document. This means that the menu item: * Info:: The Info documentation reader. in (dir) refers to the info node "(info)Top". Please see the ChangeLog and documentation for details on other changes. Version 2.7 beta, Wed Dec 30 02:02:38 1992 Version 2.6 beta, Tue Dec 22 03:58:07 1992 Version 2.5 beta, Tue Dec 8 14:50:35 1992 Version 2.4 beta, Sat Nov 28 14:34:02 1992 Version 2.3 beta, Fri Nov 27 01:04:13 1992 Version 2.2 beta, Tue Nov 24 09:36:08 1992 Version 2.1 beta, Tue Nov 17 23:29:36 1992 Changes since 2.5 beta: Note that versions 2.6 and 2.7 Beta were only released to a select group. * "info-" removed from the front of M-x commands. * Automatic footnote display. When you enter a node which contains footnotes, and the variable "automatic-footnotes" is "On", Info pops up a window containing the footnotes. Likewise, when you leave that node, the window containing the footnotes goes away. * Cleaner built in documentation, and documentation functions. Use: o `M-x describe-variable' to read a variable's documenation o `M-x describe-key' to find out what a particular keystroke does. o `M-x describe-function' to read a function's documentation. o `M-x where-is' to find out what keys invoke a particular function. * Info can "tile" the displayed windows (via "M-x tile-windows"). If the variable "automatic-tiling" is "On", then splitting a window or deleting a window causes the remaining windows to be retiled. * You can save every keystroke you type in a "dribble file" by using the `--dribble FILENAME' option. You can initially read keystrokes from an alternate input stream with `--restore FILENAME', or by redirecting input on the command line `info < old-dribble'. * New behaviour of menu items. If the label is the same as the target node name, and the node couldn't be found in the current file, treat the label as a file name. For example, a menu entry in "DIR" might contain: * Emacs:: Cool text-editor. Info would not find the node "(dir)Emacs", so just plain "(emacs)" would be tried. * New variable "ISO-Latin" allows you to use European machines with 8-bit character sets. * Cleanups in echo area reading, and redisplay. Cleanups in handling the window which shows possible completions. * Info can now read files that have been compressed. An array in filesys.c maps extensions to programs that can decompress stdin, and write the results to stdout. Currently, ".Z"/uncompress, ".z"/gunzip, and ".Y"/unyabba are supported. The modeline for a compressed file shows "zz" in it. * There is a new variable "gc-compressed-files" which, if non-zero, says it is okay to reclaim the file buffer space allocated to a file which was compressed, if, and only if, that file's contents do not appear in any history node. * New file `nodemenu.c' implements a few functions for manipulating previously visited nodes. `C-x C-b' (list-visited-nodes) produces a menu of the nodes that could be reached by info-history-node in some window. `C-x b' (select-visited-node) is similar, but reads one of the node names with completion. * Keystroke `M-r' (move_to_screen_line) allows the user to place the cursor at the start of a specific screen line. Without a numeric argument, place the cursor on the center line; with an arg, place the cursor on that line. * Interruptible display implemented. Basic display speedups and hacks. * The message "*** Tags Out of Date ***" now means what it says. * Index searching with `,' (info-index-next) has been improved. * When scrolling with C-v, C-M-v, or M-v, only "Page Only" scrolling will happen. * Continous scrolling (along with `]' (info-global-next) and `[' (info-global-prev) works better. `]' and `[' accept numeric arguments, moving that many nodes in that case. * `C-x w' (info-toggle-wrap) controls how lines wider than the width of the screen are displayed. If a line is too long, a `$' is displayed in the rightmost column of the window. * There are some new variables for controlling the behaviour of Info interactively. The current list of variables is as follows: Variable Name Default Value Description ------------- ------------- ----------- `automatic-footnotes' On When "On", footnotes appear and disappear automatically. `automatic-tiling' Off When "On", creating of deleting a window resizes other windows. `visible-bell' Off If non-zero, try to use a visible bell. `errors-ring-bell' On If non-zero, errors cause a ring. `show-index-match' On If non-zero, the portion of the string matched is highlighted by changing its case. `scroll-behaviour' Continuous One of "Continuous", "Next Only", or "Page Only". "Page Only" prevents you from scrolling past the bottom or top of a node. "Next Only" causes the Next or Prev node to be selected when you scroll past the bottom or top of a node. "Continous" moves linearly through the files hierchichal structure. `scroll-step' 0 Controls how scrolling is done for you when the cursor moves out of the current window. Non-zero means it is the number of lines you would like the screen to shift. A value of 0 means to center the line containing the cursor in the window. `gc-compressed-files' Off If non-zero means it is okay to reclaim the file buffer space allocated to a file which was compressed, if, and only if, that file's contents do not appear in the node list of any window. `ISO-Latin' Off Non-zero means that you are using an ISO Latin character set. By default, standard ASCII characters are assumed. ________________________________________ This release of Info is version 2.5 beta. Changes since 2.4 beta: * Index (i) and (,) commands fully implemented. * "configure" script now shipped with Info. * New function "set-variable" allows users to set various variables. * User-settable behaviour on end or beginning of node scrolling. This supercedes the SPC and DEL changes in 2.3 beta. ________________________________________ This release of Info is version 2.4 beta. Changes since 2.3 beta: * info-last-node now means move to the last node of this info file. * info-history-node means move backwards through this window's node history. * info-first-node moves to the first node in the Info file. This node is not necessarily "Top"! * SPC and DEL can select the Next or Prev node after printing an informative message when pressed at the end/beg of a node. ---------------------------------------- This release of Info is version 2.3 beta. Changes since 2.2 beta: * M-x command lines if NAMED_COMMANDS is #defined. Variable in Makefile. * Screen height changes made quite robust. * Interactive function "set-screen-height" implements user height changes. * Scrolling on some terminals is faster now. * C-l with numeric arguement is fixed. ---------------------------------------- This release of Info is version 2.2 beta. Changes since 2.0: * C-g can now interrupt multi-file searches. * Incremental search is fully implemented. * Loading large tag tables is much faster now. * makedoc.c replaces shell script, speeding incremental builds. * Scrolling in redisplay is implemented. * Recursive uses of the echo area made more robust. * Garbage collection of unreferenced nodes. diff --git a/contrib/texinfo/README b/contrib/texinfo/README index 0b865efc6480..a3fb18e3a153 100644 --- a/contrib/texinfo/README +++ b/contrib/texinfo/README @@ -1,151 +1,161 @@ +Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000, 01, 02 +Free Software Foundation. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation; with no +Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. + + This is the README file for the GNU Texinfo distribution. -The primary distribution point is ftp://ftp.gnu.org/gnu/texinfo/. +The primary distribution point is ftp://ftp.gnu.org/gnu/texinfo/ +and the primary home page is http://www.gnu.org/software/texinfo/, +secondary home page at http://texinfo.org/. Mailing lists: - bug-texinfo@gnu.org for bug reports or enhancement suggestions, - archived at ftp://ftp-mailing-list-archives.gnu.org/. + archived at ftp://ftp-mailing-list-archives.gnu.org/bug-texinfo/. - help-texinfo@gnu.org for authoring questions and general discussion. - archived at the same place. -- texinfo-pretest@tug.org for pretests of new releases, - archived at http://tug.org/archives/texinfo-pretest/. + archived at ftp://ftp-mailing-list-archives.gnu.org/help-texinfo/. +- texinfo-pretest@texinfo.org for pretests of new releases, + archived at ftp://ftp.texinfo.org/texinfo/texinfo-pretest-archive/. There are as yet no corresponding newsgroups. For bug reports, please include enough information for the maintainers to reproduce the problem. Generally speaking, that means: +- the contents of any input files necessary to reproduce the bug (crucial!). +- a description of the problem and any samples of the erroneous output. - the version number of Texinfo and the program(s) involved (use --version). - hardware, operating system, and compiler versions (uname -a). - any unusual options you gave to configure (see config.status). -- the contents of any input files necessary to reproduce the bug (crucial!). -- a description of the problem and any samples of the erroneous output. - anything else that you think would be helpful. Patches are most welcome; if possible, please make them with diff -c and include ChangeLog entries. When sending email, please do not encode or split the messages in any -way if at all possible; it's much easier to deal with one large message -than many small ones. GNU shar is a convenient way of packaging -multiple and/or binary files for email. +way if at all possible; it's easier to deal with one large message than +many small ones. GNU shar is a convenient way of packaging multiple +and/or binary files for email. For generic installation instructions on compiling and installing this Automake-based distribution, please read the file `INSTALL'. Installation notes specific to Texinfo: * The Info tree uses a file `dir' as its root node; the `dir-example' file in this distribution is included as a possible starting point. Use it, modify it, or ignore it just as you like. * You can create a file texinfo.cnf to be read by TeX when processing Texinfo manuals. For example, you might like to use @afourpaper by default. See the `Preparing for TeX' node in texinfo.txi for more details. You don't have to create the file if you have nothing to put in it. * If your info files are not in $prefix/info, you may wish to add a line #define DEFAULT_INFOPATH "/mydir1:/mydir2:..." to config.h after running configure. * For instructions on compiling this distribution with DJGPP tools - for MS-DOS and MS-Windows, please see the file djgpp/README. + for MS-DOS and MS-Windows, see the file djgpp/README. If you would like to contribute to the GNU project by implementing additional documentation output formats for Texinfo, that would be great. But please do not write a separate translator texi2foo for your favorite format foo! That is the hard way to do the job, and makes extra work in subsequent maintenance, since the Texinfo language is continually being enhanced and updated. Instead, the best approach is -modify Makeinfo to generate the new format, as it does now for Info and HTML. +modify Makeinfo to generate the new format, as it does now for Info, +HTML, XML, and DocBook. +If you want to convert from DocBook to Texinfo, please see +http://docbook2X.sourceforge.net/. -This distribution includes the following files, among others: +This distribution includes the following files, among others: README This file. NEWS Summary of new features by release. INTRODUCTION Brief introduction to the system, and how to create readable files from the Texinfo source files in this distribution. Texinfo source files (in ./doc): - texinfo.txi Describes the Texinfo language and many of the associated tools. It tells how to use Texinfo to write documentation, how to use Texinfo mode in GNU Emacs, TeX, makeinfo, and the Emacs Lisp Texinfo formatting commands. info.texi This manual tells you how to use Info. This document comes as part of GNU Emacs. If you do not have Emacs, you can format this Texinfo source file with makeinfo or TeX and then read the resulting Info file with the standalone Info reader that is part of this distribution. info-stnd.texi This manual tells you how to use the standalone GNU Info reader that is included in this distribution as C source (./info). Printing related files: - doc/texinfo.tex This TeX definitions file tells the TeX program how to typeset a Texinfo file into a DVI file ready for printing. util/texindex.c This file contains the source for the `texindex' program that generates sorted indices used by TeX when typesetting a file for printing. util/texi2dvi This is a shell script for producing an indexed DVI file using TeX and texindex. Source files for standalone C programs (./lib, ./makeinfo, ./info): makeinfo/makeinfo.c This file contains the source for the `makeinfo' program that you can use to create an Info file from a Texinfo file. info/info.c This file contains the source for the `info' program that you can use to view Info files on an ASCII terminal. Installation files: - configure This file creates creates a Makefile which in turn creates an `info' or `makeinfo' executable, or a C sources distribution. configure.in This is a template for creating `configure' using Autoconf. Makefile.in This is a template for `configure' to use to make a Makefile. Created by Automake. Makefile.am This is a template for Automake to use to make a Makefile.in. Other files: - fixfonts This is a shell script to install the `lcircle10' TeX fonts as an alias for the `circle10' fonts. In some older TeX distributions the names are different. tex3patch This handles a bug for version 3.0 of TeX that does not occur in more recent versions. diff --git a/contrib/texinfo/TODO b/contrib/texinfo/TODO index a06b40c68f34..dfcc0f3a227a 100644 --- a/contrib/texinfo/TODO +++ b/contrib/texinfo/TODO @@ -1,95 +1,113 @@ +Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000, 01 +Free Software Foundation. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation; with no +Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. + + If you are interested in working on any of these, email bug-texinfo@gnu.org. * Makeinfo: - - Support output of Docbook format and SGML-Tools format. - - Support output of true 8-bit characters from accent commands, etc. + - Try directory of main source file. + - Support @`{@dotless{i}} et al. in HTML. - 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 comes close. - If node name contains an @ command, complain explicitly. - - Better ASCII output: convert menus to single table of contents, - enumerate chapters and sections, convert cross-refs and indices to - chapter/section references. See: - ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2/faq201s.zip - - Call Ghostscript to get ASCII output for the @image command. + - Call Ghostscript to get ASCII/jpg output for the @image command. - Better HTML output: allow settable background color, table colors and spacing, <head> meta tags, back link from footnote marker, etc. - - Could warn if @sc{TEXT} for all-caps TEXT, since it's a no-op. + - Rewrite completely to simplify generation of different formats. * TeX: - Use @ as the escape character, and Texinfo syntax generally, in the table of contents, aux, and index files. Eliminate all the crazy multiple redefinitions of every Texinfo command in different contexts. - Handle @hsep and @vsep in @multitables. - Introduce new command to change \bindingoffset. + - Reasonable way to change fonts from the default (some work has been done). - How about using latex2html to produce HTML? + - Support 8-bit input characters, perhaps via the ec fonts. + - Repeat table headings if a @multitable is multiple pages long. * General: - - Better i18n support, including support for 8-bit input characters, - and 8-bit output in info. Perhaps have to use the ec fonts. - - Support compressed image files, automatic generation of .txt - or .jpg from .eps by Ghostscript. + - @xindexterm [def] primary [,secondary [,tertiary]] or some such? + - Support compressed image files. - Handle reference card creation, perhaps by only paying attention to sectioning and @def... commands. - - Allow : in node names for info files, for names like `class::method'. - Allow @end (and other?) commands to be indented in the source. - Get Info declared as a MIME Content-Type. * Language: - @figure: @figure [xref-label] @figureinclude <filename>, [<height>], [<width>] @figurehsize <dimen> @figurevsize <dimen> @caption ... @end caption <arbitrary Texinfo commands> @end figure + - multicolumn * width to take up `the rest'. + - another table command to take N succeeding items and split them + into M columns (see eplain). - support bibliographies with BibTeX (see web2c/doc for kludge prototype). - @flushboth to combine @flushleft and @flushright, for RFC's. - @part sectioning command. - Allow subitems and `see' and `see also' in indices. - - @verbatim ... @end verbatim. - @exercise/@answer command for, e.g., gawk. - Allow @hsep/@vsep at @item, instead of just in template. - - The dark corner symbol for the gawk manual. - Support automatic line numbering of examples. + - Better macro syntax. + - Allow : in node names for info files, for names like `class::method'. - Change bars. This is difficult or impossible in TeX, unfortunately. To do it right requires device driver support. - wdiff or ediff may be better in some cases, anyway. + wdiff or ediff may be all we can do. * Doc: - Include a complete functional summary, as in a reference card, in the manual. - - Improve the manuals for makeinfo, standalone info, etc. - - Page 39, need a new section on doing dedication pages. See gawk.texi + - Improve the manuals, especially for makeinfo, standalone info, etc. + - new section on doing dedication pages. See gawk.texi for an example of doing it in both the tex and info versions. * Info: - Regular expression search. - - Allow key rebinding, perhaps through the readline library. - Full-text search across all info files installed on the system. - Support character sets other than ISO Latin 1. - Perhaps comply with LANGUAGE setting on a per-node basis, to allow incremental translation of Texinfo files. - Search all nodes of dir file at startup, then can have INFO-DIR-SEPARATE-GROUPS and other such. - Better dir file merging. - - Steal interface ideas from Lynx: TAB for navigating to next link - within a page, number links, use color, etc. Perhaps code from the pinfo - viewer can be reused: http://zeus.polsl.gliwice.pl/~pborys/. + - Steal interface ideas from Lynx: number links, use color, etc. + Perhaps code from the pinfo viewer can be reused: + http://zeus.polsl.gliwice.pl/~pborys/. + - More sample .infokey files, so people can choose without writing their own. - q within help should quit help like C-x 0. - Incorporate an X-based viewer, perhaps tkinfo http://www.math.ucsb.edu/~boldt/tkinfo/ or saxinfo. - - Perhaps process Texinfo files directly instead of converting to Info: - ftp://ftp.cs.berkeley.edu/ucb/people/phelps/tcltk/tkman.tar.Z - + ftp://ftp.cs.berkeley.edu/ucb/people/phelps/tcltk/rman.tar.Z - + Tcl/Tk 8.0 from ftp.smli.com in the /pub/tcl directory. - From: phelps@ecstasy.CS.Berkeley.EDU (Tom Phelps) - (But this has the disadvantage of needing to be updated when the - Texinfo language changes, so don't.) -* Install-info: +* PDF: + - make each letter of the index (A, B, ...) a section in the TOC. + From Carsten Dominik <dominik@astro.uva.nl>. + + +* install-info: - be able to copy the info file to compile-time $(infodir), to simplify by-hand installation. + + +Ideas that will not be implemented: +- Process Texinfo files directly instead of converting to Info: + ftp://ftp.cs.berkeley.edu/ucb/people/phelps/tcltk/tkman.tar.Z, which + uses Tcl/Tk 8.0 from ftp.smli.com in the /pub/tcl directory. + From: phelps@ecstasy.CS.Berkeley.EDU (Tom Phelps) + [This has the disadvantage of needing to be updated when the + Texinfo language changes, so don't.] + +- Split HTML output by chapter. + [Then cross-references in HTML cannot be generated consistently.] diff --git a/contrib/texinfo/config.h.in b/contrib/texinfo/config.h.in index 74348956e5f9..ce0d6a3378ee 100644 --- a/contrib/texinfo/config.h.in +++ b/contrib/texinfo/config.h.in @@ -1,278 +1,349 @@ -/* config.in. Generated automatically from configure.in by autoheader. */ +/* config.in. Generated automatically from configure.ac by autoheader. */ /* acconfig.h This file is in the public domain. $Id: acconfig.h,v 1.3 1998/12/06 22:04:03 karl Exp $ Descriptive text for the C preprocessor macros that the distributed Autoconf macros can define. No software package will use all of them; autoheader copies the ones your configure.in uses into your configuration header file templates. The entries are in sort -df order: alphabetical, case insensitive, ignoring punctuation (such as underscores). Although this order can split up related entries, it makes it easier to check whether a given entry is in the file. Leave the following blank line there!! Autoheader needs it. */ -/* Define if using alloca.c. */ -#undef C_ALLOCA -/* Define to empty if the keyword does not work. */ -#undef const +/* Define to 1 if including sys/ioctl.h is needed to get TIOCGWINSZ. */ +#undef GWINSZ_IN_SYS_IOCTL + +/* Define to 1 if NLS is requested. */ +#undef ENABLE_NLS + +/* Define as 1 if you have catgets and don't want to use GNU gettext. */ +#undef HAVE_CATGETS + +/* Define as 1 if you have gettext and don't want to use GNU gettext. */ +#undef HAVE_GETTEXT + +/* Define if your locale.h file contains LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES + +/* Define as 1 if you have the stpcpy function. */ +#undef HAVE_STPCPY + +/* Define to the name of the distribution. */ +#undef PACKAGE + +/* Define to the version of the distribution. */ +#undef VERSION -/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. - This function is required for alloca.c support on those systems. */ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ #undef CRAY_STACKSEG_END -/* Define if you have alloca, as a function or macro. */ +/* Define if using `alloca.c'. */ +#undef C_ALLOCA + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#undef ENABLE_NLS + +/* Define if `TIOCGWINSZ' requires <sys/ioctl.h> */ +#undef GWINSZ_IN_SYS_IOCTL + +/* Define if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA -/* Define if you have <alloca.h> and it should be used (not on Ultrix). */ +/* Define if you have <alloca.h> and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H -/* Define if you don't have vprintf but do have _doprnt. */ -#undef HAVE_DOPRNT - -/* Define if you have a working `mmap' system call. */ -#undef HAVE_MMAP +/* Define if you have the <argz.h> header file. */ +#undef HAVE_ARGZ_H -/* Define if you have the strcoll function and it is properly defined. */ -#undef HAVE_STRCOLL +/* Define if you have the `bzero' function. */ +#undef HAVE_BZERO -/* Define if you have the vprintf function. */ -#undef HAVE_VPRINTF +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +#undef HAVE_DCGETTEXT -/* Define as __inline if that's what the C compiler calls it. */ -#undef inline +/* Define if this function is declared. */ +#undef HAVE_DECL_STRCASECMP -/* Define if on MINIX. */ -#undef _MINIX +/* Define if this function is declared. */ +#undef HAVE_DECL_STRCOLL -/* Define to `long' if <sys/types.h> doesn't define. */ -#undef off_t +/* Define if this function is declared. */ +#undef HAVE_DECL_STRERROR -/* Define if the system does not provide POSIX.1 features except - with this defined. */ -#undef _POSIX_1_SOURCE +/* Define if this function is declared. */ +#undef HAVE_DECL_STRNCASECMP -/* Define if you need to in order for stat and other things to work. */ -#undef _POSIX_SOURCE +/* Define if you don't have `vprintf' but do have `_doprnt.' */ +#undef HAVE_DOPRNT -/* Define as the return type of signal handlers (int or void). */ -#undef RETSIGTYPE +/* Define if you have the <fcntl.h> header file. */ +#undef HAVE_FCNTL_H -/* Define if the setvbuf function takes the buffering type as its second - argument and the buffer pointer as the third, as on System V - before release 3. */ -#undef SETVBUF_REVERSED +/* Define if you have the `feof_unlocked' function. */ +#undef HAVE_FEOF_UNLOCKED -/* Define to `unsigned' if <sys/types.h> doesn't define. */ -#undef size_t +/* Define if you have the `fgets_unlocked' function. */ +#undef HAVE_FGETS_UNLOCKED -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown - */ -#undef STACK_DIRECTION +/* Define if you have the `getcwd' function. */ +#undef HAVE_GETCWD -/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */ -#undef STAT_MACROS_BROKEN +/* Define if you have the `getc_unlocked' function. */ +#undef HAVE_GETC_UNLOCKED -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS +/* Define if you have the `getegid' function. */ +#undef HAVE_GETEGID -/* Define if your <sys/time.h> declares struct tm. */ -#undef TM_IN_SYS_TIME +/* Define if you have the `geteuid' function. */ +#undef HAVE_GETEUID -/* Define to 1 if NLS is requested. */ -#undef ENABLE_NLS +/* Define if you have the `getgid' function. */ +#undef HAVE_GETGID -/* Define as 1 if you have catgets and don't want to use GNU gettext. */ -#undef HAVE_CATGETS +/* Define if you have the `getpagesize' function. */ +#undef HAVE_GETPAGESIZE -/* Define as 1 if you have gettext and don't want to use GNU gettext. */ +/* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT -/* Define if your locale.h file contains LC_MESSAGES. */ -#undef HAVE_LC_MESSAGES +/* Define if you have the `getuid' function. */ +#undef HAVE_GETUID -/* Define as 1 if you have the stpcpy function. */ -#undef HAVE_STPCPY +/* Define if you have the iconv() function. */ +#undef HAVE_ICONV -/* Define if you have the __argz_count function. */ -#undef HAVE___ARGZ_COUNT +/* Define if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H -/* Define if you have the __argz_next function. */ -#undef HAVE___ARGZ_NEXT +/* Define if you have the <io.h> header file. */ +#undef HAVE_IO_H -/* Define if you have the __argz_stringify function. */ -#undef HAVE___ARGZ_STRINGIFY +/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */ +#undef HAVE_LANGINFO_CODESET -/* Define if you have the bzero function. */ -#undef HAVE_BZERO +/* Define if your <locale.h> file defines LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES -/* Define if you have the dcgettext function. */ -#undef HAVE_DCGETTEXT +/* Define if you have the `bsd' library (-lbsd). */ +#undef HAVE_LIBBSD -/* Define if you have the getcwd function. */ -#undef HAVE_GETCWD +/* Define if you have the <limits.h> header file. */ +#undef HAVE_LIMITS_H -/* Define if you have the getpagesize function. */ -#undef HAVE_GETPAGESIZE +/* Define if you have the <locale.h> header file. */ +#undef HAVE_LOCALE_H + +/* Define if you have the <malloc.h> header file. */ +#undef HAVE_MALLOC_H -/* Define if you have the memcpy function. */ +/* Define if you have the `memcpy' function. */ #undef HAVE_MEMCPY -/* Define if you have the memmove function. */ +/* Define if you have the `memmove' function. */ #undef HAVE_MEMMOVE -/* Define if you have the memset function. */ +/* Define if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H + +/* Define if you have the `mempcpy' function. */ +#undef HAVE_MEMPCPY + +/* Define if you have the `memset' function. */ #undef HAVE_MEMSET -/* Define if you have the munmap function. */ +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define if you have the `munmap' function. */ #undef HAVE_MUNMAP -/* Define if you have the putenv function. */ +/* Define if you have the <ncurses/termcap.h> header file. */ +#undef HAVE_NCURSES_TERMCAP_H + +/* Define if you have the <nl_types.h> header file. */ +#undef HAVE_NL_TYPES_H + +/* Define if you have the `putenv' function. */ #undef HAVE_PUTENV -/* Define if you have the setenv function. */ +/* Define if you have the <pwd.h> header file. */ +#undef HAVE_PWD_H + +/* Define if you have the `setenv' function. */ #undef HAVE_SETENV -/* Define if you have the setlocale function. */ +/* Define if you have the `setlocale' function. */ #undef HAVE_SETLOCALE -/* Define if you have the setvbuf function. */ +/* Define if you have the `setvbuf' function. */ #undef HAVE_SETVBUF -/* Define if you have the sigprocmask function. */ +/* Define if you have the `sigprocmask' function. */ #undef HAVE_SIGPROCMASK -/* Define if you have the sigsetmask function. */ +/* Define if you have the `sigsetmask' function. */ #undef HAVE_SIGSETMASK -/* Define if you have the stpcpy function. */ +/* Define if you have the <stddef.h> header file. */ +#undef HAVE_STDDEF_H + +/* Define if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define if you have the `stpcpy' function. */ #undef HAVE_STPCPY -/* Define if you have the strcasecmp function. */ +/* Define if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP -/* Define if you have the strchr function. */ +/* Define if you have the `strchr' function. */ #undef HAVE_STRCHR -/* Define if you have the strdup function. */ +/* Define if you have the `strcoll' function and it is properly defined. */ +#undef HAVE_STRCOLL + +/* Define if you have the `strdup' function. */ #undef HAVE_STRDUP -/* Define if you have the strerror function. */ +/* Define if you have the `strerror' function. */ #undef HAVE_STRERROR -/* Define if you have the strncasecmp function. */ -#undef HAVE_STRNCASECMP - -/* Define if you have the <argz.h> header file. */ -#undef HAVE_ARGZ_H - -/* Define if you have the <fcntl.h> header file. */ -#undef HAVE_FCNTL_H - -/* Define if you have the <limits.h> header file. */ -#undef HAVE_LIMITS_H - -/* Define if you have the <locale.h> header file. */ -#undef HAVE_LOCALE_H - -/* Define if you have the <malloc.h> header file. */ -#undef HAVE_MALLOC_H - -/* Define if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - -/* Define if you have the <ncurses/termcap.h> header file. */ -#undef HAVE_NCURSES_TERMCAP_H - -/* Define if you have the <nl_types.h> header file. */ -#undef HAVE_NL_TYPES_H - -/* Define if you have the <pwd.h> header file. */ -#undef HAVE_PWD_H - -/* Define if you have the <stdlib.h> header file. */ -#undef HAVE_STDLIB_H +/* Define if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H -/* Define if you have the <string.h> header file. */ +/* Define if you have the <string.h> header file. */ #undef HAVE_STRING_H -/* Define if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H +/* Define if you have the `strncasecmp' function. */ +#undef HAVE_STRNCASECMP -/* Define if you have the <sys/fcntl.h> header file. */ +/* Define if you have the `strtoul' function. */ +#undef HAVE_STRTOUL + +/* Define if you have the <sys/fcntl.h> header file. */ #undef HAVE_SYS_FCNTL_H -/* Define if you have the <sys/file.h> header file. */ +/* Define if you have the <sys/file.h> header file. */ #undef HAVE_SYS_FILE_H -/* Define if you have the <sys/param.h> header file. */ +/* Define if you have the <sys/param.h> header file. */ #undef HAVE_SYS_PARAM_H -/* Define if you have the <sys/ptem.h> header file. */ +/* Define if you have the <sys/ptem.h> header file. */ #undef HAVE_SYS_PTEM_H -/* Define if you have the <sys/time.h> header file. */ +/* Define if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define if you have the <sys/time.h> header file. */ #undef HAVE_SYS_TIME_H -/* Define if you have the <sys/ttold.h> header file. */ +/* Define if you have the <sys/ttold.h> header file. */ #undef HAVE_SYS_TTOLD_H -/* Define if you have the <sys/wait.h> header file. */ +/* Define if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define if you have the <sys/wait.h> header file. */ #undef HAVE_SYS_WAIT_H -/* Define if you have the <termcap.h> header file. */ +/* Define if you have the <termcap.h> header file. */ #undef HAVE_TERMCAP_H -/* Define if you have the <termio.h> header file. */ +/* Define if you have the <termios.h> header file. */ +#undef HAVE_TERMIOS_H + +/* Define if you have the <termio.h> header file. */ #undef HAVE_TERMIO_H -/* Define if you have the <termios.h> header file. */ -#undef HAVE_TERMIOS_H +/* Define if you have the `tsearch' function. */ +#undef HAVE_TSEARCH -/* Define if you have the <unistd.h> header file. */ +/* Define if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H -/* Define if you have the bsd library (-lbsd). */ -#undef HAVE_LIBBSD +/* Define if you have the `vprintf' function. */ +#undef HAVE_VPRINTF -/* Define if you have the i library (-li). */ -#undef HAVE_LIBI +/* Define if you have the `__argz_count' function. */ +#undef HAVE___ARGZ_COUNT + +/* Define if you have the `__argz_next' function. */ +#undef HAVE___ARGZ_NEXT + +/* Define if you have the `__argz_stringify' function. */ +#undef HAVE___ARGZ_STRINGIFY + +/* Define as const if the declaration of iconv() needs const. */ +#undef ICONV_CONST /* Name of package */ #undef PACKAGE +/* Define as the return type of signal handlers (`int' or `void'). */ +#undef RETSIGTYPE + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */ +#undef STAT_MACROS_BROKEN + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define if your <sys/time.h> declares `struct tm'. */ +#undef TM_IN_SYS_TIME + /* Version number of package */ #undef VERSION -/* Define if TIOCGWINSZ requires sys/ioctl.h */ -#undef GWINSZ_IN_SYS_IOCTL +/* Define if on MINIX. */ +#undef _MINIX -/* Define if this function is declared. */ -#undef HAVE_DECL_STRERROR +/* Define if the system does not provide POSIX.1 features except with this + defined. */ +#undef _POSIX_1_SOURCE -/* Define if this function is declared. */ -#undef HAVE_DECL_STRCASECMP +/* Define if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE -/* Define if this function is declared. */ -#undef HAVE_DECL_STRNCASECMP +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const -/* Define if this function is declared. */ -#undef HAVE_DECL_STRCOLL +/* Define as `__inline' if that's what the C compiler calls it, or to nothing + if it is not supported. */ +#undef inline +/* Define to `long' if <sys/types.h> does not define. */ +#undef off_t + +/* Define to `unsigned' if <sys/types.h> does not define. */ +#undef size_t /* Leave that blank line there!! Autoheader needs it. If you're adding to this file, keep in mind: The entries are in sort -df order: alphabetical, case insensitive, ignoring punctuation (such as underscores). */ diff --git a/contrib/texinfo/doc/README b/contrib/texinfo/doc/README index c10fad9797a5..9bd63903e6fb 100644 --- a/contrib/texinfo/doc/README +++ b/contrib/texinfo/doc/README @@ -1,35 +1,35 @@ This directory contains documentation on the Texinfo system and the TeX sources needed to process Texinfo sources. We recommend using the -texi2dvi included in the distribution to run a Texinfo manual through +texi2dvi included in this distribution to run a Texinfo manual through TeX to produce a DVI file. The .tex files are not installed automatically because TeX installations vary so widely. Installing them in the wrong place would give a false sense of security. So, you should simply cp *.tex to the appropriate place. If your installation follows the TeX Directory Structure standard (http://tug.org/tds/), this will be the directory -<texmf>/tex/texinfo/ for texinfo.tex and <texmf>/tex/plain/dvips/ for -epsf.tex. If you use the default installation paths, <texmf> will be -/usr/local/share/texmf. On systems with TeX preinstalled, as most -GNU/Linux distributions offer, <texmf> will often be something like -/usr/share/texmf. +TEXMF/tex/texinfo/ for texinfo.tex, TEXMF/tex/plain/dvips/ for epsf.tex, +and TEXMF/pdftex/plain/misc for pdfcolor.tex. If you use the default +installation paths, TEXMF will be /usr/local/share/texmf. On systems +with TeX preinstalled, as most GNU/Linux distributions offer, TEXMF +will often be something like /usr/share/texmf. It is also possible to put these .tex files in a `local' place instead -of overwriting existing ones, but it is more complicated. See your TeX +of overwriting existing ones, but this is more complicated. See your TeX documentation in general and the texmf.cnf file in particular for information. If you add files to your TeX installations, not just replace existing ones, you very likely have to update your ls-R file; do this with the mktexlsr command. In older versions, this was named MakeTeXls-R. You can get the latest texinfo.tex from ftp://ftp.gnu.org/gnu/texinfo.tex (and all GNU mirrors) ftp://tug.org/tex/texinfo.tex (and all CTAN mirrors) or on the FSF machines in /home/gd/gnu/doc/texinfo.tex. If you have problems with the version in this distribution, please check for a newer version. epsf.tex comes with dvips distributions, and you may already have it installed. The version here is functionally identical but slightly nicer than the one in dvips574. The changes have been sent to the epsf.tex maintainer. diff --git a/contrib/texinfo/doc/help2man b/contrib/texinfo/doc/help2man index d33f7cdf67f1..8f40e8ddb726 100755 --- a/contrib/texinfo/doc/help2man +++ b/contrib/texinfo/doc/help2man @@ -1,401 +1,530 @@ #!/usr/local/bin/perl -w # Generate a short man page from --help and --version output. -# Copyright İ 1997, 98, 99 Free Software Foundation, Inc. +# Copyright İ 1997, 1998, 1999, 2000 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 Brendan O'Dea <bod@compusol.com.au> +# Available from ftp://ftp.gnu.org/gnu/help2man/ use 5.004; use strict; use Getopt::Long; use Text::Tabs qw(expand); use POSIX qw(strftime setlocale LC_TIME); my $this_program = 'help2man'; -my $this_version = '1.013'; +my $this_version = '1.24'; my $version_info = <<EOT; -$this_program $this_version +GNU $this_program $this_version -Copyright (C) 1997, 98, 99 Free Software Foundation, Inc. +Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Brendan O'Dea <bod\@compusol.com.au> EOT my $help_info = <<EOT; `$this_program' generates a man page out of `--help' and `--version' output. Usage: $this_program [OPTION]... EXECUTABLE -n, --name=STRING use `STRING' as the description for the NAME paragraph -s, --section=SECTION use `SECTION' as the section for the man page -i, --include=FILE include material from `FILE' -I, --opt-include=FILE include material from `FILE' if it exists -o, --output=FILE send output to `FILE' -N, --no-info suppress pointer to Texinfo manual --help print this help, then exit - --version print $this_program program version number, then exit + --version print version number, then exit EXECUTABLE should accept `--help' and `--version' options. + +Report bugs to <bug-help2man\@gnu.org>. EOT my $section = 1; -my ($include, $opt_name, $opt_include, $opt_output, $opt_no_info); - -# Parse options. -Getopt::Long::config('bundling'); -GetOptions ( +my ($opt_name, @opt_include, $opt_output, $opt_no_info); +my %opt_def = ( 'n|name=s' => \$opt_name, 's|section=s' => \$section, - 'i|include=s' => \$include, - 'I|opt-include=s' => \$opt_include, + 'i|include=s' => sub { push @opt_include, [ pop, 1 ] }, + 'I|opt-include=s' => sub { push @opt_include, [ pop, 0 ] }, 'o|output=s' => \$opt_output, 'N|no-info' => \$opt_no_info, - help => sub { print $help_info; exit }, - version => sub { print $version_info; exit }, +); + +# Parse options. +Getopt::Long::config('bundling'); +GetOptions (%opt_def, + help => sub { print $help_info; exit }, + version => sub { print $version_info; exit }, ) or die $help_info; die $help_info unless @ARGV == 1; my %include = (); -my @include = (); # to retain order +my %append = (); +my @include = (); # retain order given in include file + +# Provide replacement `quote-regex' operator for pre-5.005. +BEGIN { eval q(sub qr { '' =~ $_[0]; $_[0] }) if $] < 5.005 } # Process include file (if given). Format is: # -# [section name] -# verbatim text +# [section name] +# verbatim text +# +# or +# +# /pattern/ +# verbatim text +# -if ($include or $opt_include) +while (@opt_include) { - if (open INC, $include || $opt_include) + my ($inc, $required) = @{shift @opt_include}; + + next unless -f $inc or $required; + die "$this_program: can't open `$inc' ($!)\n" + unless open INC, $inc; + + my $key; + my $hash = \%include; + + while (<INC>) { - my $sect; + # [section] + if (/^\[([^]]+)\]/) + { + $key = uc $1; + $key =~ s/^\s+//; + $key =~ s/\s+$//; + $hash = \%include; + push @include, $key unless $include{$key}; + next; + } - while (<INC>) + # /pattern/ + if (m!^/(.*)/([ims]*)!) { - if (/^\[([^]]+)\]/) + my $pat = $2 ? "(?$2)$1" : $1; + + # Check pattern. + eval { $key = qr($pat) }; + if ($@) { - $sect = uc $1; - $sect =~ s/^\s+//; - $sect =~ s/\s+$//; - next; + $@ =~ s/ at .*? line \d.*//; + die "$inc:$.:$@"; } - # Silently ignore anything before the first - # section--allows for comments and revision info. - next unless $sect; - - push @include, $sect unless $include{$sect}; - $include{$sect} ||= ''; - $include{$sect} .= $_; + $hash = \%append; + next; } - close INC; - - die "$this_program: no valid information found in `$include'\n" - unless %include; - - # Compress trailing blank lines. - for (keys %include) + # Check for options before the first section--anything else is + # silently ignored, allowing the first for comments and + # revision info. + unless ($key) { - $include{$_} =~ s/\n+$//; - $include{$_} .= "\n" unless /^NAME$/; + # handle options + if (/^-/) + { + local @ARGV = split; + GetOptions %opt_def; + } + + next; } + + $hash->{$key} ||= ''; + $hash->{$key} .= $_; } - else - { - die "$this_program: can't open `$include' ($!)\n" if $include; - } + + close INC; + + die "$this_program: no valid information found in `$inc'\n" + unless $key; +} + +# Compress trailing blank lines. +for my $hash (\(%include, %append)) +{ + for (keys %$hash) { $hash->{$_} =~ s/\n+$/\n/ } } # Turn off localisation of executable's ouput. @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; -# Turn off localisation of date (for strftime) +# Turn off localisation of date (for strftime). setlocale LC_TIME, 'C'; -# Expand tabs, strip trailing spaces and break into paragraphs -sub paragraphs { split /\n\n+/, join '', expand @_ } - -# Grab help and version paragraphs from executable -my @help = paragraphs `$ARGV[0] --help 2>/dev/null` - or die "$this_program: can't get `--help' info from $ARGV[0]\n"; - -my @version = paragraphs `$ARGV[0] --version 2>/dev/null` - or die "$this_program: can't get `--version' info from $ARGV[0]\n"; +# Grab help and version info from executable. +my ($help_text, $version_text) = map { + join '', map { s/ +$//; expand $_ } `$ARGV[0] --$_ 2>/dev/null` + or die "$this_program: can't get `--$_' info from $ARGV[0]\n" +} qw(help version); my $date = strftime "%B %Y", localtime; (my $program = $ARGV[0]) =~ s!.*/!!; my $package = $program; my $version; if ($opt_output) { unlink $opt_output or die "$this_program: can't unlink $opt_output ($!)\n" if -e $opt_output; open STDOUT, ">$opt_output" or die "$this_program: can't create $opt_output ($!)\n"; } # The first line of the --version information is assumed to be in one # of the following formats: # # <version> # <program> <version> # {GNU,Free} <program> <version> # <program> ({GNU,Free} <package>) <version> # <program> - {GNU,Free} <package> <version> # # and seperated from any copyright/author details by a blank line. -$_ = shift @version; +($_, $version_text) = split /\n+/, $version_text, 2; if (/^(\S+) +\(((?:GNU|Free) +[^)]+)\) +(.*)/ or /^(\S+) +- *((?:GNU|Free) +\S+) +(.*)/) { $program = $1; $package = $2; $version = $3; } elsif (/^((?:GNU|Free) +)?(\S+) +(.*)/) { $program = $2; $package = $1 ? "$1$2" : $2; $version = $3; } else { $version = $_; } $program =~ s!.*/!!; -# no info for `info' itself +# No info for `info' itself. $opt_no_info = 1 if $program eq 'info'; -# --name overrides --include contents -$include{NAME} = "$program \\- $opt_name" if $opt_name; +# --name overrides --include contents. +$include{NAME} = "$program \\- $opt_name\n" if $opt_name; -# Default (useless) NAME paragraph -$include{NAME} ||= "$program \\- manual page for $program $version"; +# Default (useless) NAME paragraph. +$include{NAME} ||= "$program \\- manual page for $program $version\n"; # Man pages traditionally have the page title in caps. my $PROGRAM = uc $program; -# Header. -print <<EOT; -.\\" DO NOT MODIFY THIS FILE! It was generated by $this_program $this_version. -.TH $PROGRAM "$section" "$date" "$package $version" FSF -.SH NAME -$include{NAME} -EOT +# Extract usage clause(s) [if any] for SYNOPSIS. +if ($help_text =~ s/^Usage:( +(\S+))(.*)((?:\n(?: {6}\1| *or: +\S).*)*)//m) +{ + my @syn = $2 . $3; + + if ($_ = $4) + { + s/^\n//; + for (split /\n/) { s/^ *(or: +)?//; push @syn, $_ } + } -my $break; -my $accumulate = 1; -my @description = (); + my $synopsis = ''; + for (@syn) + { + $synopsis .= ".br\n" if $synopsis; + s!^\S*/!!; + s/^(\S+) *//; + $synopsis .= ".B $1\n"; + s/\s+$//; + s/(([][]|\.\.+)+)/\\fR$1\\fI/g; + s/^/\\fI/ unless s/^\\fR//; + $_ .= '\fR'; + s/(\\fI)( *)/$2$1/g; + s/\\fI\\fR//g; + s/^\\fR//; + s/\\fI$//; + s/^\./\\&./; + + $synopsis .= "$_\n"; + } + + $include{SYNOPSIS} ||= $synopsis; +} + +# Process text, initial section is DESCRIPTION. +my $sect = 'DESCRIPTION'; +$_ = "$help_text\n\n$version_text"; + +# Normalise paragraph breaks. +s/^\n+//; +s/\n*$/\n/; +s/\n\n+/\n\n/g; + +# Temporarily exchange leading dots, apostrophes and backslashes for +# tokens. +s/^\./\x80/mg; +s/^'/\x81/mg; +s/\\/\x82/g; + +# Start a new paragraph (if required) for these. +s/([^\n])\n(Report +bugs|Email +bug +reports +to|Written +by)/$1\n\n$2/g; sub convert_option; -# Output converted --help information. -for (@help) +while (length) { - chomp; + # Convert some standard paragraph names. + if (s/^(Options|Examples): *\n//) + { + $sect = uc $1; + next; + } - if (s/^Usage: +\S+ +(.*)\n?//) + # Copyright section + if (/^Copyright +[(\xa9]/) { - # Turn the usage clause into a synopsis. - my $synopsis = ''; - - do { - my $syn = $1; - $syn =~ s/(([][]|\.\.+)+)/\\fR$1\\fI/g; - $syn =~ s/^/\\fI/ unless $syn =~ s/^\\fR//; - $syn .= '\fR'; - $syn =~ s/\\fI( *)\\fR/$1/g; - - $synopsis .= ".br\n" unless $accumulate; - $synopsis .= ".B $program\n"; - $synopsis .= "$syn\n"; - $accumulate = 0; - } while s/^(?:Usage| *or): +\S+ +(.*)\n?//; - - # Include file overrides SYNOPSIS. - print ".SH SYNOPSIS\n", $include{SYNOPSIS} || $synopsis; - - # Dump any accumulated description text. - print ".SH DESCRIPTION\n"; - print @description; - - # Add additional description text from include file. - if ($include{DESCRIPTION}) + $sect = 'COPYRIGHT'; + $include{$sect} ||= ''; + $include{$sect} .= ".PP\n" if $include{$sect}; + + my $copy; + ($copy, $_) = split /\n\n/, $_, 2; + + for ($copy) { - print ".PP\n" unless $include{DESCRIPTION} =~ /^\..P/; - print $include{DESCRIPTION}; + # Add back newline + s/\n*$/\n/; + + # Convert iso9959-1 copyright symbol or (c) to nroff + # character. + s/^Copyright +(?:\xa9|\([Cc]\))/Copyright \\(co/mg; + + # Insert line breaks before additional copyright messages + # and the disclaimer. + s/(.)\n(Copyright |This +is +free +software)/$1\n.br\n$2/g; + + # Join hyphenated lines. + s/([A-Za-z])-\n */$1/g; } - $break = 1; - next unless $_; + $include{$sect} .= $copy; + $_ ||= ''; + next; } - # Accumulate text if the synopsis has not been produced yet. - if ($accumulate) + # Catch bug report text. + if (/^(Report +bugs|Email +bug +reports +to) /) { - push @description, ".PP\n" if @description; - push @description, "$_\n"; - next; + $sect = 'REPORTING BUGS'; } - # Convert some standard paragraph names - if (s/^(Options|Examples): *\n//) + # Author section. + elsif (/^Written +by/) { - print qq(.SH \U$1\n); - $break = ''; - next unless length; + $sect = 'AUTHOR'; } - # Catch bug report text. - if (/^Report bugs |^Email bug reports to /) + # Examples, indicated by an indented leading $, % or > are + # rendered in a constant width font. + if (/^( +)([\$\%>] )\S/) { - print qq(.SH "REPORTING BUGS"\n$_\n); - $break = ''; + my $indent = $1; + my $prefix = $2; + my $break = '.IP'; + $include{$sect} ||= ''; + while (s/^$indent\Q$prefix\E(\S.*)\n*//) + { + $include{$sect} .= "$break\n\\f(CW$prefix$1\\fR\n"; + $break = '.br'; + } + next; } - # Option subsections have second line indented. - if (s/^(\S.*)\n / /) + my $matched = ''; + $include{$sect} ||= ''; + + # Sub-sections have a trailing colon and the second line indented. + if (s/^(\S.*:) *\n / /) { - print qq(.SS "$1"\n); - $break = ''; + $matched .= $& if %append; + $include{$sect} .= qq(.SS "$1"\n); } - my $output = ''; - while (length) - { - my $indent = 0; + my $indent = 0; + my $content = ''; - # Tagged paragraph - if (s/^( +(\S.*?) +)(\S.*)\n?//) + # Option with description. + if (s/^( {1,10}([+-]\S.*?))(?:( +)|\n( {20,}))(\S.*)\n//) + { + $matched .= $& if %append; + $indent = length ($4 || "$1$3"); + $content = ".TP\n\x83$2\n\x83$5\n"; + unless ($4) { - $indent = length $1; - $output .= ".TP\n$2\n$3\n"; - $break = 1; + # Indent may be different on second line. + $indent = length $& if /^ {20,}/; } + } - # Indented paragraph - elsif (s/^( +)(\S.*)\n?//) - { - $indent = length $1; - $output .= ".IP\n$2\n"; - $break = 1; - } + # Option without description. + elsif (s/^ {1,10}([+-]\S.*)\n//) + { + $matched .= $& if %append; + $content = ".HP\n\x83$1\n"; + $indent = 80; # not continued + } - # Left justified paragraph - else - { - s/(.*)\n?//; - $output .= ".PP\n" if $break; - $output .= "$1\n"; - $break = 1; - } + # Indented paragraph with tag. + elsif (s/^( +(\S.*?) +)(\S.*)\n//) + { + $matched .= $& if %append; + $indent = length $1; + $content = ".TP\n\x83$2\n\x83$3\n"; + } + + # Indented paragraph. + elsif (s/^( +)(\S.*)\n//) + { + $matched .= $& if %append; + $indent = length $1; + $content = ".IP\n\x83$2\n"; + } + + # Left justified paragraph. + else + { + s/(.*)\n//; + $matched .= $& if %append; + $content = ".PP\n" if $include{$sect}; + $content .= "$1\n"; + } - # Continuations - $output .= "$1\n" while s/^ {$indent}(\S.*)\n?//; + # Append continuations. + while (s/^ {$indent}(\S.*)\n//) + { + $matched .= $& if %append; + $content .= "\x83$1\n" } - $_ = $output; + # Move to next paragraph. + s/^\n+//; - # Escape backslashes. - s/\\/\\e/g; + for ($content) + { + # Leading dot and apostrophe protection. + s/\x83\./\x80/g; + s/\x83'/\x81/g; + s/\x83//g; - # Convert options. - s/(^| )(-[][\w=-]+)/$1 . convert_option $2/mge; - print; -} + # Convert options. + s/(^| )(-[][\w=-]+)/$1 . convert_option $2/mge; + } -# Print any include items other than the ones we have already dealt -# with. -for (@include) -{ - print qq(.SH "$_"\n$include{$_}) - unless /^(NAME|SYNOPSIS|DESCRIPTION|SEE ALSO)$/; + # Check if matched paragraph contains /pat/. + if (%append) + { + for my $pat (keys %append) + { + if ($matched =~ $pat) + { + $content .= ".PP\n" unless $append{$pat} =~ /^\./; + $content .= $append{$pat}; + } + } + } + + $include{$sect} .= $content; } # Refer to the real documentation. -if ($include{'SEE ALSO'} or !$opt_no_info) +unless ($opt_no_info) { - print qq(.SH "SEE ALSO"\n); - print $include{'SEE ALSO'}, ".PP\n" if $include{'SEE ALSO'}; - - print <<EOT unless $opt_no_info; + $sect = 'SEE ALSO'; + $include{$sect} ||= ''; + $include{$sect} .= ".PP\n" if $include{$sect}; + $include{$sect} .= <<EOT; The full documentation for .B $program is maintained as a Texinfo manual. If the .B info and .B $program programs are properly installed at your site, the command .IP .B info $program .PP should give you access to the complete manual. EOT } -# Output converted --version information. -for (@version) -{ - chomp; - - # Join hyphenated lines. - s/([A-Za-z])-\n */$1/g; - - # Convert copyright symbol or (c) to nroff character. - s/Copyright +(?:\xa9|\([Cc]\))/Copyright \\(co/g; - - # Insert appropriate headings for copyright and author. - if (/^Copyright \\/) { print ".SH COPYRIGHT\n" } - elsif (/^Written +by/) { print ".SH AUTHOR\n" } - else { print ".PP\n"; } +# Output header. +print <<EOT; +.\\" DO NOT MODIFY THIS FILE! It was generated by $this_program $this_version. +.TH $PROGRAM "$section" "$date" "$package $version" FSF +EOT - # Insert line breaks before additional copyright messages and the - # disclaimer. - s/(.)\n(Copyright |This is free software)/$1\n.br\n$2/g; +# Section ordering. +my @pre = qw(NAME SYNOPSIS DESCRIPTION OPTIONS EXAMPLES); +my @post = ('AUTHOR', 'REPORTING BUGS', 'COPYRIGHT', 'SEE ALSO'); +my $filter = join '|', @pre, @post; - print "$_\n"; +# Output content. +for (@pre, (grep ! /^($filter)$/o, @include), @post) +{ + if ($include{$_}) + { + my $quote = /\W/ ? '"' : ''; + print ".SH $quote$_$quote\n"; + + for ($include{$_}) + { + # Replace leading dot, apostrophe and backslash tokens. + s/\x80/\\&./g; + s/\x81/\\&'/g; + s/\x82/\\e/g; + print; + } + } } exit; # Convert option dashes to \- to stop nroff from hyphenating 'em, and # embolden. Option arguments get italicised. sub convert_option { - my $option = '\fB' . shift; + local $_ = '\fB' . shift; - $option =~ s/-/\\-/g; - unless ($option =~ s/\[=(.*)\]$/\\fR[=\\fI$1\\fR]/) + s/-/\\-/g; + unless (s/\[=(.*)\]$/\\fR[=\\fI$1\\fR]/) { - $option =~ s/=(.)/\\fR=\\fI$1/; - $option =~ s/ (.)/ \\fI$1/; - $option .= '\fR'; + s/=(.)/\\fR=\\fI$1/; + s/ (.)/ \\fI$1/; + $_ .= '\fR'; } - $option; + $_; } diff --git a/contrib/texinfo/doc/info-stnd.texi b/contrib/texinfo/doc/info-stnd.texi index c08a8a5217f4..aaccfd2007ae 100644 --- a/contrib/texinfo/doc/info-stnd.texi +++ b/contrib/texinfo/doc/info-stnd.texi @@ -1,1925 +1,2211 @@ \input texinfo @c -*-texinfo-*- @comment %**start of header @setfilename info-stnd.info @settitle GNU Info @synindex vr cp @synindex fn cp @synindex ky cp @comment %**end of header -@comment $Id: info-stnd.texi,v 1.23 1999/06/25 21:57:04 karl Exp $ +@comment $Id: info-stnd.texi,v 1.33 2002/03/02 15:03:54 karl Exp $ -@include version.texi +@include version-stnd.texi @dircategory Texinfo documentation system @direntry -* Standalone info program: (info-stnd). Standalone Info-reading program. +* info standalone: (info-stnd). Read Info documents without Emacs. +* infokey: (info-stnd)Invoking infokey. Compile Info customizations. @end direntry @ifinfo This file documents GNU Info, a program for viewing the on-line formatted versions of Texinfo files. This documentation is different from the documentation for the Info reader that is part of GNU Emacs. If you do not know how to use Info, but have a working Info reader, you should read that documentation first. -Copyright @copyright{} 1992, 93, 96, 97, 98, 99 Free Software Foundation, Inc. +Copyright @copyright{} 1992, 93, 96, 97, 98, 99, +2001, 02 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 preserved on all copies. @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 one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). @end ignore Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the sections entitled ``Copying'' and ``GNU General Public License'' are included exactly as in the original, and provided that the entire resulting derived work is distributed 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, except that this permission notice may be stated in a translation approved by the Free Software Foundation. @end ifinfo @titlepage @title GNU Info @subtitle for version @value{VERSION}, @value{UPDATED} @author Brian J. Fox (bfox@@gnu.org) @page @vskip 0pt plus 1filll -Copyright @copyright{} 1992, 93, 97, 98, 99 Free Software Foundation +Copyright @copyright{} 1992, 93, 97, 98, 99, 2001, 02 Free Software Foundation This manual is for GNU Info version @value{VERSION}, @value{UPDATED}. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the sections entitled ``Copying'' and ``GNU General Public License'' are included exactly as in the original, and provided that the entire resulting derived work is distributed 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, except that this permission notice may be stated in a translation approved by the Free Software Foundation. @end titlepage +@contents + @ifnottex @node Top @top GNU Info This file documents GNU Info, a program for viewing the on-line formatted versions of Texinfo files, version @value{VERSION}. This documentation is different from the documentation for the Info reader that is part of GNU Emacs. This manual is for Info version @value{VERSION}, updated @value{UPDATED}. @end ifnottex @menu * What is Info:: What is Info? * Invoking Info:: Options you can pass on the command line. * Cursor Commands:: Commands which move the cursor within a node. -* Scrolling Commands:: Commands for moving the node around - in a window. +* Scrolling Commands:: Commands for reading the text within a node. * Node Commands:: Commands for selecting a new node. * Searching Commands:: Commands for searching an Info file. * Xref Commands:: Commands for selecting cross references. * Window Commands:: Commands which manipulate multiple windows. * Printing Nodes:: How to print out the contents of a node. * Miscellaneous Commands:: A few commands that defy categories. * Variables:: How to change the default behavior of Info. -* GNU Info Global Index:: Global index containing keystrokes, +* Custom Key Bindings:: How to define your own key-to-command + bindings. +* Index:: Global index containing keystrokes, command names, variable names, and general concepts. @end menu @node What is Info @chapter What is Info? @dfn{Info} is a program which is used to view Info files on an ASCII terminal. @dfn{Info files} are the result of processing Texinfo files with the program @code{makeinfo} or with one of the Emacs commands, such as @code{M-x texinfo-format-buffer}. Texinfo itself is a documentation system that uses a single source file to produce both on-line information and printed output. You can typeset and print the files that you read in Info. @node Invoking Info @chapter Invoking Info -@cindex invoking info + +@cindex Info, invoking +@cindex invoking Info @cindex command line options @cindex options, command line @cindex arguments, command line GNU Info accepts several options to control the initial node being viewed, and to specify which directories to search for Info files. Here is a template showing an invocation of GNU Info from the shell: @example info [@var{option}]@dots{} [@var{menu-item}@dots{}] @end example The program accepts the following options: @table @code +@anchor{--apropos} @item --apropos=@var{string} @cindex Searching all indices @cindex Info files@r{, searching all indices} @cindex Apropos@r{, in Info files} Specify a string to search in every index of every Info file installed on your system. Info looks up the named @var{string} in all the indices it can find, prints the results to standard output, and then exits. If you are not sure which Info file explains certain issues, this option is your friend. Note that if your system has a lot of Info files installed, searching all of them might take some time. +You can invoke the apropos command from inside Info; see +@ref{Searching Commands}. + @cindex directory path @item --directory @var{directory-path} @itemx -d @var{directory-path} Prepend @var{directory-path} to the list of directory paths searched when Info needs to find a file. You may issue @code{--directory} multiple times; once for each directory which contains Info files. The list of directories searched by Info is constructed from the value of the environment variable @code{INFOPATH}; @code{--directory} causes the named @var{directory-path} to be prepended to that list. The value of @code{INFOPATH} is a list of directories usually separated by a colon; on MS-DOS/MS-Windows systems, the semicolon is used. If you do not define @code{INFOPATH}, Info uses a default path defined when Info was built as the initial list of directories. If the value of @code{INFOPATH} ends with a colon (or semicolon on MS-DOS/MS-Windows), the initial list of directories is constructed by appending the build-time default to the value of @code{INFOPATH}. @cindex keystrokes, recording @cindex remembering user keystrokes @item --dribble=@var{dribble-file} Specify a file where all user keystrokes will be recorded. This file can be used later to replay the same sequence of commands, see the @samp{--restore} option below. @item --file @var{filename} @itemx -f @var{filename} @cindex Info file, selecting Specify a particular Info file to visit. By default, Info visits the file @code{dir}; if you use this option, Info will start with @code{(@var{filename})Top} as the first file and node. @cindex relative Info file names @cindex file names, relative @cindex Info files, relative If @var{filename} is an absolute file name, or begins with @file{./} or @file{../}, Info looks for @var{filename} only in the directory of the specified @var{filename}, and adds the directory of @var{filename} to the value of @code{INFOPATH}. In contrast, if @var{filename} is in the form of a relative file name, but without the @file{./} or @file{../} prefix, Info will only look for it in the directories specified in @code{INFOPATH}. In other words, Info does @emph{not} treat file names which lack @file{./} and @file{../} prefix as relative to the current directory. @cindex compressed Info files @cindex files, compressed @cindex Info files, compressed In every directory Info tries, if @var{filename} is not found, Info looks for it with a number of known extensions of Info files@footnote{ @file{.info}, @file{-info}, @file{/index}, and @file{.inf}.}. For every known extension, Info looks for a compressed file, if a regular file isn't found. Info supports files compressed with @code{gzip}, @code{bzip2}, @code{compress} and @code{yabba} programs; it calls @code{gunzip}, @code{bunzip2}, @code{uncompress} and @code{unyabba}, accordingly, to decompress such files. Compressed Info files are assumed to have @file{.z}, @file{.gz}, @file{.bz2}, @file{.Z}, or @file{.Y} extensions, possibly in addition to one of the known Info files extensions@footnote{The MS-DOS version allows for the Info extension, such as @code{.inf}, and the short compressed file extensions, such as @file{.z} and @file{.gz}, to be merged into a single extension, since DOS doesn't allow more than a single dot in the basename of a file. Thus, on MS-DOS, if Info looks for @file{bison}, file names like @file{bison.igz} and @file{bison.inz} will be found and decompressed by @code{gunzip}.}. @item --help @itemx -h Produces a relatively brief description of the available Info options. @item --index-search @var{string} @cindex index search, selecting from the command line @cindex online help, using Info as After processing all command-line arguments, go to the index in the Info file and search for index entries which matche @var{string}. If such an entry is found, the Info session begins with displaying the node pointed to by the first matching index entry; press @kbd{,} to step through the rest of the matching entries. If no such entry exists, print @samp{no entries found} and exit with nonzero status. This can be used from another program as a way to provide online help, or as a quick way of starting to read an Info file at a certain node when you don't know the exact name of that node. +This command can also be invoked from inside Info; see @ref{Searching +Commands}. + @item --node @var{nodename} @itemx -n @var{nodename} @cindex node, selecting from the command line Specify a particular node to visit in the initial file that Info loads. This is especially useful in conjunction with @code{--file}@footnote{Of course, you can specify both the file and node in a @code{--node} command; but don't forget to escape the open and close parentheses and whitespace from the shell as in: @code{info --node "(emacs)Buffers"}.}. You may specify @code{--node} multiple times; for an interactive Info, each @var{nodename} is visited in its own window, for a non-interactive Info (such as when @code{--output} is given) each @var{nodename} is processed sequentially. @item --output @var{filename} @itemx -o @var{filename} @cindex file, outputting to @cindex outputting to a file Specify @var{filename} as the name of a file to which to direct output. Each node that Info visits will be output to @var{filename} instead of interactively viewed. A value of @code{-} for @var{filename} specifies the standard output. +@cindex colors in man pages +@cindex ANSI escape sequences in man pages +@item --raw-escapes +@itemx -R +Do not remove ANSI escape sequences from man pages. Some versions of +Groff, the GNU document formatter, produce man pages with ANSI escape +sequences for bold, italics, and underlined characters, and for +colorized text. By default, Info removes those escape sequences +before it displays the man page. If your terminal supports these +escapes, use @code{--raw-escapes} to let the terminal handle them and +display the man pages with those attributes. + @cindex replaying recorded keystrokes @item --restore=@var{dribble-file} Read keystrokes from @var{dribble-file}, presumably recorded during previous Info session (see the description of the @samp{--dribble} option above). When the keystrokes in the files are all read, Info reverts its input to the usual interactive operation. @anchor{--show-options} @cindex command-line options, how to find @cindex invocation description, how to find @item --show-options @itemx --usage @itemx -O This option causes Info to look for the node that describes how to invoke the program and its command-line options, and begin the session by displaying that node. It is provided to make it easier to find the most important usage information in a manual without the need to wade through complex menu hierarchies. The effect is similar to the @code{M-x goto-invocation} command (@pxref{goto-invocation}) from inside Info. @cindex speech synthesizers @item --speech-friendly @itemx -b On MS-DOS/MS-Windows only, this option causes Info to use standard file I/O functions for screen writes. (By default, Info uses direct writes to the video memory on these systems, for faster operation and colored display support.) This allows the speech synthesizers used by blind persons to catch the output and convert it to audible speech. @item --subnodes @cindex @code{--subnodes}, command line option This option only has meaning when given in conjunction with @code{--output}. It means to recursively output the nodes appearing in the menus of each node being output. Menu items which resolve to external Info files are not output, and neither are menu items which are members of an index. Each node is only output once. @item --version @cindex version information Prints the version information of Info and exits. @anchor{--vi-keys} @cindex vi-like key bindings @cindex Less-like key bindings @item --vi-keys This option binds functions to keys differently, to emulate the key bindings of @code{vi} and Less. The default key bindings are generally modeled after Emacs. +(@xref{Custom Key Bindings}, +for a more general way of altering GNU Info's key bindings.) @item @var{menu-item} @cindex menu, following @anchor{command-line menu items} Info treats its remaining arguments as the names of menu items. The first argument is a menu item in the initial node visited (generally @code{dir}), the second argument is a menu item in the first argument's node, etc. You can easily move to the node of your choice by specifying the menu names which describe the path to that node. For example, @example info emacs buffers @end example @noindent first selects the menu item @samp{Emacs} in the node @samp{(dir)Top}, and then selects the menu item @samp{Buffers} in the node @samp{(emacs)Top}. @end table To avoid searching the @file{dir} files and just show some arbitrary file, use @samp{-f} and the filename, as in @samp{info -f ./foo.info}. The index search and the search for the node which describes program invocation and command-line options begins @emph{after} processing all the command-line menu items. Therefore, the Info file searched for the index or the invocation node is the file where Info finds itself after following all the menu items given on the command line. This is so @samp{info emacs --show-options} does what you'd expect. @c FIXME: the feature with lowercasing the file name isn't documented @node Cursor Commands @chapter Moving the Cursor @cindex cursor, moving @cindex moving the cursor Many people find that reading screens of text page by page is made easier when one is able to indicate particular pieces of text with some kind of pointing device. Since this is the case, GNU Info (both the Emacs and standalone versions) have several commands which allow you to move the cursor about the screen. The notation used in this manual to describe keystrokes is identical to the notation used within the Emacs manual, and the GNU Readline manual. @xref{Characters, , Character Conventions, emacs, the GNU Emacs Manual}, if you are unfamiliar with the notation@footnote{ Here's a short summary. @kbd{C-@var{x}} means press the @kbd{CTRL} key and the key @var{x}. @kbd{M-@var{x}} means press the @kbd{META} key and the key @var{x}. On many terminals th @kbd{META} key is known as the @kbd{ALT} key. @kbd{SPC} is the space bar. The other keys are usually called by the names imprinted on them.}. The following table lists the basic cursor movement commands in Info. Each entry consists of the key sequence you should type to execute the cursor movement, the @code{M-x}@footnote{@code{M-x} is also a command; it invokes @code{execute-extended-command}. @xref{M-x, , Executing an extended command, emacs, the GNU Emacs Manual}, for more detailed information.} command name (displayed in parentheses), and a short description of what the command does. All of the cursor motion commands can take a @dfn{numeric} argument (see @ref{Miscellaneous Commands, @code{universal-argument}, to find out how to supply them}. With a numeric argument, the motion commands are simply executed that many times; for example, a numeric argument of 4 given to @code{next-line} causes the cursor to move down 4 lines. With a negative numeric argument, the motion is reversed; an argument of -4 given to the @code{next-line} command would cause the cursor to move @emph{up} 4 lines. @table @asis @item @key{C-n} (@code{next-line}) @itemx @key{DOWN} (an arrow key) @kindex C-n @kindex DOWN (an arrow key) @findex next-line Move the cursor down to the next line. @item @key{C-p} (@code{prev-line}) @itemx @key{UP} (an arrow key) @kindex C-p @kindex UP (an arrow key) @findex prev-line Move the cursor up to the previous line. @item @key{C-a} (@code{beginning-of-line}) @itemx @key{Home} (on DOS/Windows only) @kindex C-a, in Info windows @kindex Home @findex beginning-of-line Move the cursor to the start of the current line. @item @key{C-e} (@code{end-of-line}) @itemx @key{End} (on DOS/Windows only) @kindex C-e, in Info windows @kindex End @findex end-of-line Move the cursor to the end of the current line. @item @key{C-f} (@code{forward-char}) @itemx @key{RIGHT} (an arrow key) @kindex C-f, in Info windows @kindex RIGHT (an arrow key) @findex forward-char Move the cursor forward a character. @item @key{C-b} (@code{backward-char}) @itemx @key{LEFT} (an arrow key) @kindex C-b, in Info windows @kindex LEFT (an arrow key) @findex backward-char Move the cursor backward a character. @item @key{M-f} (@code{forward-word}) @itemx @kbd{C-@key{RIGHT}} (on DOS/Windows only) @kindex M-f, in Info windows @kindex C-RIGHT @findex forward-word Move the cursor forward a word. @item @key{M-b} (@code{backward-word}) @itemx @kbd{C-@key{LEFT}} (on DOS/Windows only) @kindex M-b, in Info windows @kindex C-LEFT @findex backward-word Move the cursor backward a word. @item @key{M-<} (@code{beginning-of-node}) @itemx @key{C-@key{Home}} (on DOS/Windows only) @itemx @key{b} @itemx @key{M-b}, vi-like operation @kindex b, in Info windows @kindex M-< @kindex C-Home @kindex M-b, vi-like operation @findex beginning-of-node Move the cursor to the start of the current node. @item @key{M->} (@code{end-of-node}) @itemx @key{C-@key{End}} (on DOS/Windows only) @itemx @key{e} @kindex M-> @kindex e, in Info windows @kindex C-End @findex end-of-node Move the cursor to the end of the current node. @item @key{M-r} (@code{move-to-window-line}) @kindex M-r @findex move-to-window-line Move the cursor to a specific line of the window. Without a numeric argument, @code{M-r} moves the cursor to the start of the line in the center of the window. With a numeric argument of @var{n}, @code{M-r} moves the cursor to the start of the @var{n}th line in the window. @end table -@node Scrolling Commands, Node Commands, Cursor Commands, Top + +@node Scrolling Commands @chapter Moving Text Within a Window @cindex scrolling Sometimes you are looking at a screenful of text, and only part of the current paragraph you are reading is visible on the screen. The commands detailed in this section are used to shift which part of the current node is visible on the screen. Scrolling commands are bound differently when @samp{--vi-keys} operation (@pxref{--vi-keys}) is in effect. These key bindings are designated with ``vi-like operation''. @table @asis @item @key{SPC} (@code{scroll-forward}) -@itemx @key{NEXT} (an arrow key) -@itemx @key{C-v} -@itemx @key{C-f}, vi-like operation -@itemx @key{f}, vi-like operation -@itemx @key{M-SPC}, vi-like operation @kindex SPC, in Info windows -@kindex NEXT -@kindex C-v -@kindex C-f, vi-like operation -@kindex f, vi-like operation -@kindex M-SPC, vi-like operation @findex scroll-forward Shift the text in this window up. That is, show more of the node which is currently below the bottom of the window. With a numeric argument, show that many more lines at the bottom of the window; a numeric argument of 4 would shift all of the text in the window up 4 lines (discarding the top 4 lines), and show you four new lines at the bottom of the window. Without a numeric argument, @key{SPC} takes the bottom two lines of the window and places them at the top of the window, redisplaying almost a completely new screenful of lines. If you are at -the end of a node, SPC takes you to the ``next'' node, so that you can -read an entire manual from start to finish by repeating SPC. +the end of a node, @key{SPC} takes you to the ``next'' node, so that you can +read an entire manual from start to finish by repeating @key{SPC}. The default scroll size is one screen-full, but it can be changed by -invoking the (@code{scroll-forward-set-window}) command, @samp{z} under -@samp{--vi-keys}, with a numeric argument. +invoking the (@code{scroll-forward-page-only-set-window}) command, +@samp{z} under @samp{--vi-keys}, with a numeric argument. + +@item @key{NEXT} (an arrow key) (@code{scroll-forward-page-only}) +@itemx @key{C-v} +@itemx @key{C-f}, vi-like operation +@itemx @key{f}, vi-like operation +@itemx @key{M-SPC}, vi-like operation +@kindex NEXT +@kindex C-v +@kindex C-f, vi-like operation +@kindex f, vi-like operation +@kindex M-SPC, vi-like operation +@findex scroll-forward-page-only +Shift the text in this window up. This is identical to the @key{SPC} +operation above, except that it never scrolls beyond the end of the +current node. @kindex PageDown The @key{NEXT} key is known as the @key{PageDown} key on some -keyboards. When you use @key{NEXT} or @key{PageDown} to scroll, Info -never scrolls beyond the end of the current node. +keyboards. -@item @key{z} (@code{scroll-forward-set-window}, vi-like operation) +@item @key{z} (@code{scroll-forward-page-only-set-window}, vi-like operation) @kindex z, vi-like operation -@findex scroll-forward-set-window -Scroll forward, like with @key{SPC}, but if a numeric argument is +@findex scroll-forward-page-only-set-window +Scroll forward, like with @key{NEXT}, but if a numeric argument is specified, it becomes the default scroll size for subsequent -@code{scroll-forward} and @code{scroll-backward} commands. +@code{scroll-forward} and @code{scroll-backward} commands and their +ilk. @item @key{DEL} (@code{scroll-backward}) -@itemx @key{PREVIOUS} (arrow key) +@kindex DEL, in Info windows +@findex scroll-backward +Shift the text in this window down. The inverse of +@code{scroll-forward}. +If you are at the start of a node, @key{DEL} takes you to the +``previous'' node, so that you can read an entire manual from finish to +start by repeating @key{DEL}. The default scroll size can be changed by +invoking the (@code{scroll-backward-page-only-set-window}) command, +@samp{w} under @samp{--vi-keys}, with a numeric argument. + +@itemx @key{PREVIOUS} (arrow key) (@code{scroll-backward-page-only}) @itemx @key{PRIOR} (arrow key) @itemx @key{M-v} @itemx @key{b}, vi-like operation @itemx @key{C-b}, vi-like operation -@kindex DEL, in Info windows @kindex PREVIOUS @kindex M-v @kindex b, vi-like operation @kindex C-b, vi-like operation -@findex scroll-backward +@findex scroll-backward-page-only Shift the text in this window down. The inverse of -@code{scroll-forward}. The default scroll size can be changed by -invoking the(@code{scroll-backward-set-window}) command, @samp{w} under +@code{scroll-forward-page-only}. Does not scroll beyond the start of +the current node. The default scroll size can be changed by invoking +the(@code{scroll-backward-page-only-set-window}) command, @samp{w} under @samp{--vi-keys}, with a numeric argument. -@item @key{w} (@code{scroll-backward-set-window}, vi-like operation) +@item @key{w} (@code{scroll-backward-page-only-set-window}, vi-like operation) @kindex w, vi-like operation -@findex scroll-backward-set-window -Scroll backward, like with @key{DEL}, but if a numeric argument is +@findex scroll-backward-page-only-set-window +Scroll backward, like with @key{PREVIOUS}, but if a numeric argument is specified, it becomes the default scroll size for subsequent @code{scroll-forward} and @code{scroll-backward} commands. @item @key{C-n} (@code{down-line}, vi-like operation) @itemx @key{C-e}, vi-like operation @itemx @key{RET}, vi-like operation @itemx @key{LFD}, vi-like operation @itemx @key{DOWN}, vi-like operation @kindex C-n, vi-like operation @kindex C-e, vi-like operation @kindex RET, vi-like operation @kindex LFD, vi-like operation @kindex DOWN, vi-like operation @findex down-line Scroll forward by one line. With a numeric argument, scroll forward that many lines. @item @key{C-p} (@code{up-line}, vi-like operation) @itemx @key{UP}, vi-like operation @itemx @key{y}, vi-like operation @itemx @key{k}, vi-like operation @itemx @key{C-k}, vi-like operation @itemx @key{C-y}, vi-like operation @kindex C-p, vi-like operation @kindex UP, vi-like operation @kindex y, vi-like operation @kindex k, vi-like operation @kindex C-k, vi-like operation @kindex C-y, vi-like operation @findex up-line Scroll backward one line. With a numeric argument, scroll backward that many lines. @item @key{d} (@code{scroll-half-screen-down}, vi-like operation) @itemx @key{C-d}, vi-like operation @kindex d, vi-like operation @kindex C-d, vi-like operation @findex scroll-half-screen-down Scroll forward by half of the screen size. With a numeric argument, scroll that many lines. If an argument is specified, it becomes the new default number of lines to scroll for subsequent @samp{d} and @samp{u} commands. @item @key{u} (@code{scroll-half-screen-up}, vi-like operation) @itemx @key{C-u}, vi-like operation @kindex u, vi-like operation @kindex C-u, vi-like operation @findex scroll-half-screen-up Scroll back by half of the screen size. With a numeric argument, scroll that many lines. If an argument is specified, it becomes the new default number of lines to scroll for subsequent @samp{u} and @samp{d} commands. @end table @cindex scrolling through node structure The @code{scroll-forward} and @code{scroll-backward} commands can also move forward and backward through the node structure of the file. If you press @key{SPC} while viewing the end of a node, or @key{DEL} while viewing the beginning of a node, what happens is controlled by the variable @code{scroll-behavior}. @xref{Variables, @code{scroll-behavior}}, for more information. +The @code{scroll-forward-page-only} and @code{scroll-backward-page-only} +commands never scroll beyond the current node. + @kindex PageUp The @key{PREVIOUS} key is the @key{PageUp} key on many keyboards. Emacs refers to it by the name @key{PRIOR}. When you use @key{PRIOR} or @key{PageUp} to scroll, Info never scrolls beyond the beginning of the current node. @kindex BS (backspace) If your keyboard lacks the @key{DEL} key, look for a key called @key{BS}, or @samp{BackSpace}, sometimes designated with an arrow which points to the left, which should perform the same function. @table @asis @item @key{C-l} (@code{redraw-display}) @kindex C-l @findex redraw-display Redraw the display from scratch, or shift the line containing the cursor to a specified location. With no numeric argument, @samp{C-l} clears the screen, and then redraws its entire contents. Given a numeric argument of @var{n}, the line containing the cursor is shifted so that it is on the @var{n}th line of the window. @item @kbd{C-x @key{w}} (@code{toggle-wrap}) @kindex C-w @findex toggle-wrap Toggles the state of line wrapping in the current window. Normally, lines which are longer than the screen width @dfn{wrap}, i.e., they are continued on the next line. Lines which wrap have a @samp{\} appearing in the rightmost column of the screen. You can cause such lines to be terminated at the rightmost column by changing the state of line wrapping in the window with @code{C-x w}. When a line which needs more space than one screen width to display is displayed, a @samp{$} appears in the rightmost column of the screen, and the remainder of the line is invisible. When long lines are truncated, the modeline displays the @samp{$} character near its left edge. @end table -@node Node Commands, Searching Commands, Scrolling Commands, Top -@chapter Selecting a New Node + +@node Node Commands +@chapter Selecting a Node @cindex nodes, selection of This section details the numerous Info commands which select a new node to view in the current window. The most basic node commands are @samp{n}, @samp{p}, @samp{u}, and @samp{l}. Note that the commands to select nodes are mapped differently when @samp{--vi-keys} is in effect; these keybindings are designated below as ``vi-like operation''. When you are viewing a node, the top line of the node contains some Info @dfn{pointers} which describe where the next, previous, and up nodes are. Info uses this line to move about the node structure of the file when you use the following commands: @table @asis @item @key{n} (@code{next-node}) @itemx @kbd{C-@key{NEXT}} (on DOS/Windows only) @itemx @kbd{C-x @key{n}}, vi-like operation @kindex n @kindex C-NEXT @kindex C-x n, vi-like operation @findex next-node Select the `Next' node. @kindex C-PgDn The @key{NEXT} key is known as the @key{PgDn} key on some keyboards. @item @key{p} (@code{prev-node}) @itemx @kbd{C-@key{PREVIOUS}} (on DOS/Windows only) @kindex p @kindex C-PREVIOUS @findex prev-node Select the `Prev' node. @kindex C-PgUp The @key{PREVIOUS} key is known as the @key{PgUp} key on some keyboards. @item @key{u} (@code{up-node}) @itemx @kbd{C-@key{UP}} (an arrow key on DOS/Windows only) @itemx @kbd{C-x @key{u}}, vi-like operation @kindex u @kindex C-UP @kindex C-x u, vi-like operation @findex up-node Select the `Up' node. @end table You can easily select a node that you have already viewed in this window by using the @samp{l} command -- this name stands for "last", and actually moves backwards through the history of visited nodes for this window. This is handy when you followed a reference to another node, possibly to read about a related issue, and would like then to resume reading at the same place where you started the excursion. Each node where you press @samp{l} is discarded from the history. Thus, by the time you get to the first node you visited in a window, the entire history of that window is discarded. @table @asis @item @key{l} (@code{history-node}) @itemx @key{C-@key{CENTER}} (on DOS/Windows only) @itemx @key{'}, vi-like operation @kindex l @kindex C-CENTER @kindex ', vi-like operation @findex history-node Pop the most recently selected node in this window from the node history. @end table Two additional commands make it easy to select the most commonly selected nodes; they are @samp{t} and @samp{d}. @table @asis @item @key{t} (@code{top-node}) @itemx @key{M-t}, vi-like operation @kindex t @kindex M-t, vi-like operation @findex top-node Select the node @samp{Top} in the current Info file. @item @key{d} (@code{dir-node}) @itemx @key{M-d}, vi-like operation @kindex d @kindex M-d, vi-like operation @findex dir-node Select the directory node (i.e., the node @samp{(dir)}). @end table Here are some other commands which immediately result in the selection of a different node in the current window: @table @asis @item @key{<} (@code{first-node}) @itemx @key{g}, vi-like operation @kindex < @kindex g, vi-like operation @findex first-node Selects the first node which appears in this file. This node is most often @samp{Top}, but it does not have to be. With a numeric argument @var{N}, select the @var{N}th node (the first node is node 1). An argument of zero is the same as the argument of 1. @item @key{>} (@code{last-node}) @itemx @key{G}, vi-like operation @kindex > @kindex G, vi-like operation @findex last-node Select the last node which appears in this file. With a numeric argument @var{N}, select the @var{N}th node (the first node is node 1). An argument of zero is the same as no argument, i.e., it selects the last node. @item @key{]} (@code{global-next-node}) @kindex ] @findex global-next-node Move forward or down through node structure. If the node that you are currently viewing has a @samp{Next} pointer, that node is selected. Otherwise, if this node has a menu, the first menu item is selected. If there is no @samp{Next} and no menu, the same process is tried with the @samp{Up} node of this node. @item @key{[} (@code{global-prev-node}) @kindex [ @findex global-prev-node Move backward or up through node structure. If the node that you are currently viewing has a @samp{Prev} pointer, that node is selected. Otherwise, if the node has an @samp{Up} pointer, that node is selected, and if it has a menu, the last item in the menu is selected. @end table You can get the same behavior as @code{global-next-node} and @code{global-prev-node} while simply scrolling through the file with @key{SPC} and @key{DEL}; @xref{Variables, @code{scroll-behavior}}, for more information. @table @asis @anchor{goto-node} @item @key{g} (@code{goto-node}) @itemx @kbd{C-x @key{g}}, vi-like operation @kindex g @kindex C-x g, vi-like operation @findex goto-node Read the name of a node and select it. While reading the node name, completion (@pxref{The Echo Area, completion}) is only done for the nodes which reside in one of the Info files that were loaded in the current Info session; if the desired node resides in some other file, you must type the node exactly as it appears in that Info file, and you must include the Info file of the other file. For example, @example @code{g(emacs)Buffers} @end example finds the node @samp{Buffers} in the Info file @file{emacs}. @anchor{goto-invocation} @item @key{O} (@code{goto-invocation} @itemx @key{I} @kindex O @kindex I @findex goto-invocation @cindex finding the Invocation node Read the name of a program and look for a node in the current Info file which describes the invocation and the command-line options for that program. The default program name is derived from the name of the current Info file. This command does the same as the @samp{--show-options} command-line option (@pxref{--show-options}), but it also allows to specify the program name; this is important for those manuals which describe several programs. If you need to find the Invocation node of a program that is documented in another Info file, you need to visit that file before invoking @samp{I}. For example, if you are reading the Emacs manual and want to see the command-line options of the @code{makeinfo} program, type @kbd{g (texinfo) @key{RET}} and then @kbd{I makeinfo @key{RET}}. If you don't know what Info file documents the command, or if invoking @samp{I} doesn't display the right node, go to the @samp{(dir)} node (using the @samp{d} command) and invoke @samp{I} from there. @item @key{G} (@code{menu-sequence}) @kindex G @findex menu-sequence @cindex menu, following, from inside Info Read a sequence of menu entries and follow it. Info prompts for a sequence of menu items separated by commas. (Since commas are not allowed in a node name, they are a natural choice for a delimiter in a list of menu items.) Info then looks up the first item in the menu of the node @samp{(dir)} (if the @samp{(dir)} node cannot be found, Info uses @samp{Top}). If such an entry is found, Info goes to the node it points to and looks up the second item in the menu of that node, etc. In other words, you can specify a complete path which descends through the menu hierarchy of a particular Info file starting at the @samp{(dir)} node. This has the same effect as if you typed the menu item sequence on Info's command line, see @ref{command-line menu items,, Info command-line arguments processing}. For example, @example @kbd{G Texinfo,Overview,Reporting Bugs @key{RET}} @end example @noindent displays the node @samp{Reporting Bugs} in the Texinfo manual. (You don't actually need to type the menu items in their full length, or in their exact letter-case. However, if you do type the menu items exactly, Info will find it faster.) If any of the menu items you type are not found, Info stops at the last entry it did find and reports an error. @item @kbd{C-x @key{k}} (@code{kill-node}) @kindex C-x k @findex kill-node Kill a node. The node name is prompted for in the echo area, with a default of the current node. @dfn{Killing} a node means that Info tries hard to forget about it, removing it from the list of history nodes kept for the window where that node is found. Another node is selected in the window which contained the killed node. @item @kbd{C-x C-f} (@code{view-file}) @kindex C-x C-f @findex view-file Read the name of a file and selects the entire file. The command @example @code{C-x C-f @var{filename}} @end example is equivalent to typing @example @code{g(@var{filename})*} @end example @item @kbd{C-x C-b} (@code{list-visited-nodes}) @kindex C-x C-b @findex list-visited-nodes Make a window containing a menu of all of the currently visited nodes. This window becomes the selected window, and you may use the standard Info commands within it. @item @kbd{C-x @key{b}} (@code{select-visited-node}) @kindex C-x b @findex select-visited-node Select a node which has been previously visited in a visible window. This is similar to @samp{C-x C-b} followed by @samp{m}, but no window is created. @end table -@node Searching Commands, Xref Commands, Node Commands, Top + +@node Searching Commands @chapter Searching an Info File @cindex searching GNU Info allows you to search for a sequence of characters throughout an entire Info file, search through the indices of an Info file, or find areas within an Info file which discuss a particular topic. @table @asis @item @key{s} (@code{search}) @itemx @key{/} @kindex s @kindex / @findex search Read a string in the echo area and search for it. If the string includes upper-case characters, the Info file is searched case-sensitively; otherwise Info ignores the letter case. With a numeric argument of @var{N}, search for @var{N}th occurrence of the string. Negative arguments search backwards. @item @key{?} (@code{search-backward}, vi-like operation) @kindex ?, vi-like operation @findex search-backward Read a string in the echo area and search backward through the Info file for that string. If the string includes upper-case characters, the Info file is searched case-sensitively; otherwise Info ignores the letter case. With a numeric argument of @var{N}, search for @var{N}th occurrence of the string. Negative arguments search forward. @item @key{S} (@code{search-case-sensitively} @kindex S @findex search-case-sensitively @cindex search, case-sensitive @cindex case-sensitive search Read a string in the echo area and search for it case-sensitively, even if the string includes only lower-case letters. With a numeric argument of @var{N}, search for @var{N}th occurrence of the string. Negative arguments search backwards. @item @kbd{C-x @key{n}} (@code{search-next}) @itemx @key{n}, vi-like operation @kindex C-x n @kindex n, vi-like operation @findex search-next @cindex repeated search Search for the same string used in the last search command, in the same direction, and with the same case-sensitivity option. With a numeric argument of @var{N}, search for @var{N}th next occurrence. @item @kbd{C-x @key{N}} (@code{search-previous}) @itemx @key{N}, vi-like operation @kindex C-x N @kindex n, vi-like operation @findex search-previous Search for the same string used in the last search command, and with the same case-sensitivity option, but in the reverse direction. With a numeric argument of @var{N}, search for @var{N}th previous occurrence. @item @key{C-s} (@code{isearch-forward}) @kindex C-s @findex isearch-forward @cindex incremental search Interactively search forward through the Info file for a string as you type it. If the string includes upper-case characters, the search is case-sensitive; otherwise Info ignores the letter case. @item @key{C-r} (@code{isearch-backward}) @kindex C-r @findex isearch-backward Interactively search backward through the Info file for a string as you type it. If the string includes upper-case characters, the search is case-sensitive; otherwise Info ignores the letter case. @item @key{i} (@code{index-search}) @kindex i @findex index-search @cindex index, searching @cindex searching, in the indices Look up a string in the indices for this Info file, and select a node where the found index entry points to. @item @key{,} (@code{next-index-match}) @kindex , @findex next-index-match Move to the node containing the next matching index item from the last @samp{i} command. + +@item @kbd{M-x index-apropos} +@findex index-apropos +Grovel the indices of all the known Info files on your system for a +string, and build a menu of the possible matches. @end table The most basic searching command is @samp{s} or @samp{/} (@code{search}). The @samp{s} command prompts you for a string in the echo area, and then searches the remainder of the Info file for an occurrence of that string. If the string is found, the node containing it is selected, and the cursor is left positioned at the start of the found string. Subsequent @samp{s} commands show you the default search string within @samp{[} and @samp{]}; pressing @key{RET} instead of typing a new string will use the default search string. Under @samp{--vi-keys} (@pxref{--vi-keys}), using the @samp{n} or @samp{N} commands is a faster way of searching for the same string. @dfn{Incremental searching} is similar to basic searching, but the string is looked up while you are typing it, instead of waiting until the entire search string has been specified. @cindex search, and case-sensitivity @cindex case-sensitivity, and search Both incremental and non-incremental search by default ignore the case of letters when comparing the Info file text with the search string. However, an uppercase letter in the search string makes the search case-sensitive. You can force a case-sensitive non-incremental search, even for a string that includes only lower-case letters, by using the @samp{S} command (@code{search-case-sensitively}). The @samp{n} and @samp{N} commands operate case-sensitively if the last search command was @samp{S}. -@node Xref Commands, Window Commands, Searching Commands, Top +The most efficient means of finding something quickly in a manual is +the @samp{i} command (@code{index-search}). This command prompts for +a string, and then looks for that string in all the indices of the +current Info manual. If it finds a matching index entry, it displays +the node to which that entry refers and prints the full text of the +entry in the echo area. You can press @samp{,} +(@code{next-index-match}) to find more matches. A good Info manual +has all of its important concepts indexed, so the @samp{i} command +lets you use a manual as a reference. + +If you don't know what manual documents something, try the @kbd{M-x +index-apropos}. It prompts for a string and then looks up that string +in all the indices of all the Info documents installed on your system. +It can also be invoked from the command line; see @ref{--apropos}. + + +@node Xref Commands @chapter Selecting Cross References We have already discussed the @samp{Next}, @samp{Prev}, and @samp{Up} pointers which appear at the top of a node. In addition to these pointers, a node may contain other pointers which refer you to a different node, perhaps in another Info file. Such pointers are called @dfn{cross references}, or @dfn{xrefs} for short. @menu * Parts of an Xref:: What a cross reference is made of. * Selecting Xrefs:: Commands for selecting menu or note items. @end menu @node Parts of an Xref, Selecting Xrefs, , Xref Commands @section Parts of an Xref Cross references have two major parts: the first part is called the @dfn{label}; it is the name that you can use to refer to the cross reference, and the second is the @dfn{target}; it is the full name of the node that the cross reference points to. The target is separated from the label by a colon @samp{:}; first the label appears, and then the target. For example, in the sample menu cross reference below, the single colon separates the label from the target. @example * Foo Label: Foo Target. More information about Foo. @end example Note the @samp{.} which ends the name of the target. The @samp{.} is not part of the target; it serves only to let Info know where the target name ends. A shorthand way of specifying references allows two adjacent colons to stand for a target name which is the same as the label name: @example * Foo Commands:: Commands pertaining to Foo. @end example In the above example, the name of the target is the same as the name of the label, in this case @code{Foo Commands}. You will normally see two types of cross reference while viewing nodes: @dfn{menu} references, and @dfn{note} references. Menu references appear within a node's menu; they begin with a @samp{*} at the beginning of a line, and continue with a label, a target, and a comment which describes what the contents of the node pointed to contains. Note references appear within the body of the node text; they begin with @code{*Note}, and continue with a label and a target. Like @samp{Next}, @samp{Prev}, and @samp{Up} pointers, cross references can point to any valid node. They are used to refer you to a place where more detailed information can be found on a particular subject. Here is a cross reference which points to a node within the Texinfo documentation: @xref{xref, , Writing an Xref, texinfo, the Texinfo Manual}, for more information on creating your own texinfo cross references. @node Selecting Xrefs, , Parts of an Xref, Xref Commands @section Selecting Xrefs The following table lists the Info commands which operate on menu items. @table @asis @item @key{1} (@code{menu-digit}) @itemx @key{2} @dots{} @key{9} @itemx @key{M-1}, vi-like operation @itemx @key{M-2} @dots{} @key{M-9}, vi-like operation @cindex 1 @dots{} 9, in Info windows @cindex M-1 @dots{} M-9, vi-like operation @kindex 1 @dots{} 9, in Info windows @kindex M-1 @dots{} M-9, vi-like operation @findex menu-digit Within an Info window, pressing a single digit, (such as @samp{1}), selects that menu item, and places its node in the current window. For convenience, there is one exception; pressing @samp{0} selects the @emph{last} item in the node's menu. When @samp{--vi-keys} is in effect, digits set the numeric argument, so these commands are remapped to their @samp{M-} varieties. For example, to select the last menu item, press @key{M-0}. @item @key{0} (@code{last-menu-item}) @itemx @key{M-0}, vi-like operation @kindex 0, in Info windows @kindex M-0, vi-like operation @findex last-menu-item Select the last item in the current node's menu. @item @key{m} (@code{menu-item}) @kindex m @findex menu-item Reads the name of a menu item in the echo area and selects its node. Completion is available while reading the menu label. @xref{The Echo Area, completion}. @item @kbd{M-x find-menu} @findex find-menu Move the cursor to the start of this node's menu. @end table This table lists the Info commands which operate on cross references. @table @asis @item @key{f} (@code{xref-item}) @itemx @key{r} @item @key{M-f}, vi-like operation @itemx @kbd{C-x @key{r}}, vi-like operation @kindex f @kindex r @kindex M-f, vi-like operation @kindex C-x r, vi-like operation @findex xref-item Reads the name of a note cross reference in the echo area and selects its node. Completion is available while reading the cross reference label. @xref{The Echo Area, completion}. @end table Finally, the next few commands operate on menu or note references alike: @table @asis @item @key{TAB} (@code{move-to-next-xref}) @kindex TAB, in Info windows @findex move-to-next-xref Move the cursor to the start of the next nearest menu item or note reference in this node. You can then use @key{RET} (@code{select-reference-this-line}) to select the menu or note reference. @item @key{M-TAB} (@code{move-to-prev-xref}) @itemx @key{Shift-@key{TAB}} (on DOS/Windows only) @kindex M-TAB, in Info windows @findex move-to-prev-xref Move the cursor the start of the nearest previous menu item or note reference in this node. @kindex Shift-TAB, in Info windows @kindex BackTab, in Info windows On DOS/Windows only, the @kbd{Shift-@key{TAB}} key is an alias for @kbd{M-@key{TAB}}. This key is sometimes called @samp{BackTab}. @item @key{RET} (@code{select-reference-this-line}) @itemx @key{M-g}, vi-like operation @kindex RET, in Info windows @kindex M-g, vi-like operation @findex select-reference-this-line Select the menu item or note reference appearing on this line. @end table -@node Window Commands, Printing Nodes, Xref Commands, Top + +@node Window Commands @chapter Manipulating Multiple Windows @cindex windows, manipulating A @dfn{window} is a place to show the text of a node. Windows have a view area where the text of the node is displayed, and an associated @dfn{mode line}, which briefly describes the node being viewed. GNU Info supports multiple windows appearing in a single screen; each window is separated from the next by its modeline. At any time, there is only one @dfn{active} window, that is, the window in which the cursor appears. There are commands available for creating windows, changing the size of windows, selecting which window is active, and for deleting windows. @menu * The Mode Line:: What appears in the mode line? * Basic Windows:: Manipulating windows in Info. * The Echo Area:: Used for displaying errors and reading input. @end menu @node The Mode Line, Basic Windows, , Window Commands @section The Mode Line A @dfn{mode line} is a line of inverse video which appears at the bottom of an Info window. It describes the contents of the window just above it; this information includes the name of the file and node appearing in that window, the number of screen lines it takes to display the node, and the percentage of text that is above the top of the window. It can also tell you if the indirect tags table for this Info file needs to be updated, and whether or not the Info file was compressed when stored on disk. Here is a sample mode line for a window containing an uncompressed file named @file{dir}, showing the node @samp{Top}. @example @group -----Info: (dir)Top, 40 lines --Top------------------------------------- ^^ ^ ^^^ ^^ (file)Node #lines where @end group @end example When a node comes from a file which is compressed on disk, this is indicated in the mode line with two small @samp{z}'s. In addition, if the Info file containing the node has been split into subfiles, the name of the subfile containing the node appears in the modeline as well: @example --zz-Info: (emacs)Top, 291 lines --Top-- Subfile: emacs-1.Z------------- @end example Truncation of long lines (as opposed to wrapping them to the next display line, @pxref{Scrolling Commands, toggle-wrap}) is indicated by a @samp{$} at the left edge of the mode line: @example --$--Info: (texinfo)Top, 480 lines --Top-- Subfile: texinfo-1----------- @end example When Info makes a node internally, such that there is no corresponding info file on disk, the name of the node is surrounded by asterisks (@samp{*}). The name itself tells you what the contents of the window are; the sample mode line below shows an internally constructed node showing possible completions: @example -----Info: *Completions*, 7 lines --All--------------------------------- @end example @node Basic Windows, The Echo Area, The Mode Line, Window Commands @section Window Commands It can be convenient to view more than one node at a time. To allow this, Info can display more than one @dfn{window}. Each window has its own mode line (@pxref{The Mode Line}) and history of nodes viewed in that window (@pxref{Node Commands, , @code{history-node}}). @table @asis @item @kbd{C-x @key{o}} (@code{next-window}) @cindex windows, selecting @kindex C-x o @findex next-window Select the next window on the screen. Note that the echo area can only be selected if it is already in use, and you have left it temporarily. Normally, @samp{C-x o} simply moves the cursor into the next window on the screen, or if you are already within the last window, into the first window on the screen. Given a numeric argument, @samp{C-x o} moves over that many windows. A negative argument causes @samp{C-x o} to select the previous window on the screen. @item @kbd{M-x prev-window} @findex prev-window Select the previous window on the screen. This is identical to @samp{C-x o} with a negative argument. @item @kbd{C-x @key{2}} (@code{split-window}) @cindex windows, creating @kindex C-x 2 @findex split-window Split the current window into two windows, both showing the same node. Each window is one half the size of the original window, and the cursor remains in the original window. The variable @code{automatic-tiling} can cause all of the windows on the screen to be resized for you automatically, please @pxref{Variables, , automatic-tiling} for more information. @item @kbd{C-x @key{0}} (@code{delete-window}) @cindex windows, deleting @kindex C-x 0 @findex delete-window Delete the current window from the screen. If you have made too many windows and your screen appears cluttered, this is the way to get rid of some of them. @item @kbd{C-x @key{1}} (@code{keep-one-window}) @kindex C-x 1 @findex keep-one-window Delete all of the windows excepting the current one. @item @kbd{ESC @key{C-v}} (@code{scroll-other-window}) @kindex ESC C-v, in Info windows @findex scroll-other-window Scroll the other window, in the same fashion that @samp{C-v} might scroll the current window. Given a negative argument, scroll the "other" window backward. @item @kbd{C-x @key{^}} (@code{grow-window}) @kindex C-x ^ @findex grow-window Grow (or shrink) the current window. Given a numeric argument, grow the current window that many lines; with a negative numeric argument, shrink the window instead. @item @kbd{C-x @key{t}} (@code{tile-windows}) @cindex tiling @kindex C-x t @findex tile-windows Divide the available screen space among all of the visible windows. Each window is given an equal portion of the screen in which to display its contents. The variable @code{automatic-tiling} can cause @code{tile-windows} to be called when a window is created or deleted. @xref{Variables, , @code{automatic-tiling}}. @end table @node The Echo Area, , Basic Windows, Window Commands @section The Echo Area @cindex echo area The @dfn{echo area} is a one line window which appears at the bottom of the screen. It is used to display informative or error messages, and to read lines of input from you when that is necessary. Almost all of the commands available in the echo area are identical to their Emacs counterparts, so please refer to that documentation for greater depth of discussion on the concepts of editing a line of text. The following table briefly lists the commands that are available while input is being read in the echo area: @table @asis @item @key{C-f} (@code{echo-area-forward}) @itemx @key{RIGHT} (an arrow key) @itemx @key{M-h}, vi-like operation @kindex C-f, in the echo area @kindex RIGHT, in the echo area @kindex M-h, in the echo area, vi-like operation @findex echo-area-forward Move forward a character. @item @key{C-b} (@code{echo-area-backward}) @itemx @key{LEFT} (an arrow key) @itemx @key{M-l}, vi-like operation @kindex LEFT, in the echo area @kindex C-b, in the echo area @kindex M-l, in the echo area, vi-like operation @findex echo-area-backward Move backward a character. @item @key{C-a} (@code{echo-area-beg-of-line}) @itemx @key{M-0}, vi-like operation @kindex C-a, in the echo area @kindex M-0, in the echo area, vi-like operation @findex echo-area-beg-of-line Move to the start of the input line. @item @key{C-e} (@code{echo-area-end-of-line}) @itemx @key{M-$}, vi-like operation @kindex C-e, in the echo area @kindex M-$, vi-like operation @findex echo-area-end-of-line Move to the end of the input line. @item @key{M-f} (@code{echo-area-forward-word}) @itemx @key{C-@key{RIGHT}} (DOS/Windows only) @itemx @key{M-w}, vi-like operation @kindex M-f, in the echo area @kindex M-w, in the echo area, vi-like operation @findex echo-area-forward-word Move forward a word. @kindex C-RIGHT, in the echo area On DOS/Windows, @kbd{C-@key{RIGHT}} moves forward by words. @item @key{M-b} (@code{echo-area-backward-word}) @itemx @key{C-@key{LEFT}} (DOS/Windows only) @kindex M-b, in the echo area @findex echo-area-backward-word Move backward a word. @kindex C-LEFT, in the echo area On DOS/Windows, @kbd{C-@key{LEFT}} moves backward by words. @item @key{C-d} (@code{echo-area-delete}) @itemx @key{M-x}, vi-like operation @kindex C-d, in the echo area @kindex M-x, in the echo area, vi-like operation @findex echo-area-delete Delete the character under the cursor. @item @key{DEL} (@code{echo-area-rubout}) @kindex DEL, in the echo area @findex echo-area-rubout Delete the character behind the cursor. On some keyboards, this key is designated @key{BS}, for @samp{BackSpace}. Those keyboards will usually bind @key{DEL} in the echo area to @code{echo-area-delete}. @item @key{C-g} (@code{echo-area-abort}) @itemx @key{C-u}, vi-like operation @kindex C-g, in the echo area @kindex C-u, in the echo area, vi-like operation @findex echo-area-abort Cancel or quit the current operation. If completion is being read, this command discards the text of the input line which does not match any completion. If the input line is empty, it aborts the calling function. @item @key{RET} (@code{echo-area-newline}) @kindex RET, in the echo area @findex echo-area-newline Accept (or forces completion of) the current input line. @item @key{C-q} (@code{echo-area-quoted-insert}) @itemx @key{C-v}, vi-like operation @kindex C-q, in the echo area @kindex C-v, in the echo area, vi-like operation @findex echo-area-quoted-insert Insert the next character verbatim. This is how you can insert control characters into a search string, for example, or the @samp{?} character when Info prompts with completion. @item @var{printing character} (@code{echo-area-insert}) @kindex printing characters, in the echo area @findex echo-area-insert Insert the character. Characters that have their 8th bit set, and not bound to @samp{M-} commands, are also inserted verbatim; this is useful for terminals which support Latin scripts. @item @key{M-TAB} (@code{echo-area-tab-insert}) @itemx @key{Shift-@key{TAB}} (on DOS/Windows only) @kindex M-TAB, in the echo area @kindex Shift-TAB, in the echo area @findex echo-area-tab-insert Insert a TAB character. @kindex Shift-TAB, in the echo area @kindex BackTab, in the echo area On DOS/Windows only, the @kbd{Shift-@key{TAB}} key is an alias for @kbd{M-@key{TAB}}. This key is sometimes called @samp{BackTab}. @item @key{C-t} (@code{echo-area-transpose-chars}) @kindex C-t, in the echo area @findex echo-area-transpose-chars Transpose the characters at the cursor. @end table The next group of commands deal with @dfn{killing}, and @dfn{yanking} text@footnote{ Some people are used to calling these operations @dfn{cut} and @dfn{paste}, respectively.}. For an in depth discussion of killing and yanking, @pxref{Killing, , Killing and Deleting, emacs, the GNU Emacs Manual} @table @asis @item @key{M-d} (@code{echo-area-kill-word}) @itemx @key{M-X}, vi-like operation @kindex M-d, in the echo area @kindex M-X, in the echo area, vi-like operation @findex echo-area-kill-word Kill the word following the cursor. @item @key{M-DEL} (@code{echo-area-backward-kill-word}) @itemx @key{M-@key{BS}} @kindex M-DEL, in the echo area @findex echo-area-backward-kill-word Kill the word preceding the cursor. @kindex M-BS, in the echo area On some keyboards, the @code{Backspace} key is used instead of @code{DEL}, so @code{M-@key{Backspace}} has the same effect as @code{M-@key{DEL}}. @item @key{C-k} (@code{echo-area-kill-line}) @kindex C-k, in the echo area @findex echo-area-kill-line Kill the text from the cursor to the end of the line. @item @kbd{C-x @key{DEL}} (@code{echo-area-backward-kill-line}) @kindex C-x DEL, in the echo area @findex echo-area-backward-kill-line Kill the text from the cursor to the beginning of the line. @item @key{C-y} (@code{echo-area-yank}) @kindex C-y, in the echo area @findex echo-area-yank Yank back the contents of the last kill. @item @key{M-y} (@code{echo-area-yank-pop}) @kindex M-y, in the echo area @findex echo-area-yank-pop Yank back a previous kill, removing the last yanked text first. @end table @cindex completion Sometimes when reading input in the echo area, the command that needed input will only accept one of a list of several choices. The choices represent the @dfn{possible completions}, and you must respond with one of them. Since there are a limited number of responses you can make, Info allows you to abbreviate what you type, only typing as much of the response as is necessary to uniquely identify it. In addition, you can request Info to fill in as much of the response as is possible; this is called @dfn{completion}. The following commands are available when completing in the echo area: @table @asis @item @key{TAB} (@code{echo-area-complete}) @itemx @key{SPC} @kindex TAB, in the echo area @kindex SPC, in the echo area @findex echo-area-complete Insert as much of a completion as is possible. @item @key{?} (@code{echo-area-possible-completions}) @kindex ?, in the echo area @findex echo-area-possible-completions Display a window containing a list of the possible completions of what you have typed so far. For example, if the available choices are: @example @group bar foliate food forget @end group @end example @noindent and you have typed an @samp{f}, followed by @samp{?}, Info will pop up a window showing a node called @samp{*Completions*} which lists the possible completions like this: @example @group 3 completions: foliate food forget @end group @end example @noindent i.e., all of the choices which begin with @samp{f}. Pressing @key{SPC} or @key{TAB} would result in @samp{fo} appearing in the echo area, since all of the choices which begin with @samp{f} continue with @samp{o}. Now, typing @samp{l} followed by @samp{TAB} results in @samp{foliate} appearing in the echo area, since that is the only choice which begins with @samp{fol}. @item @key{ESC C-v} (@code{echo-area-scroll-completions-window}) @kindex ESC C-v, in the echo area @findex echo-area-scroll-completions-window Scroll the completions window, if that is visible, or the "other" window if not. @end table -@node Printing Nodes, Miscellaneous Commands, Window Commands, Top -@chapter Printing Out Nodes + +@node Printing Nodes +@chapter Printing Nodes @cindex printing In general, we recommend that you use @TeX{} to format the document and print sections of it, by running @code{tex} on the Texinfo source file. However, you may wish to print out the contents of a node as a quick reference document for later use, or if you don't have @TeX{} installed. Info provides you with a command for doing this. @table @asis @item @kbd{M-x print-node} @findex print-node @cindex INFO_PRINT_COMMAND, environment variable Pipe the contents of the current node through the command in the environment variable @code{INFO_PRINT_COMMAND}. If the variable does not exist, the node is simply piped to @code{lpr} (on DOS/Windows, the default is to print the node to the local printer device, @file{PRN}). @cindex printing nodes to the local printer @cindex local printer device The value of @code{INFO_PRINT_COMMAND} may begin with the @samp{>} character, as in @samp{>/dev/printer}, in which case Info treats the rest as the name of a file or a device. Instead of piping to a command, Info opens the file, writes the node contents, and closes the file, under the assumption that text written to that file will be printed by the underlying OS. @end table -@node Miscellaneous Commands, Variables, Printing Nodes, Top + +@node Miscellaneous Commands @chapter Miscellaneous Commands GNU Info contains several commands which self-document GNU Info: @table @asis @item @kbd{M-x describe-command} @cindex functions, describing @cindex commands, describing @findex describe-command Read the name of an Info command in the echo area and then display a brief description of what that command does. @item @kbd{M-x describe-key} @cindex keys, describing @findex describe-key Read a key sequence in the echo area, and then display the name and documentation of the Info command that the key sequence invokes. @item @kbd{M-x describe-variable} Read the name of a variable in the echo area and then display a brief description of what the variable affects. @item @kbd{M-x where-is} @findex where-is Read the name of an Info command in the echo area, and then display a key sequence which can be typed in order to invoke that command. @item @key{C-h} (@code{get-help-window}) @itemx @key{?} @itemx @key{F1} (on DOS/Windows only) @itemx h, vi-like operation @kindex C-h @kindex ?, in Info windows @kindex F1 @kindex h, vi-like operation @findex get-help-window Create (or Move into) the window displaying @code{*Help*}, and place a node containing a quick reference card into it. This window displays the most concise information about GNU Info available. @item @key{h} (@code{get-info-help-node}) @itemx @key{M-h}, vi-like operation @kindex h @kindex M-h, vi-like operation @findex get-info-help-node Try hard to visit the node @code{(info)Help}. The Info file @file{info.texi} distributed with GNU Info contains this node. Of course, the file must first be processed with @code{makeinfo}, and then placed into the location of your Info directory. @end table Here are the commands for creating a numeric argument: @table @asis @item @key{C-u} (@code{universal-argument}) @cindex numeric arguments @kindex C-u @findex universal-argument Start (or multiply by 4) the current numeric argument. @samp{C-u} is a good way to give a small numeric argument to cursor movement or scrolling commands; @samp{C-u C-v} scrolls the screen 4 lines, while @samp{C-u C-u C-n} moves the cursor down 16 lines. @samp{C-u} followed by digit keys sets the numeric argument to the number thus typed: @kbd{C-u 1 2 0} sets the argument to 120. @item @key{M-1} (@code{add-digit-to-numeric-arg}) @itemx @key{1}, vi-like operation @itemx @key{M-2} @dots{} @key{M-9} @itemx @key{2} @dots{} @key{9}, vi-like operation @itemx @key{M-0} @itemx @key{0}, vi-like operation @kindex M-0 @dots{} M-9 @kindex 0 @dots{} 9, vi-like operation @findex add-digit-to-numeric-arg Add the digit value of the invoking key to the current numeric argument. Once Info is reading a numeric argument, you may just type the digits of the argument, without the Meta prefix. For example, you might give @samp{C-l} a numeric argument of 32 by typing: @example @kbd{C-u 3 2 C-l} @end example @noindent or @example @kbd{M-3 2 C-l} @end example @item @key{M--} (@code{add-digit-to-numeric-arg} @itemx @key{-} @kindex M-- @kindex - @cindex negative arguments @cindex arguments, negative @cindex numeric arguments, negative To make a negative argument, type @kbd{-}. Typing @kbd{-} alone makes a negative argument with a value of -1. If you continue to type digit or Meta-digit keys after @kbd{-}, the result is a negative number produced by those digits. @kbd{-} doesn't work when you type in the echo area, because you need to be able to insert the @samp{-} character itself; use @kbd{M--} instead, if you need to specify negative arguments in the echo area. @end table @samp{C-g} is used to abort the reading of a multi-character key sequence, to cancel lengthy operations (such as multi-file searches) and to cancel reading input in the echo area. @table @asis @item @key{C-g} (@code{abort-key}) @itemx @key{C-u}, vi-like operation @cindex cancelling typeahead @cindex cancelling the current operation @kindex C-g, in Info windows @kindex C-u cancels typeahead, vi-like operation @findex abort-key Cancel current operation. @end table The @samp{q} command of Info simply quits running Info. Under @samp{--vi-keys} (@pxref{--vi-keys}), you can also exit with @samp{:q} or @samp{ZZ}. @table @asis @item @key{q} (@code{quit}) @itemx @kbd{C-x C-c} @itemx @kbd{:q}, vi-like operation @itemx @kbd{ZZ}, vi-like operation @cindex quitting @kindex q @kindex C-x C-c @kindex ZZ, vi-like operation @findex quit Exit GNU Info. @end table If the operating system tells GNU Info that the screen is 60 lines tall, and it is actually only 40 lines tall, here is a way to tell Info that the operating system is correct. @table @asis @item @kbd{M-x set-screen-height} @findex set-screen-height @cindex screen, changing the height of Read a height value in the echo area and set the height of the displayed screen to that value. @end table On MS-DOS/MS-Windows, this command actually tries to change the dimensions of the visible screen to the value you type in the echo area. Finally, Info provides a convenient way to display footnotes which might be associated with the current node that you are viewing: @table @asis @item @key{ESC C-f} (@code{show-footnotes}) @kindex ESC C-f @findex show-footnotes @cindex footnotes, displaying Show the footnotes (if any) associated with the current node in another window. You can have Info automatically display the footnotes associated with a node when the node is selected by setting the variable @code{automatic-footnotes}. @xref{Variables, , @code{automatic-footnotes}}. @end table -@node Variables, GNU Info Global Index, Miscellaneous Commands, Top + +@node Variables @chapter Manipulating Variables GNU Info contains several @dfn{variables} whose values are looked at by various Info commands. You can change the values of these variables, and thus change the behavior of Info to more closely match your environment and Info file reading manner. +There are two ways to set the value of a variable: interactively, using +the @code{set-variable} command described below, or in the @code{#var} +section of the @code{.infokey} file. @xref{Custom Key Bindings}. + @table @asis @item @kbd{M-x set-variable} @cindex variables, setting @findex set-variable Read the name of a variable, and the value for it, in the echo area and then set the variable to that value. Completion is available when reading the variable name (@pxref{The Echo Area, completion}); often, completion is available when reading the value to give to the variable, but that depends on the variable itself. If a variable does @emph{not} supply multiple choices to complete over, it expects a numeric value. @item @kbd{M-x describe-variable} @cindex variables, describing @findex describe-variable Read the name of a variable in the echo area and then display a brief description of what the variable affects. @end table Here is a list of the variables that you can set in Info. @table @code @item automatic-footnotes @vindex automatic-footnotes When set to @code{On}, footnotes appear and disappear automatically. This variable is @code{On} by default. When a node is selected, a window containing the footnotes which appear in that node is created, and the footnotes are displayed within the new window. The window that Info creates to contain the footnotes is called @samp{*Footnotes*}. If a node is selected which contains no footnotes, and a @samp{*Footnotes*} window is on the screen, the @samp{*Footnotes*} window is deleted. Footnote windows created in this fashion are not automatically tiled so that they can use as little of the display as is possible. @item automatic-tiling @vindex automatic-tiling When set to @code{On}, creating or deleting a window resizes other windows. This variable is @code{Off} by default. Normally, typing @samp{C-x 2} divides the current window into two equal parts. When @code{automatic-tiling} is set to @code{On}, all of the windows are resized automatically, keeping an equal number of lines visible in each window. There are exceptions to the automatic tiling; specifically, the windows @samp{*Completions*} and @samp{*Footnotes*} are @emph{not} resized through automatic tiling; they remain their original size. -@item visible-bell -@vindex visible-bell -When set to @code{On}, GNU Info attempts to flash the screen instead of -ringing the bell. This variable is @code{Off} by default. Of course, -Info can only flash the screen if the terminal allows it; in the case -that the terminal does not allow it, the setting of this variable has no -effect. However, you can make Info perform quietly by setting the -@code{errors-ring-bell} variable to @code{Off}. - @item errors-ring-bell @vindex errors-ring-bell When set to @code{On}, errors cause the bell to ring. The default setting of this variable is @code{On}. @item gc-compressed-files @vindex gc-compressed-files When set to @code{On}, Info garbage collects files which had to be uncompressed. The default value of this variable is @code{Off}. Whenever a node is visited in Info, the Info file containing that node is read into core, and Info reads information about the tags and nodes contained in that file. Once the tags information is read by Info, it is never forgotten. However, the actual text of the nodes does not need to remain in core unless a particular Info window needs it. For non-compressed files, the text of the nodes does not remain in core when it is no longer in use. But de-compressing a file can be a time consuming operation, and so Info tries hard not to do it twice. @code{gc-compressed-files} tells Info it is okay to garbage collect the text of the nodes of a file which was compressed on disk. -@item show-index-match -@vindex show-index-match -When set to @code{On}, the portion of the matched search string is -highlighted in the message which explains where the matched search -string was found. The default value of this variable is @code{On}. -When Info displays the location where an index match was found, -(@pxref{Searching Commands, , @code{next-index-match}}), the portion of the -string that you had typed is highlighted by displaying it in the inverse -case from its surrounding characters. +@item ISO-Latin +@cindex ISO Latin characters +@vindex ISO-Latin +When set to @code{On}, Info accepts and displays ISO Latin characters. +By default, Info assumes an ASCII character set. @code{ISO-Latin} tells +Info that it is running in an environment where the European standard +character set is in use, and allows you to input such characters to +Info, as well as display them. @item scroll-behavior @vindex scroll-behavior Control what happens when forward scrolling is requested at the end of a node, or when backward scrolling is requested at the beginning of a node. The default value for this variable is @code{Continuous}. There are three possible values for this variable: @table @code @item Continuous Try to get the first item in this node's menu, or failing that, the @samp{Next} node, or failing that, the @samp{Next} of the @samp{Up}. This behavior is identical to using the @samp{]} (@code{global-next-node}) and @samp{[} (@code{global-prev-node}) commands. @item Next Only Only try to get the @samp{Next} node. @item Page Only Simply give up, changing nothing. If @code{scroll-behavior} is @code{Page Only}, no scrolling command can change the node that is being viewed. @end table @item scroll-step @vindex scroll-step The number of lines to scroll when the cursor moves out of the window. Scrolling happens automatically if the cursor has moved out of the visible portion of the node text when it is time to display. Usually the scrolling is done so as to put the cursor on the center line of the current window. However, if the variable @code{scroll-step} has a nonzero value, Info attempts to scroll the node text by that many lines; if that is enough to bring the cursor back into the window, that is what is done. The default value of this variable is 0, thus placing the cursor (and the text it is attached to) in the center of the window. Setting this variable to 1 causes a kind of "smooth scrolling" which some people prefer. -@item ISO-Latin -@cindex ISO Latin characters -@vindex ISO-Latin -When set to @code{On}, Info accepts and displays ISO Latin characters. -By default, Info assumes an ASCII character set. @code{ISO-Latin} tells -Info that it is running in an environment where the European standard -character set is in use, and allows you to input such characters to -Info, as well as display them. +@item show-index-match +@vindex show-index-match +When set to @code{On}, the portion of the matched search string is +highlighted in the message which explains where the matched search +string was found. The default value of this variable is @code{On}. +When Info displays the location where an index match was found, +(@pxref{Searching Commands, , @code{next-index-match}}), the portion of the +string that you had typed is highlighted by displaying it in the inverse +case from its surrounding characters. + +@item visible-bell +@vindex visible-bell +When set to @code{On}, GNU Info attempts to flash the screen instead of +ringing the bell. This variable is @code{Off} by default. Of course, +Info can only flash the screen if the terminal allows it; in the case +that the terminal does not allow it, the setting of this variable has no +effect. However, you can make Info perform quietly by setting the +@code{errors-ring-bell} variable to @code{Off}. + +@end table + + +@node Custom Key Bindings +@chapter Customizing Key Bindings and Variables + +@cindex default key bindings, overriding +@cindex overriding default key bindings +@cindex customizing key bindings +@cindex key bindings, customizing +@cindex infokey +@cindex .info +@cindex .infokey +@cindex _info file (MS-DOS) + +For those whose editor/pager of choice is not Emacs and who are not +entirely satisfied with the --vi-keys option (@pxref{--vi-keys}), GNU +Info provides a way to define different key-to-command bindings and +variable settings from the defaults described in this document. + +On startup, GNU Info looks for a configuration file in the invoker's +HOME directory called @file{.info}@footnote{Due to the limitations of +DOS filesystems, the MS-DOS version of Info looks for a file +@file{_info} instead. If the @env{HOME} variable is not defined, Info +additionally looks in the current directory.}. If it is present, and +appears to contain Info configuration data, and was created with the +current version of the @code{infokey} command, then Info adopts the +key bindings and variable settings contained therein. + +The @file{.info} file contains compact, non-textual data for reasons of +efficiency and because its design was lifted wholesale from the GNU Less +program, which also does it that way. It must be created by compiling a +textual source file using the @code{infokey} command. + +@menu +* Invoking infokey:: +* infokey source format:: +@end menu + + +@node Invoking infokey +@section Invoking @command{infokey} + +@cindex invoking infokey +@cindex infokey, invoking +@cindex _infokey file (MS-DOS) + +@command{infokey} compiles a source file +(@file{$HOME/.infokey}@footnote{This file is named @file{_infokey} in +the MS-DOS version, and is looked for in the current directory if +@env{HOME} is undefined.} by default) containing Info customizations +into a binary format (@file{$HOME/.info} by default). GNU Info reads +the binary file at startup to override the default key bindings and +variable definitions. Synopsis: + +@example +infokey [@var{option}@dots{}] [@var{input-file}] +@end example + +Besides the standard @option{--help} and @option{--version}, the only +option is @option{--output @var{file}}. This tells @command{infokey} to +write the binary data to @var{file} instead of @file{$HOME/.info}. + + +@node infokey source format +@section @command{infokey} source format + +@cindex infokey source format +@cindex .infokey source format +@cindex format of .infokey source + +The format of the source file read by @command{infokey} is most easily +illustrated by example. For instance, here is a sample @file{.infokey} +source file suitable for aficionados of @command{vi} or @command{less}: + +@example +#info +j next-line +k prev-line +l forward-char +h backward-char +\kd next-line +\ku prev-line +\kr forward-char +\kl backward-char +\ scroll-forward +\kD scroll-forward-page-only +b scroll-backward +\kU scroll-backward-page-only +g beginning-of-node +\kh beginning-of-node +G end-of-node +\ke end-of-node +\t select-reference-this-line +- history-node +n next-node +p prev-node +u up-node +t top-node +d dir-node +#var +scroll-step=1 +@end example + +The source file consists of one or more @dfn{sections}. +Each section starts with a line that identifies the type of section. +Possible sections are: + +@table @code +@item #info +Key bindings for Info windows. +The start of this section is indicated by a line containing just +@code{#info} by itself. If this is the first section in the source +file, the @code{#info} line can be omitted. The rest of this section +consists of lines of the form: + +@example +@var{string} whitespace @var{action} [ whitespace [ # comment ] ] newline +@end example + +Whitespace is any sequence of one or more spaces and/or tabs. Comment +is any sequence of any characters, excluding newline. @var{string} is +the key sequence which invokes the action. @var{action} is the name of +an Info command. The characters in @var{string} are interpreted +literally or prefixed by a caret (@code{^}) to indicate a control +character. A backslash followed by certain characters specifies input +keystrokes as follows: + +@table @code +@item \b +Backspace +@item \e +Escape (ESC) +@item \n +Newline +@item \r +Return +@item \t +Tab +@item \ku +Up arrow +@item \kd +Down arrow +@item \kl +Left arrow +@item \kr +Right arrow +@item \kU +Page Up +@item \kD +Page Down +@item \kh +HOME +@item \ke +END +@item \kx +Delete (DEL) +@item \m@var{x} +Meta-@var{x} where @var{x} is any character as described above. +@end table + +Backslash followed by any other character indicates that character is to +be taken literally. Characters which must be preceded by a backslash +include caret, space, tab, and backslash itself. + +@item #echo-area +Key bindings for the echo area. +The start of this section is indicated by a line containing just +@code{#echo-area} by itself. The rest of this section has a syntax +identical to that for the key definitions for the Info area, described +above. + +@item #var +Variable initializations. +The start of this section is indicated by a line containing just +@code{#var} by itself. Following this line is a list of variable +assignments, one per line. Each line consists of a variable name +(@xref{Variables},) followed by @code{=} followed by a value. +There may be no white space between the variable name and the @code{=}, +and all characters following the @code{=}, including white space, +are included in the value. @end table +Blank lines and lines starting with @code{#} are ignored, except for +the special section header lines. + +Key bindings defined in the @file{.info} file take precedence over GNU +Info's default key bindings, whether or not @samp{--vi-keys} is used. A +default key binding may be disabled by overriding it in the @file{.info} +file with the action @code{invalid}. In addition, @emph{all} default +key bindings can be disabled by adding this line @emph{anywhere} in the +relevant section: + +@example +#stop +@end example + +This will cause GNU Info to ignore all the default key commands for that +section. + +Beware: @code{#stop} can be dangerous. Since it disables all default +key bindings, you must supply enough new key bindings to enable all +necessary actions. Failure to bind any key to the @code{quit} command, +for example, can lead to frustration. + +The order in which key bindings are defined in the @file{.info} file is +not important, except that the command summary produced by the +@code{get-help-window} command only displays the @emph{first} key that +is bound to each command. @c the following is incomplete @ignore @c node Info for Sys Admins @c chapter Info for System Administrators This text describes some common ways of setting up an Info hierarchy from scratch, and details the various options that are available when installing Info. This text is designed for the person who is installing GNU Info on the system; although users may find the information present in this section interesting, none of it is vital to understanding how to use GNU Info. @menu * Setting the INFOPATH:: Where are my Info files kept? * Editing the DIR node:: What goes in `DIR', and why? * Storing Info files:: Alternate formats allow flexibility in setups. * Using `localdir':: Building DIR on the fly. * Example setups:: Some common ways to organize Info files. @end menu @c node Setting the INFOPATH @c section Setting the INFOPATH Where are my Info files kept? @c node Editing the DIR node @c section Editing the DIR node What goes in `DIR', and why? @c node Storing Info files @c section Storing Info files Alternate formats allow flexibility in setups. @c node Using `localdir' @c section Using `localdir' Building DIR on the fly. @c node Example setups @c section Example setups Some common ways to organize Info files. @end ignore -@node GNU Info Global Index, , Variables, Top -@appendix Global Index + +@node Index +@appendix Index @printindex cp -@contents @bye diff --git a/contrib/texinfo/doc/info.1 b/contrib/texinfo/doc/info.1 index f572a4f8003e..6221075551e1 100644 --- a/contrib/texinfo/doc/info.1 +++ b/contrib/texinfo/doc/info.1 @@ -1,80 +1,82 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.013. -.TH INFO "1" "September 1999" "GNU texinfo 4.0" FSF +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.24. +.TH INFO "1" "March 2002" "GNU texinfo 4.1" FSF .SH NAME info \- read Info documents .SH SYNOPSIS .B info [\fIOPTION\fR]... [\fIMENU-ITEM\fR...] .SH DESCRIPTION -.PP Read documentation in Info format. .SH OPTIONS .TP \fB\-\-apropos\fR=\fISUBJECT\fR look up SUBJECT in all indices of all manuals. .TP \fB\-\-directory\fR=\fIDIR\fR add DIR to INFOPATH. .TP \fB\-\-dribble\fR=\fIFILENAME\fR remember user keystrokes in FILENAME. .TP \fB\-\-file\fR=\fIFILENAME\fR specify Info file to visit. .TP \fB\-\-help\fR display this help and exit. .TP \fB\-\-index\-search\fR=\fISTRING\fR go to node pointed by index entry STRING. .TP \fB\-\-node\fR=\fINODENAME\fR specify nodes in first visited Info file. .TP \fB\-\-output\fR=\fIFILENAME\fR output selected nodes to FILENAME. .TP +\fB\-\-raw\-escapes\fR +don't remove ANSI escapes from man pages. +.TP \fB\-\-restore\fR=\fIFILENAME\fR read initial keystrokes from FILENAME. .TP \fB\-\-show\-options\fR, \fB\-\-usage\fR go to command-line options node. .TP \fB\-\-subnodes\fR recursively output menu items. .TP \fB\-\-vi\-keys\fR use vi-like and less-like key bindings. .TP \fB\-\-version\fR display version information and exit. .PP The first non-option argument, if present, is the menu entry to start from; it is searched for in all `dir' files along INFOPATH. If it is not present, info merges all `dir' files and shows the result. Any remaining arguments are treated as the names of menu items relative to the initial node visited. .SH EXAMPLES .TP info show top-level dir menu .TP info emacs start at emacs node from top-level dir .TP info emacs buffers start at buffers node within emacs manual .TP info \fB\-\-show\-options\fR emacs start at node with emacs' command line options .TP info \fB\-f\fR ./foo.info show file ./foo.info, not searching dir .SH "REPORTING BUGS" Email bug reports to bug-texinfo@gnu.org, general questions and discussion to help-texinfo@gnu.org. .SH COPYRIGHT -Copyright \(co 1999 Free Software Foundation, Inc. +Copyright \(co 2002 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. diff --git a/contrib/texinfo/doc/info.texi b/contrib/texinfo/doc/info.texi index c81bfd2d4de4..73a7033e4284 100644 --- a/contrib/texinfo/doc/info.texi +++ b/contrib/texinfo/doc/info.texi @@ -1,895 +1,1344 @@ \input texinfo @c -*-texinfo-*- @comment %**start of header @setfilename info.info @settitle Info +@syncodeindex fn cp +@syncodeindex vr cp +@syncodeindex ky cp @comment %**end of header -@comment $Id: info.texi,v 1.11 1999/04/19 21:37:23 karl Exp $ +@comment $Id: info.texi,v 1.22 2002/02/09 00:54:34 karl Exp $ @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, 92, 96, 97, 98, 99 Free Software Foundation, Inc. +Copyright (C) 1989, 92, 96, 97, 98, 99, 2000, 2001 +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 preserved on all copies. -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation; with no +Invariant Sections, with the Front-Cover texts being ``A GNU +Manual'', and with the Back-Cover Texts as in (a) below. A copy of the +license is included in the section entitled ``GNU Free Documentation +License'' in the Emacs manual. -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. +(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify +this GNU Manual, like GNU software. Copies published by the Free +Software Foundation raise funds for GNU development.'' -Permission is granted to copy and distribute 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. +This document is part of a collection distributed under the GNU Free +Documentation License. If you want to distribute this document +separately from the collection, you can do so by adding a copy of the +license to the document, as described in section 6 of the license. @end ifinfo @titlepage @title Info -@subtitle The online, menu-driven GNU documentation system +@subtitle The online, hyper-text GNU documentation system @author Brian Fox +@author and the GNU Texinfo community @page @vskip 0pt plus 1filll -Copyright @copyright{} 1989, 92, 93, 96, 97, 98, 99 Free Software -Foundation, Inc. +Copyright @copyright{} 1989, 92, 93, 96, 97, 98, 99, 2000, 2001 +Free Software Foundation, Inc. @sp 2 Published by the Free Software Foundation @* 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 -are preserved on all copies. - -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed 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, -except that this permission notice may be stated in a translation approved -by the Free Software Foundation. +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation; with no +Invariant Sections, with the Front-Cover texts being ``A GNU +Manual'', and with the Back-Cover Texts as in (a) below. A copy of the +license is included in the section entitled ``GNU Free Documentation +License'' in the Emacs manual. + +(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify +this GNU Manual, like GNU software. Copies published by the Free +Software Foundation raise funds for GNU development.'' + +This document is part of a collection distributed under the GNU Free +Documentation License. If you want to distribute this document +separately from the collection, you can do so by adding a copy of the +license to the document, as described in section 6 of the license. @end titlepage @ifnottex @node Top @top Info: An Introduction -Info is a program for reading documentation, which you are using now. +Info is a program, which you are using now, for reading documentation of +computer programs. The GNU Project distributes most of its on-line +manuals in the Info format, so you need a program called @dfn{Info +reader} to read the manuals. One of such programs you are using now. + +@ifinfo +If you are new to Info and want to learn how to use it, type the +command @kbd{h} now. It brings you to a programmed instruction +sequence. -To learn how to use Info, type the command @kbd{h}. It brings you -to a programmed instruction sequence. +To learn advanced Info commands, type @kbd{n} twice. This brings you to +@cite{Info for Experts}, skipping over the `Getting Started' chapter. +@end ifinfo @end ifnottex @menu * Getting Started:: Getting started using an Info reader. * Advanced Info:: Advanced commands within Info. * Creating an Info File:: How to make your own Info file. +* Index:: An index of topics, commands, and variables. @end menu @node Getting Started, Advanced Info, Top, Top @comment node-name, next, previous, up @chapter Getting Started This first part of the Info manual describes how to get around inside of Info. The second part of the manual describes various advanced Info commands, and how to write an Info as distinct from a Texinfo -file. The third part is about how to generate Info files from +file. The third part briefly explains how to generate Info files from Texinfo files. -@iftex -This manual is primarily designed for use on a computer, so that you can -try Info commands while reading about them. Reading it on paper is less +@ifnotinfo +This manual is primarily designed for browsing with an Info reader +program on a computer, so that you can try Info commands while reading +about them. Reading it on paper or with an HTML browser is less effective, since you must take it on faith that the commands described -really do what the manual says. By all means go through this manual now -that you have it; but please try going through the on-line version as -well. +really do what the manual says. By all means go through this manual +now that you have it; but please try going through the on-line version +as well. +@cindex Info reader, how to invoke +@cindex entering Info There are two ways of looking at the online version of this manual: @enumerate @item Type @code{info} at your shell's command line. This approach uses a -small stand-alone program designed just to read Info files. +stand-alone program designed just to read Info files. @item -Type @code{emacs} at the command line; then type @kbd{C-h i} (Control -@kbd{h}, followed by @kbd{i}). This approach uses the Info mode of the -Emacs program, an editor with many other capabilities. +Type @code{emacs} at the command line; then type @kbd{C-h i} +(@kbd{Control-h}, followed by @kbd{i}). This approach uses the Info +mode of the Emacs program, an editor with many other capabilities. @end enumerate In either case, then type @kbd{mInfo} (just the letters), followed by @key{RET}---the ``Return'' or ``Enter'' key. At this point, you should be ready to follow the instructions in this manual as you read them on the screen. @c FIXME! (pesch@cygnus.com, 14 dec 1992) @c Is it worth worrying about what-if the beginner goes to somebody @c else's Emacs session, which already has an Info running in the middle @c of something---in which case these simple instructions won't work? -@end iftex +@end ifnotinfo @menu * Help-Small-Screen:: Starting Info on a Small Screen * Help:: How to use Info * Help-P:: Returning to the Previous node -* Help-^L:: The Space, Rubout, B and ^L commands. +* Help-^L:: The Space, DEL, B and ^L commands. * Help-M:: Menus -* Help-Adv:: Some advanced Info commands +* Help-Xref:: Following cross-references +* Help-Int:: Some intermediate Info commands * Help-Q:: Quitting Info @end menu -@node Help-Small-Screen, Help, , Getting Started -@comment node-name, next, previous, up +@node Help-Small-Screen @section Starting Info on a Small Screen -@iftex +@ifnotinfo (In Info, you only see this section if your terminal has a small number of lines; most readers pass by it without seeing it.) -@end iftex +@end ifnotinfo -Since your terminal has an unusually small number of lines on its +@cindex small screen, moving around +Since your terminal has a relatively small number of lines on its screen, it is necessary to give you special advice at the beginning. -If you see the text @samp{--All----} at near the bottom right corner +If you see the text @samp{--All----} near the bottom right corner of the screen, it means the entire text you are looking at fits on the screen. If you see @samp{--Top----} instead, it means that there is more text below that does not fit. To move forward through the text -and see another screen full, press the Space bar, @key{SPC}. To move -back up, press the key labeled @samp{Backspace} or @key{Delete}. +and see another screen full, press @key{SPC}, the Space bar. To move +back up, press the key labeled @samp{Backspace} or @samp{DEL} (on some +keyboards, this key might be labeled @samp{Delete}). @ifinfo -Here are 40 lines of junk, so you can try Spaces and Deletes and +Here are 40 lines of junk, so you can try @key{SPC} and @key{DEL} and see what they do. At the end are instructions of what you should do next. -This is line 17 @* -This is line 18 @* -This is line 19 @* -This is line 20 @* -This is line 21 @* -This is line 22 @* -This is line 23 @* -This is line 24 @* -This is line 25 @* -This is line 26 @* -This is line 27 @* -This is line 28 @* -This is line 29 @* -This is line 30 @* -This is line 31 @* -This is line 32 @* -This is line 33 @* -This is line 34 @* -This is line 35 @* -This is line 36 @* -This is line 37 @* -This is line 38 @* -This is line 39 @* -This is line 40 @* -This is line 41 @* -This is line 42 @* -This is line 43 @* -This is line 44 @* -This is line 45 @* -This is line 46 @* -This is line 47 @* -This is line 48 @* -This is line 49 @* -This is line 50 @* -This is line 51 @* -This is line 52 @* -This is line 53 @* -This is line 54 @* -This is line 55 @* -This is line 56 @* +@format +This is line 20 +This is line 21 +This is line 22 +This is line 23 +This is line 24 +This is line 25 +This is line 26 +This is line 27 +This is line 28 +This is line 29 +This is line 30 +This is line 31 +This is line 32 +This is line 33 +This is line 34 +This is line 35 +This is line 36 +This is line 37 +This is line 38 +This is line 39 +This is line 40 +This is line 41 +This is line 42 +This is line 43 +This is line 44 +This is line 45 +This is line 46 +This is line 47 +This is line 48 +This is line 49 +This is line 50 +This is line 51 +This is line 52 +This is line 53 +This is line 54 +This is line 55 +This is line 56 +This is line 57 +This is line 58 +This is line 59 +@end format If you have managed to get here, go back to the beginning with -Delete, and come back here again, then you understand Space and -Delete. So now type an @kbd{n} ---just one character; don't type -the quotes and don't type the Return key afterward--- to -get to the normal start of the course. +@kbd{DEL} (or @key{BACKSPACE}), and come back here again, then you +understand the about the @samp{Space} and @samp{Backspace} keys. So +now type an @kbd{n} ---just one character; don't type the quotes and +don't type the Return key afterward--- to get to the normal start of +the course. @end ifinfo @node Help, Help-P, Help-Small-Screen, Getting Started @comment node-name, next, previous, up @section How to use Info You are talking to the program Info, for reading documentation. +@cindex node, in Info documents Right now you are looking at one @dfn{Node} of Information. A node contains text describing a specific topic at a specific -level of detail. This node's topic is ``how to use Info''. +level of detail. This node's topic is ``how to use Info''. The mode +line says that this is node @samp{Help} in the file @file{info}. +@cindex header of Info node The top line of a node is its @dfn{header}. This node's header (look at -it now) says that it is the node named @samp{Help} in the file -@file{info}. It says that the @samp{Next} node after this one is the node +it now) says that the @samp{Next} node after this one is the node called @samp{Help-P}. An advanced Info command lets you go to any node -whose name you know. - - Besides a @samp{Next}, a node can have a @samp{Previous} or an @samp{Up}. -This node has a @samp{Previous} but no @samp{Up}, as you can see. - +whose name you know. In the stand-alone Info reader program, the +header line shows the names of this node and the info file as well. +In Emacs, the header line is displayed in a special typeface, and it +doesn't scroll off the screen when you scroll the display. The names +of this node and of its Info file are omitted by Emacs from the header +line. + + Besides a @samp{Next}, a node can have a @samp{Previous} or an +@samp{Up} links, or both. As you can see, this node has all of these +links. + +@kindex n @r{(Info mode)} Now it is time to move on to the @samp{Next} node, named @samp{Help-P}. ->> Type @samp{n} to move there. Type just one character; +@format +>> Type @kbd{n} to move there. Type just one character; do not type the quotes and do not type a @key{RET} afterward. +@end format +@noindent @samp{>>} in the margin means it is really time to try a command. +@format +>> If you have a mouse, and if you already practiced typing @kbd{n} + to get to the next node, click now with the right mouse button on + the @samp{Next} link to do the same ``the mouse way''. +@end format + @node Help-P, Help-^L, Help, Getting Started @comment node-name, next, previous, up @section Returning to the Previous node +@kindex p @r{(Info mode)} This node is called @samp{Help-P}. The @samp{Previous} node, as you see, is @samp{Help}, which is the one you just came from using the @kbd{n} command. Another @kbd{n} command now would take you to the next -node, @samp{Help-^L}. - ->> But do not do that yet. First, try the @kbd{p} command, which takes - you to the @samp{Previous} node. When you get there, you can do an - @kbd{n} again to return here. +node, @samp{Help-^L}. In Emacs, @kbd{n} runs the Emacs command +@code{Info-next}, and @kbd{p} runs @code{Info-prev}. + +@format +>> But do not type @kbd{n} yet. First, try the @kbd{p} command, + or click the mouse on the @samp{Prev} link, which takes you to the + @samp{Previous} node. When you get there, you can do an @kbd{n} + again to return here. +@end format + + If you read this in Emacs, you will see an @samp{Info} item in the +menu bar, close to its right edge. Clicking your mouse on the +@samp{Info} menu-bar item opens a menu of commands which include +@samp{Next} and @samp{Prev} (and also some others which you didn't yet +learn about). This all probably seems insultingly simple so far, but @emph{do not} be led into skimming. Things will get more complicated soon. Also, do not try a new command until you are told it is time to. Otherwise, you may make Info skip past an important warning that was coming up. ->> Now do an @kbd{n} to get to the node @samp{Help-^L} and learn more. +@format +>> Now do an @kbd{n}, or click the mouse on the @samp{Next} link, to + get to the node @samp{Help-^L} and learn more. +@end format @node Help-^L, Help-M, Help-P, Getting Started @comment node-name, next, previous, up -@section The Space, Delete, B and ^L commands. +@section The Space, DEL, B and ^L commands. - This node's header tells you that you are now at node @samp{Help-^L}, and -that @kbd{p} would get you back to @samp{Help-P}. The node's title is -underlined; it says what the node is about (most nodes have titles). + This node's mode line tells you that you are now at node @samp{Help-^L}, +and the header line tells you that @kbd{p} would get you back to +@samp{Help-P}. The node's title is underlined; it says what the node +is about (most nodes have titles). This is a big node and it does not all fit on your display screen. You can tell that there is more that is not visible because you can see the string @samp{--Top-----} rather than @samp{--All----} near the bottom right corner of the screen. - The Space, Delete and @kbd{B} commands exist to allow you to ``move -around'' in a node that does not all fit on the screen at once. -Space moves forward, to show what was below the bottom of the screen. -Delete moves backward, to show what was above the top of the screen -(there is not anything above the top until you have typed some spaces). - ->> Now try typing a Space (afterward, type a Delete to return here). - - When you type the space, the two lines that were at the bottom of -the screen appear at the top, followed by more lines. Delete takes -the two lines from the top and moves them to the bottom, -@emph{usually}, but if there are not a full screen's worth of lines -above them they may not make it all the way to the bottom. - - If you type Space when there is no more to see, it rings the -bell and otherwise does nothing. The same goes for Delete when -the header of the node is visible. - - If your screen is ever garbaged, you can tell Info to print it out -again by typing @kbd{C-l} (@kbd{Control-L}, that is---hold down ``Control'' and -type an @key{L} or @kbd{l}). - +@kindex SPC @r{(Info mode)} +@kindex DEL @r{(Info mode)} +@kindex BACKSPACE @r{(Info mode)} +@findex Info-scroll-up +@findex Info-scroll-down + The @key{SPC}, @key{BACKSPACE} (or @key{DEL})@footnote{The key which +we call ``Backspace or DEL'' in this manual is labeled differently on +different keyboards. Look for a key which is a little ways above the +@key{ENTER} or @key{RET} key and which you normally use outside Emacs +to erase the character before the cursor, i.e.@: the character you +typed last. It might be labeled @samp{Backspace} or @samp{<-} or +@samp{DEL}, or sometimes @samp{Delete}.} and @kbd{b} commands exist to +allow you to ``move around'' in a node that does not all fit on the +screen at once. @key{SPC} moves forward, to show what was below the +bottom of the screen. @key{DEL} or @key{BACKSPACE} moves backward, to +show what was above the top of the screen (there is not anything above +the top until you have typed some spaces). In Emacs, @key{SPC} runs +the command @code{Info-scroll-up}, while @key{BACKSPACE} runs +@code{Info-scroll-down}. + +@format +>> Now try typing a @key{SPC} (afterward, type a @key{BACKSPACE} to + return here). +@end format + + When you type the @key{SPC}, the two lines that were at the bottom of +the screen appear at the top, followed by more lines. @key{DEL} or +@key{BACKSPACE} takes the two lines from the top and moves them to the +bottom, @emph{usually}, but if there are not a full screen's worth of +lines above them they may not make it all the way to the bottom. + + If you are reading this in Emacs, note that the header line is +always visible, never scrolling off the display. That way, you can +always see the @samp{Next}, @samp{Prev}, and @samp{Up} links, and you +can conveniently go to one of these links from anywhere in the node by +clicking the mouse on one of these links. + +@cindex reading Info documents top to bottom +@cindex Info documents as tutorials + @key{SPC} and @key{DEL} not only move forward and backward through +the current node. When these keys hit the beginning or the end of the +current node, they move to preceding or subsequent nodes. +Specifically, they scroll through all the nodes in an Info file as a +single logical sequence. In this sequence, a node's subnodes appear +following their parent. If a node has a menu, @key{SPC} takes you +into the subnodes listed in the menu, one by one. Once you reach the +end of a node, and have seen all of its subnodes, @key{SPC} takes you +to the next node or to the parent's next node. This is so you could +read the entire manual top to bottom by just typing @key{SPC}. + +@kindex PAGEUP @r{(Info mode)} +@kindex PAGEDOWN @r{(Info mode)} + Many keyboards nowadays have two scroll keys labeled @samp{PageUp} +and @samp{PageDown} (or maybe @samp{Prior} and @samp{Next}). If your +keyboard has these keys, you can use them to move forward and backward +through the text, like with @key{SPC} and @key{BACKSPACE}. However, +unlike @key{SPC} and @key{BACKSPACE}, @key{PAGEUP} and @key{PAGEDOWN} +keys will never scroll beyond the beginning or the end of the current +node. + +@kindex C-l @r{(Info mode)} + If your screen is ever garbaged, you can tell Info to display it +again by typing @kbd{C-l} (@kbd{Control-L}, that is---hold down +@key{CTRL} and type @kbd{L} or @kbd{l}). + +@format >> Type @kbd{C-l} now. +@end format +@kindex b @r{(Info mode)} To move back to the beginning of the node you are on, you can type -a lot of Deletes. You can also type simply @kbd{b} for beginning. +a lot of @key{BACKSPACE} keys. You can also type simply @kbd{b} for +beginning. + +@format >> Try that now. (We have put in enough verbiage to push this past -the first screenful, but screens are so big nowadays that perhaps it -isn't enough. You may need to shrink your Emacs or Info window.) -Then come back, with Spaces. + the first screenful, but screens are so big nowadays that perhaps it + isn't enough. You may need to shrink your Emacs or Info window.) + Then come back, with @key{SPS}s. +@end format If your screen is very tall, all of this node might fit at once. -In that case, "b" won't do anything. Sorry; what can we do? +In that case, @kbd{b} won't do anything. Sorry; what can we do? +@kindex ? @r{(Info mode)} +@findex Info-summary You have just learned a considerable number of commands. If you want to use one but have trouble remembering which, you should type -a @key{?} which prints out a brief list of commands. When you are -finished looking at the list, make it go away by pressing @key{SPC} -repeatedly. +a @kbd{?} (in Emacs it runs the @code{Info-summary} command) which +displays a brief list of commands. When you are finished looking at +the list, make it go away by typing a @key{SPC} repeatedly. +@format >> Type a @key{?} now. Press @key{SPC} to see consecutive screenfuls of ->> the list until finished. + the list until finished. Then type @key{SPC} several times, until + it goes away. +@end format + + (If you are using the stand-alone Info reader, type @kbd{C-x 0} to +return here, that is---press and hold @key{CTRL}, type an @kbd{x}, +then release @key{CTRL} and @kbd{x}, and press @kbd{0}---a zero, not +the letter ``o''.) From now on, you will encounter large nodes without warning, and -will be expected to know how to use Space and Delete to move -around in them without being told. Since not all terminals have +will be expected to know how to use @key{SPC} and @key{BACKSPACE} to +move around in them without being told. Since not all terminals have the same size screen, it would be impossible to warn you anyway. ->> Now type @kbd{n} to see the description of the @kbd{m} command. +@format +>> Now type @kbd{n}, or click the mouse on the @samp{Next} link, to + see the description of the @kbd{m} command. +@end format -@node Help-M, Help-Adv, Help-^L, Getting Started +@node Help-M, Help-Xref, Help-^L, Getting Started @comment node-name, next, previous, up -@section Menus - -Menus and the @kbd{m} command - - With only the @kbd{n} and @kbd{p} commands for moving between nodes, nodes -are restricted to a linear sequence. Menus allow a branching -structure. A menu is a list of other nodes you can move to. It is -actually just part of the text of the node formatted specially so that -Info can interpret it. The beginning of a menu is always identified -by a line which starts with @samp{* Menu:}. A node contains a menu if and -only if it has a line in it which starts that way. The only menu you -can use at any moment is the one in the node you are in. To use a -menu in any other node, you must move to that node first. +@section Menus and the @kbd{m} command + +@cindex menus in an Info document +@cindex Info menus + With only the @kbd{n} (next) and @kbd{p} (previous) commands for +moving between nodes, nodes are restricted to a linear sequence. +Menus allow a branching structure. A menu is a list of other nodes +you can move to. It is actually just part of the text of the node +formatted specially so that Info can interpret it. The beginning of a +menu is always identified by a line which starts with @samp{* Menu:}. +A node contains a menu if and only if it has a line in it which starts +that way. The only menu you can use at any moment is the one in the +node you are in. To use a menu in any other node, you must move to +that node first. After the start of the menu, each line that starts with a @samp{*} identifies one subtopic. The line usually contains a brief name for the subtopic (followed by a @samp{:}), the name of the node that talks about that subtopic, and optionally some further description of the subtopic. Lines in the menu that do not start with a @samp{*} have no special meaning---they are only for the human reader's benefit and do not define additional subtopics. Here is an example: @example -* Foo: FOO's Node This tells about FOO +* Foo: Node about FOO This tells about FOO @end example -The subtopic name is Foo, and the node describing it is @samp{FOO's Node}. -The rest of the line is just for the reader's Information. -[[ But this line is not a real menu item, simply because there is -no line above it which starts with @samp{* Menu:}.]] +The subtopic name is Foo, and the node describing it is @samp{Node +about FOO}. The rest of the line is just for the reader's +Information. [[ But this line is not a real menu item, simply because +there is no line above it which starts with @samp{* Menu:}.]] When you use a menu to go to another node (in a way that will be described soon), what you specify is the subtopic name, the first thing in the menu line. Info uses it to find the menu line, extracts the node name from it, and goes to that node. The reason that there is both a subtopic name and a node name is that the node name must be meaningful to the computer and may therefore have to be ugly looking. The subtopic name can be chosen just to be convenient for the user to specify. Often the node name is convenient for the user to specify and so both it and the subtopic name are the same. There is an abbreviation for this: @example * Foo:: This tells about FOO @end example @noindent This means that the subtopic name and node name are the same; they are both @samp{Foo}. ->> Now use Spaces to find the menu in this node, then come back to - the front with a @kbd{b} and some Spaces. As you see, a menu is +@format +>> Now use @key{SPC} to find the menu in this node, then come back to + the front with a @kbd{b} and some @key{SPC}s. As you see, a menu is actually visible in its node. If you cannot find a menu in a node by looking at it, then the node does not have a menu and the @kbd{m} command is not available. +@end format +@kindex m @r{(Info mode)} The command to go to one of the subnodes is @kbd{m}---but @emph{do -not do it yet!} Before you use @kbd{m}, you must understand the -difference between commands and arguments. So far, you have learned -several commands that do not need arguments. When you type one, Info -processes it and is instantly ready for another command. The @kbd{m} -command is different: it is incomplete without the @dfn{name of the -subtopic}. Once you have typed @kbd{m}, Info tries to read the -subtopic name. +not do it yet!} Before you use @kbd{m}, you need to learn about +commands which prompt you for more input. So far, you have learned +several commands that do not need additional input; when you typed +one, Info processed it and was instantly ready for another command. +The @kbd{m} command is different: it is incomplete without the +@dfn{name of the subtopic}. Once you have typed @kbd{m}, Info tries +to read the subtopic name. Now look for the line containing many dashes near the bottom of the screen. There is one more line beneath that one, but usually it is blank. If it is empty, Info is ready for a command, such as @kbd{n} -or @kbd{b} or Space or @kbd{m}. If that line contains text ending -in a colon, it mean Info is trying to read the @dfn{argument} to a +or @kbd{b} or @key{SPC} or @kbd{m}. If that line contains text ending +in a colon, it means Info is trying to read more input for the last command. At such times, commands do not work, because Info tries to -use them as the argument. You must either type the argument and +use them as the input it needs. You must either type your response and finish the command you started, or type @kbd{Control-g} to cancel the command. When you have done one of those things, the line becomes blank again. +@findex Info-menu The command to go to a subnode via a menu is @kbd{m}. After you type the @kbd{m}, the line at the bottom of the screen says @samp{Menu item: }. You must then type the name of the subtopic you want, and end it with -a @key{RET}. +a @key{RET}. In Emacs, @kbd{m} runs the command @code{Info-menu}. +@cindex abbreviating Info subnodes You can abbreviate the subtopic name. If the abbreviation is not unique, the first matching subtopic is chosen. Some menus put the shortest possible abbreviation for each subtopic name in capital letters, so you can see how much you need to type. It does not matter whether you use upper case or lower case when you type the subtopic. You should not put any spaces at the end, or inside of the item name, except for one space where a space appears in the item in the menu. +@cindex completion of Info node names You can also use the @dfn{completion} feature to help enter the subtopic -name. If you type the Tab key after entering part of a name, it will +name. If you type the @key{TAB} key after entering part of a name, it will magically fill in more of the name---as much as follows uniquely from what you have entered. If you move the cursor to one of the menu subtopic lines, then you do -not need to type the argument: you just type a Return, and it stands for -the subtopic of the line you are on. +not need to type the argument: you just type a @key{RET}, and it +stands for the subtopic of the line you are on. Here is a menu to give you a chance to practice. This menu gives you three ways of going to one place, Help-FOO: @menu * Foo: Help-FOO. A node you can visit for fun. * Bar: Help-FOO. Strange! two ways to get to the same place. * Help-FOO:: And yet another! @end menu +@format >> Now type just an @kbd{m} and see what happens: +@end format Now you are ``inside'' an @kbd{m} command. Commands cannot be used now; the next thing you will type must be the name of a subtopic. - You can change your mind about doing the @kbd{m} by typing Control-g. + You can change your mind about doing the @kbd{m} by typing +@kbd{Control-g}. +@format >> Try that now; notice the bottom line clear. +@end format +@format >> Then type another @kbd{m}. +@end format ->> Now type @samp{BAR} item name. Do not type Return yet. +@format +>> Now type @kbd{BAR}, the item name. Do not type @key{RET} yet. +@end format - While you are typing the item name, you can use the Delete key to -cancel one character at a time if you make a mistake. + While you are typing the item name, you can use the @key{DEL} (or +@key{BACKSPACE}) key to cancel one character at a time if you make a +mistake. ->> Type one to cancel the @samp{R}. You could type another @samp{R} to - replace it. You do not have to, since @samp{BA} is a valid abbreviation. +@format +>> Press @key{DEL} to cancel the @samp{R}. You could type another @kbd{R} + to replace it. But you do not have to, since @samp{BA} is a valid + abbreviation. +@end format +@format >> Now you are ready to go. Type a @key{RET}. - - After visiting Help-FOO, you should return here. - ->> Type @kbd{n} to see more commands. - -@c If a menu appears at the end of this node, remove it. -@c It is an accident of the menu updating command. - -Here is another way to get to Help-FOO, a menu. You can ignore this -if you want, or else try it (but then please come back to here). +@end format + + After visiting @samp{Help-FOO}, you should return here. + + Another way to move to the menu subtopic lines and between them is +to type @key{TAB}. Each time you type a @key{TAB}, you move to the +next subtopic line. To move to a previous subtopic line, type +@kbd{M-@key{TAB}}---that is, press and hold the @key{META} key and then +press @key{TAB}. (On some keyboards, the @key{META} key might be labeled +@samp{Alt}.) + + Once you move cursor to a subtopic line, press @key{RET} to go to +that subtopic's node. + +@cindex mouse support in Info mode +@kindex Mouse-2 @r{(Info mode)} + If your terminal supports a mouse, you have yet another way of going +to a subtopic. Move your mouse pointer to the subtopic line, +somewhere between the beginning @samp{*} and the colon @samp{:} which +ends the subtopic's brief name. You will see the subtopic's name +change its appearance (usually, its background color will change), and +the shape of the mouse pointer will change if your platform supports +that. After a while, if you leave the mouse on that spot, a tooltip +will pop up saying ``Mouse-2: go to that node''. (If the tooltips are +turned off or unavailable, this message is displayed in the @dfn{echo +area}, the bottom screen line where you typed the menu subtopics in +response to the prompt.) @kbd{Mouse-2} is the second button of your +mouse counting from the left---the rightmost button for two-button +mice, the middle button for 3-button mice. So pressing @kbd{Mouse-2} +while the mouse pointer is on a menu subtopic goes to that subtopic. + +@findex Info-mouse-follow-nearest-node + More generally, @kbd{Mouse-2} in an Info buffer runs the Emacs +command @code{Info-mouse-follow-nearest-node}, which finds the nearest +link to another node and goes there. For example, near a cross +reference it acts like @kbd{f}, in a menu it acts like @kbd{m}, on the +node's header line it acts like @kbd{n}, @kbd{p}, or @kbd{u}, etc. At +end of the node's text @kbd{Mouse-2} moves to the next node, or up if +there's no next node. + + Here is another way to get to Help-FOO, a menu. You can ignore this +if you want, or else try it by typing @key{TAB} and then @key{RET}, or +clicking @kbd{Mouse-2} on it (but then please come back to here). @menu * Help-FOO:: @end menu +@format +>> Type @kbd{n} to see more commands. +@end format + @node Help-FOO, , , Help-M -@comment node-name, next, previous, up @subsection The @kbd{u} command - Congratulations! This is the node @samp{Help-FOO}. Unlike the other -nodes you have seen, this one has an @samp{Up}: @samp{Help-M}, the node you -just came from via the @kbd{m} command. This is the usual -convention---the nodes you reach from a menu have @samp{Up} nodes that lead -back to the menu. Menus move Down in the tree, and @samp{Up} moves Up. -@samp{Previous}, on the other hand, is usually used to ``stay on the same -level but go backwards'' + Congratulations! This is the node @samp{Help-FOO}. It has an @samp{Up} +pointer @samp{Help-M}, the node you just came from via the @kbd{m} +command. This is the usual convention---the nodes you reach from a menu +have @samp{Up} nodes that lead back to the menu. Menus move Down in the +tree, and @samp{Up} moves Up. @samp{Previous}, on the other hand, is +usually used to ``stay on the same level but go backwards''. +@kindex u @r{(Info mode)} +@findex Info-up You can go back to the node @samp{Help-M} by typing the command -@kbd{u} for ``Up''. That puts you at the @emph{front} of the -node---to get back to where you were reading you have to type -some @key{SPC}s. +@kbd{u} for ``Up'' (the Emacs command run by @kbd{u} is +@code{Info-up}). That puts you at the @emph{front} of the node---to +get back to where you were reading you have to type some @key{SPC}s. +(Some Info readers, such as the one built into Emacs, put you at the +same place where you were reading in @samp{Help-M}.) + + Another way to go Up is to click on the @samp{Up} pointer shown in +the header line (provided that you have a mouse). +@format >> Now type @kbd{u} to move back up to @samp{Help-M}. +@end format -@node Help-Adv, Help-Q, Help-M, Getting Started +@node Help-Xref, Help-Int, Help-M, Getting Started @comment node-name, next, previous, up -@section Some advanced Info commands +@section Following Cross-References + +@cindex cross references in Info documents + In Info documentation, you will see many @dfn{cross references}. +Cross references look like this: @xref{Help-Cross, Cross}. That text +is a real, live cross reference, whose name is @samp{Cross} and which +points to the node named @samp{Help-Cross}. + +@kindex f @r{(Info mode)} +@findex Info-follow-reference + There are two ways to follow a cross reference. You can move the +cursor to it and press @key{RET}, just as in a menu. @key{RET} +follows the cross reference that the cursor is on. Or you can type +@kbd{f} and then specify the name of the cross reference (in this +case, @samp{Cross}) as an argument. In Emacs Info, @kbd{f} runs +@code{Info-follow-reference}, + + In the @kbd{f} command, you select the cross reference with its +name, so it does not matter where the cursor was. If the cursor is on +or near a cross reference, @kbd{f} suggests that reference name in +parentheses as the default; typing @key{RET} will follow that +reference. However, if you type a different reference name, @kbd{f} +will follow the other reference which has that name. + +@format +>> Type @kbd{f}, followed by @kbd{Cross}, and then @key{RET}. +@end format + + As you enter the reference name, you can use the @key{DEL} (or +@key{BACKSPACE}) key to edit your input. If you change your mind +about following any reference, you can use @kbd{Control-g} to cancel +the command. Completion is available in the @kbd{f} command; you can +complete among all the cross reference names in the current node by +typing a @key{TAB}. + + To get a list of all the cross references in the current node, you +can type @kbd{?} after an @kbd{f}. The @kbd{f} continues to await a +cross reference name even after displaying the list, so if you don't +actually want to follow a reference, you should type a @kbd{Control-g} +to cancel the @kbd{f}. + +@format +>> Type @kbd{f?} to get a list of the cross references in this node. Then + type a @kbd{Control-g} and see how the @samp{f} gives up. +@end format - The course is almost over, so please stick with it to the end. + The @key{TAB} and @kbd{M-@key{TAB}} key, which move between menu +items in a menu, also move between cross references outside of menus. +@node Help-Int, Help-Q, Help-Xref, Getting Started +@comment node-name, next, previous, up +@section Some intermediate Info commands + + The introductory course is almost over; please continue +a little longer to learn some intermediate-level commands. + + Most Info files have an index, which is actually a large node that +contains nothing but a menu. The menu has one menu item for each +topic listed in the index. You can find the index node from the main +menu of the file, with the @kbd{m} command; then you can use the +@kbd{m} command again in the index node to go to the node that +describes the topic. + + There is also a short-cut Info command, @kbd{i}, which does all of +that for you. It searches the index for a given topic (a string) and +goes to the node which is listed in the index for that topic. +@xref{Info Search}, for a full explanation. + +@kindex l @r{(Info mode)} +@findex Info-last +@cindex going back in Info mode If you have been moving around to different nodes and wish to retrace your steps, the @kbd{l} command (@kbd{l} for @dfn{last}) will do that, one node-step at a time. As you move from node to node, Info records the nodes where you have been in a special history list. The @kbd{l} command revisits nodes in the history list; each successive @kbd{l} command moves one step back through the history. If you have been following directions, ad @kbd{l} command now will get you back to @samp{Help-M}. Another @kbd{l} command would undo the @kbd{u} and get you back to @samp{Help-FOO}. Another @kbd{l} would undo the @kbd{m} and get you back to @samp{Help-M}. ->> Try typing three @kbd{l}'s, pausing in between to see what each - @kbd{l} does. + In Emacs, @kbd{l} runs the command @code{Info-last}. -Then follow directions again and you will end up back here. +@format +>> Try typing three @kbd{l}'s, pausing in between to see what each + @kbd{l} does. Then follow directions again and you will end up + back here. +@end format Note the difference between @kbd{l} and @kbd{p}: @kbd{l} moves to where @emph{you} last were, whereas @kbd{p} always moves to the node -which the header says is the @samp{Previous} node (from this node, to -@samp{Help-M}). - - The @samp{d} command gets you instantly to the Directory node. -This node, which is the first one you saw when you entered Info, -has a menu which leads (directly, or indirectly through other menus), -to all the nodes that exist. - ->> Try doing a @samp{d}, then do an @kbd{l} to return here (yes, +which the header says is the @samp{Previous} node (from this node, the +@samp{Prev} link leads to @samp{Help-M}). + +@kindex d @r{(Info mode)} +@findex Info-directory +@cindex go to Directory node + The @kbd{d} command (@code{Info-directory} in Emacs) gets you +instantly to the Directory node. This node, which is the first one +you saw when you entered Info, has a menu which leads (directly or +indirectly, through other menus), to all the nodes that exist. The +Directory node lists all the manuals and other Info documents that +are, or could be, installed on your system. + +@format +>> Try doing a @kbd{d}, then do an @kbd{l} to return here (yes, @emph{do} return). - - Sometimes, in Info documentation, you will see a cross reference. -Cross references look like this: @xref{Help-Cross, Cross}. That is a -real, live cross reference which is named @samp{Cross} and points at -the node named @samp{Help-Cross}. - - If you wish to follow a cross reference, you must use the @samp{f} -command. The @samp{f} must be followed by the cross reference name -(in this case, @samp{Cross}). While you enter the name, you can use the -Delete key to edit your input. If you change your mind about following -any reference, you can use @kbd{Control-g} to cancel the command. - - Completion is available in the @samp{f} command; you can complete among -all the cross reference names in the current node by typing a Tab. - ->> Type @samp{f}, followed by @samp{Cross}, and a @key{RET}. - - To get a list of all the cross references in the current node, you can -type @kbd{?} after an @samp{f}. The @samp{f} continues to await a -cross reference name even after printing the list, so if you don't -actually want to follow a reference, you should type a @kbd{Control-g} -to cancel the @samp{f}. - ->> Type "f?" to get a list of the cross references in this node. Then - type a @kbd{Control-g} and see how the @samp{f} gives up. - +@end format + +@kindex t @r{(Info mode)} +@findex Info-top-node +@cindex go to Top node + The @kbd{t} command moves to the @samp{Top} node of the manual. +This is useful if you want to browse the manual's main menu, or select +some specific top-level menu item. The Emacs command run by @kbd{t} +is @code{Info-top-node}. + + Clicking @kbd{Mouse-2} on or near a cross reference also follows the +reference. You can see that the cross reference is mouse-sensitive by +moving the mouse pointer to the reference and watching how the +underlying text and the mouse pointer change in response. + +@format >> Now type @kbd{n} to see the last node of the course. +@end format + + @xref{Advanced Info}, for more advanced Info features. @c If a menu appears at the end of this node, remove it. @c It is an accident of the menu updating command. -@node Help-Cross, , , Help-Adv -@subsection The node reached by the cross reference in Info - - This is the node reached by the cross reference named @samp{Cross}. - - While this node is specifically intended to be reached by a cross -reference, most cross references lead to nodes that ``belong'' someplace -else far away in the structure of Info. So you cannot expect the -footnote to have a @samp{Next}, @samp{Previous} or @samp{Up} pointing -back to where you came from. In general, the @kbd{l} (el) command is -the only way to get back there. - ->> Type @kbd{l} to return to the node where the cross reference was. - -@node Help-Q, , Help-Adv, Getting Started -@comment node-name, next, previous, up -@section Quitting Info - - To get out of Info, back to what you were doing before, type @kbd{q} -for @dfn{Quit}. - - This is the end of the course on using Info. There are some other -commands that are meant for experienced users; they are useful, and you -can find them by looking in the directory node for documentation on -Info. Finding them will be a good exercise in using Info in the usual -manner. - ->> Type @samp{d} to go to the Info directory node; then type - @samp{mInfo} and Return, to get to the node about Info and - see what other help is available. - - @node Advanced Info @chapter Info for Experts -This chapter describes various advanced Info commands, and how to write -an Info as distinct from a Texinfo file. (However, in most cases, writing a -Texinfo file is better, since you can use it @emph{both} to generate an -Info file and to make a printed manual. @xref{Top,, Overview of -Texinfo, texinfo, Texinfo}.) + This chapter describes various advanced Info commands. (If you are +using a stand-alone Info reader, there are additional commands +specific to it, which are documented in several chapters of @ref{Top,, +GNU Info, info-stnd, GNU Info}.) + + This chapter also explains how to write an Info as distinct from a +Texinfo file. (However, in most cases, writing a Texinfo file is +better, since you can use it @emph{both} to generate an Info file and +to make a printed manual. @xref{Top,, Overview of Texinfo, texinfo, +Texinfo: The GNU Documentation Format}.) @menu * Expert:: Advanced Info commands: g, s, e, and 1 - 5. +* Info Search:: How to search Info documents for specific subjects. * Add:: Describes how to add new nodes to the hierarchy. Also tells what nodes look like. * Menus:: How to add to or create menus in Info nodes. * Cross-refs:: How to add cross-references to Info nodes. -* Tags:: How to make tag tables for Info files. +* Tags:: How to make tags tables for Info files. * Checking:: Checking an Info File * Emacs Info Variables:: Variables modifying the behavior of Emacs Info. @end menu -@node Expert, Add, , Advanced Info +@node Expert, Info Search, , Advanced Info @comment node-name, next, previous, up @section Advanced Info Commands -@kbd{g}, @kbd{s}, @kbd{1}, -- @kbd{9}, and @kbd{e} +Here are some more Info commands that make it easier to move around. -If you know a node's name, you can go there by typing @kbd{g}, the +@unnumberedsubsec @kbd{g} goes to a node by name + +@kindex g @r{(Info mode)} +@findex Info-goto-node +@cindex go to a node by name + If you know a node's name, you can go there by typing @kbd{g}, the name, and @key{RET}. Thus, @kbd{gTop@key{RET}} would go to the node -called @samp{Top} in this file (its directory node). -@kbd{gExpert@key{RET}} would come back here. +called @samp{Top} in this file. (This is equivalent to @kbd{t}, see +@ref{Help-Int}.) @kbd{gExpert@key{RET}} would come back here. +@kbd{g} in Emacs runs the command @code{Info-goto-node}. -Unlike @kbd{m}, @kbd{g} does not allow the use of abbreviations. + Unlike @kbd{m}, @kbd{g} does not allow the use of abbreviations. +But it does allow completion, so you can type @key{TAB} to complete a +partial node name. -To go to a node in another file, you can include the filename in the +@cindex go to another Info file + To go to a node in another file, you can include the file name in the node name by putting it at the front, in parentheses. Thus, @kbd{g(dir)Top@key{RET}} would go to the Info Directory node, which is -node @samp{Top} in the file @file{dir}. +the node @samp{Top} in the Info file @file{dir}. Likewise, +@kbd{g(emacs)Top@key{RET}} goes to the top node of the Emacs manual. -The node name @samp{*} specifies the whole file. So you can look at + The node name @samp{*} specifies the whole file. So you can look at all of the current file by typing @kbd{g*@key{RET}} or all of any -other file with @kbd{g(FILENAME)@key{RET}}. +other file with @kbd{g(@var{filename})@key{RET}}. + +@unnumberedsubsec @kbd{1} -- @kbd{9} choose a menu subtopic by its number + +@kindex 1 @r{through} 9 @r{(Info mode)} +@findex Info-nth-menu-item +@cindex select @var{n}'th menu item + If you begrudge each character of type-in which your system requires, +you might like to use the commands @kbd{1}, @kbd{2}, @kbd{3}, @kbd{4}, +@dots{}, @kbd{9}. They are short for the @kbd{m} command together +with a name of a menu subtopic. @kbd{1} goes through the first item +in the current node's menu; @kbd{2} goes through the second item, etc. +In the stand-alone reader, @kbd{0} goes through the last menu item; +this is so you need not count how many entries are there. In Emacs, +the digit keys run the command @code{Info-nth-menu-item}. + + If your display supports multiple fonts, and you are using Emacs' +Info mode to read Info files, the @samp{*} for the fifth menu item +stands out, either in color or in some other attribute, such as +underline, and so is the @samp{*} for the ninth item; this makes it +easy to see at a glance which number to use for an item. + + Some terminals don't support colors or underlining. If you need to +actually count items, it is better to use @kbd{m} instead, and specify +the name, or use @key{TAB} to quickly move between menu items. -The @kbd{s} command allows you to search a whole file for a string. +@unnumberedsubsec @kbd{e} makes Info document editable + +@kindex e @r{(Info mode)} +@findex Info-edit +@cindex edit Info document + The Info command @kbd{e} changes from Info mode to an ordinary +Emacs editing mode, so that you can edit the text of the current node. +Type @kbd{C-c C-c} to switch back to Info. The @kbd{e} command is allowed +only if the variable @code{Info-enable-edit} is non-@code{nil}. + + The @kbd{e} command only works in Emacs, where it runs the command +@code{Info-edit}. The stand-alone Info reader doesn't allow you to +edit the Info file, so typing @kbd{e} there goes to the end of the +current node. + +@node Info Search, Add, Expert, Advanced Info +@comment node-name, next, previous, up +@section How to search Info documents for specific subjects + +@cindex searching Info documents +@cindex Info document as a reference + The commands which move between and inside nodes allow you to read +the entire manual or its large portions. But what if you need to find +some information in the manual as fast as you can, and you don't know +or don't remember in what node to look for it? This need arises when +you use a manual as a @dfn{reference}, or when it is impractical to +read the entire manual before you start using the programs it +describes. + + Info has powerful searching facilities that let you find things +quickly. You can search either the manual indices or its text. + +@kindex i @r{(Info mode)} +@findex Info-index + Since most subjects related to what the manual describes should be +indexed, you should try the index search first. The @kbd{i} command +prompts you for a subject and then looks up that subject in the +indices. If it finds an index entry with the subject you typed, it +goes to the node to which that index entry points. You should browse +through that node to see whether the issue you are looking for is +described there. If it isn't, type @kbd{,} one or more times to go +through additional index entries which match your subject. + + The @kbd{i} command finds all index entries which include the string +you typed @emph{as a substring}. For each match, Info shows in the +echo area the full index entry it found. Often, the text of the full +index entry already gives you enough information to decide whether it +is relevant to what you are looking for, so we recommend that you read +what Emacs shows in the echo are before looking at the node it +displays. + + Since @kbd{i} looks for a substring, you can search for subjects even +if you are not sure how they are spelled in the index. For example, +suppose you want to find something that is pertinent to commands which +complete partial input (e.g., when you type @key{TAB}). If you want +to catch index entries that refer to ``complete'', ``completion'', and +``completing'', you could type @kbd{icomplet@key{RET}}. + + Info documents which describe programs should index the commands, +options, and key sequences that the program provides. If you are +looking for a description of a command, an option, or a key, just type +their names when @kbd{i} prompts you for a topic. For example, if you +want to read the description of what the @kbd{C-f} key does, type +@kbd{iC-f@key{RET}}. Here @kbd{C-f} are 3 literal characters +@samp{C}, @samp{-}, and @samp{f}, not the ``Control-f'' command key +you type inside Emacs to run the command bound to @kbd{C-f}. + + In Emacs, @kbd{i} runs the command @code{Info-index}. + +@kindex s @r{(Info mode)} +@findex Info-search + The @kbd{s} command allows you to search a whole file for a string. It switches to the next node if and when that is necessary. You type @kbd{s} followed by the string to search for, terminated by @key{RET}. To search for the same string again, just @kbd{s} followed by @key{RET} will do. The file's nodes are scanned in the order they are in in the file, which has no necessary relationship to the -order that they may be in in the tree structure of menus and @samp{next} +order that they may be in the tree structure of menus and @samp{next} pointers. But normally the two orders are not very different. In any case, you can always do a @kbd{b} to find out what node you have reached, if the header is not visible (this can happen, because @kbd{s} puts your cursor at the occurrence of the string, not at the beginning of the node). -If you grudge the system each character of type-in it requires, you -might like to use the commands @kbd{1}, @kbd{2}, @kbd{3}, @kbd{4}, ... -@kbd{9}. They are short for the @kbd{m} command together with an -argument. @kbd{1} goes through the first item in the current node's -menu; @kbd{2} goes through the second item, etc. +@kindex M-s @r{(Info mode)} + In Emacs, @kbd{Meta-s} is equivalent to @kbd{s}. That is for +compatibility with other GNU packages that use @kbd{M-s} for a similar +kind of search command. Both @kbd{s} and @kbd{M-s} run in Emacs the +command @code{Info-search}. -If your display supports multiple fonts, and you are using Emacs' Info -mode to read Info files, the @samp{*} for the fifth menu item is -underlined, and so is the @samp{*} for the ninth item; these underlines -make it easy to see at a glance which number to use for an item. -On ordinary terminals, you won't have underlining. If you need to -actually count items, it is better to use @kbd{m} instead, and specify -the name. - -The Info command @kbd{e} changes from Info mode to an ordinary -Emacs editing mode, so that you can edit the text of the current node. -Type @kbd{C-c C-c} to switch back to Info. The @kbd{e} command is allowed -only if the variable @code{Info-enable-edit} is non-@code{nil}. - -@node Add, Menus, Expert, Advanced Info +@node Add, Menus, Info Search, Advanced Info @comment node-name, next, previous, up @section Adding a new node to Info To add a new topic to the list in the Info directory, you must: + @enumerate @item Create some nodes, in some file, to document that topic. @item Put that topic in the menu in the directory. @xref{Menus, Menu}. @end enumerate -Usually, the way to create the nodes is with Texinfo (@pxref{Top,, -Overview of Texinfo, texinfo, Texinfo}); this has the advantage that you -can also make a printed manual from them. However, if you want to edit -an Info file, here is how. + Usually, the way to create the nodes is with Texinfo (@pxref{Top,, +Overview of Texinfo, texinfo, Texinfo: The GNU Documentation Format}); +this has the advantage that you can also make a printed manual from +them. However, if you want to edit an Info file, here is how. -The new node can live in an existing documentation file, or in a new -one. It must have a @key{^_} character before it (invisible to the +@cindex node delimiters + The new node can live in an existing documentation file, or in a new +one. It must have a @samp{^_} character before it (invisible to the user; this node has one but you cannot see it), and it ends with either -a @key{^_}, a @key{^L}, or the end of file. Note: If you put in a -@key{^L} to end a new node, be sure that there is a @key{^_} after it -to start the next one, since @key{^L} cannot @emph{start} a node. -Also, a nicer way to make a node boundary be a page boundary as well -is to put a @key{^L} @emph{right after} the @key{^_}. - - The @key{^_} starting a node must be followed by a newline or a -@key{^L} newline, after which comes the node's header line. The header +a @samp{^_}, a @samp{^L} (``formfeed''), or the end of file.@footnote{If +you put in a @samp{^L} to end a new node, be sure that there is a +@samp{^_} after it to start the next one, since @samp{^L} cannot +@emph{start} a node. Also, a nicer way to make a node boundary be a +page boundary as well is to put a @samp{^L} @emph{right after} the +@samp{^_}.} + + The @samp{^_} starting a node must be followed by a newline or a +@samp{^L} newline, after which comes the node's header line. The header line must give the node's name (by which Info finds it), and state the names of the @samp{Next}, @samp{Previous}, and @samp{Up} nodes (if there are any). As you can see, this node's @samp{Up} node is the node @samp{Top}, which points at all the documentation for Info. The @samp{Next} node is @samp{Menus}. - The keywords @dfn{Node}, @dfn{Previous}, @dfn{Up}, and @dfn{Next}, +@cindex node header line format +@cindex format of node headers + The keywords @dfn{Node}, @dfn{Next}, @dfn{Previous}, and @dfn{Up} may appear in any order, anywhere in the header line, but the recommended order is the one in this sentence. Each keyword must be followed by a colon, spaces and tabs, and then the appropriate name. The name may be terminated with a tab, a comma, or a newline. A space does not end it; node names may contain spaces. The case of letters in the names is insignificant. +@cindex node name format +@cindex Directory node A node name has two forms. A node in the current file is named by what appears after the @samp{Node: } in that node's first line. For example, this node's name is @samp{Add}. A node in another file is named by @samp{(@var{filename})@var{node-within-file}}, as in @samp{(info)Add} for this node. If the file name starts with ``./'', -then it is relative to the current directory; otherwise, it is relative -starting from the standard Info file directory of your site. -The name @samp{(@var{filename})Top} can be abbreviated to just -@samp{(@var{filename})}. By convention, the name @samp{Top} is used for -the ``highest'' node in any single file---the node whose @samp{Up} points -out of the file. The Directory node is @file{(dir)}. The @samp{Top} node -of a document file listed in the Directory should have an @samp{Up: +then it is relative to the current directory; otherwise, it is +relative starting from the standard directory for Info files of your +site. The name @samp{(@var{filename})Top} can be abbreviated to just +@samp{(@var{filename})}. By convention, the name @samp{Top} is used +for the ``highest'' node in any single file---the node whose @samp{Up} +points out of the file. The @samp{Directory} node is @file{(dir)}, it +points to a file @file{dir} which holds a large menu listing all the +Info documents installed on your site. The @samp{Top} node of a +document file listed in the @samp{Directory} should have an @samp{Up: (dir)} in it. +@cindex unstructured documents The node name @kbd{*} is special: it refers to the entire file. Thus, @kbd{g*} shows you the whole current file. The use of the node @kbd{*} is to make it possible to make old-fashioned, unstructured files into nodes of the tree. The @samp{Node:} name, in which a node states its own name, must not -contain a filename, since Info when searching for a node does not expect -one to be there. The @samp{Next}, @samp{Previous} and @samp{Up} names -may contain them. In this node, since the @samp{Up} node is in the same -file, it was not necessary to use one. +contain a file name, since when Info searches for a node, it does not +expect a file name to be there. The @samp{Next}, @samp{Previous} and +@samp{Up} names may contain them. In this node, since the @samp{Up} +node is in the same file, it was not necessary to use one. Note that the nodes in this file have a file name in the header line. The file names are ignored by Info, but they serve as comments to help identify the node for the user. @node Menus, Cross-refs, Add, Advanced Info @comment node-name, next, previous, up @section How to Create Menus Any node in the Info hierarchy may have a @dfn{menu}---a list of subnodes. The @kbd{m} command searches the current node's menu for the topic which it reads from the terminal. +@cindex menu and menu entry format A menu begins with a line starting with @samp{* Menu:}. The rest of the line is a comment. After the starting line, every line that begins -with a @samp{* } lists a single topic. The name of the topic--the -argument that the user must give to the @kbd{m} command to select this +with a @samp{* } lists a single topic. The name of the topic--what +the user must type at the @kbd{m}'s command prompt to select this topic---comes right after the star and space, and is followed by a colon, spaces and tabs, and the name of the node which discusses that topic. The node name, like node names following @samp{Next}, @samp{Previous} and @samp{Up}, may be terminated with a tab, comma, or newline; it may also be terminated with a period. If the node name and topic name are the same, then rather than -giving the name twice, the abbreviation @samp{* NAME::} may be used -(and should be used, whenever possible, as it reduces the visual +giving the name twice, the abbreviation @samp{* @var{name}::} may be +used (and should be used, whenever possible, as it reduces the visual clutter in the menu). It is considerate to choose the topic names so that they differ from each other very near the beginning---this allows the user to type short abbreviations. In a long menu, it is a good idea to capitalize the beginning of each item name which is the minimum acceptable abbreviation for it (a long menu is more than 5 or so entries). The nodes listed in a node's menu are called its ``subnodes'', and it is their ``superior''. They should each have an @samp{Up:} pointing at the superior. It is often useful to arrange all or most of the subnodes in a sequence of @samp{Next} and @samp{Previous} pointers so that someone who wants to see them all need not keep revisiting the Menu. The Info Directory is simply the menu of the node @samp{(dir)Top}---that is, node @samp{Top} in file @file{.../info/dir}. You can put new entries in that menu just like any other menu. The Info Directory is @emph{not} the same as the file directory called @file{info}. It happens that many of -Info's files live on that file directory, but they do not have to; and -files on that directory are not automatically listed in the Info +Info's files live in that file directory, but they do not have to; and +files in that directory are not automatically listed in the Info Directory node. Also, although the Info node graph is claimed to be a ``hierarchy'', in fact it can be @emph{any} directed graph. Shared structures and pointer cycles are perfectly possible, and can be used if they are appropriate to the meaning to be expressed. There is no need for all the nodes in a file to form a connected structure. In fact, this file has two connected components. You are in one of them, which is under the node @samp{Top}; the other contains the node @samp{Help} which the @kbd{h} command goes to. In fact, since there is no garbage collector, nothing terrible happens if a substructure is not pointed to, but such a substructure is rather useless since nobody can ever find out that it exists. @node Cross-refs, Tags, Menus, Advanced Info @comment node-name, next, previous, up @section Creating Cross References +@cindex cross reference format A cross reference can be placed anywhere in the text, unlike a menu item which must go at the front of a line. A cross reference looks -like a menu item except that it has @samp{*note} instead of @kbd{*}. +like a menu item except that it has @samp{*note} instead of @samp{*}. It @emph{cannot} be terminated by a @samp{)}, because @samp{)}'s are so often part of node names. If you wish to enclose a cross reference in parentheses, terminate it with a period first. Here are two examples of cross references pointers: @example *Note details: commands. (See *note 3: Full Proof.) @end example -They are just examples. The places they ``lead to'' do not really exist! +@noindent +@emph{These are just examples.} The places they ``lead to'' do not +really exist! + +@menu +* Help-Cross:: Target of a cross-reference. +@end menu + + +@node Help-Cross, , , Cross-refs +@subsection The node reached by the cross reference in Info + + This is the node reached by the cross reference named @samp{Cross}. + + While this node is specifically intended to be reached by a cross +reference, most cross references lead to nodes that ``belong'' +someplace else far away in the structure of an Info document. So you +cannot expect this node to have a @samp{Next}, @samp{Previous} or +@samp{Up} links pointing back to where you came from. In general, the +@kbd{l} (el) command is the only way to get back there. + +@format +>> Type @kbd{l} to return to the node where the cross reference was. +@end format + +@node Help-Q, , Help-Int, Getting Started +@comment node-name, next, previous, up +@section Quitting Info + +@kindex q @r{(Info mode)} +@findex Info-exit +@cindex quitting Info mode + To get out of Info, back to what you were doing before, type @kbd{q} +for @dfn{Quit}. This runs @code{Info-exit} in Emacs. + + This is the end of the basic course on using Info. You have learned +how to move in an Info document, and how to follow menus and cross +references. This makes you ready for reading manuals top to bottom, +as new users should do when they learn a new package. + + Another set of Info commands is useful when you need to find +something quickly in a manual---that is, when you need to use a manual +as a reference rather than as a tutorial. We urge you to make learn +these search commands as well. If you want to do that now, follow this +cross reference to @ref{Info Search}. + +Yet another set of commands are meant for experienced users; you can +find them by looking in the Directory node for documentation on Info. +Finding them will be a good exercise in using Info in the usual +manner. + +@format +>> Type @kbd{d} to go to the Info directory node; then type + @kbd{mInfo} and Return, to get to the node about Info and + see what other help is available. +@end format + @node Tags, Checking, Cross-refs, Advanced Info @comment node-name, next, previous, up -@section Tag Tables for Info Files +@section Tags Tables for Info Files +@cindex tags tables in info files You can speed up the access to nodes of a large Info file by giving -it a tag table. Unlike the tag table for a program, the tag table for +it a tags table. Unlike the tags table for a program, the tags table for an Info file lives inside the file itself and is used automatically whenever Info reads in the file. - To make a tag table, go to a node in the file using Emacs Info mode and type +@findex Info-tagify + To make a tags table, go to a node in the file using Emacs Info mode and type @kbd{M-x Info-tagify}. Then you must use @kbd{C-x C-s} to save the -file. - - Once the Info file has a tag table, you must make certain it is up -to date. If, as a result of deletion of text, any node moves back +file. Info files produced by the @code{makeinfo} command that is part +of the Texinfo package always have tags tables to begin with. + +@cindex stale tags tables +@cindex update Info tags table + Once the Info file has a tags table, you must make certain it is up +to date. If you edit an Info file directly (as opposed to editing its +Texinfo source), and, as a result of deletion of text, any node moves back more than a thousand characters in the file from the position -recorded in the tag table, Info will no longer be able to find that -node. To update the tag table, use the @code{Info-tagify} command again. +recorded in the tags table, Info will no longer be able to find that +node. To update the tags table, use the @code{Info-tagify} command +again. - An Info file tag table appears at the end of the file and looks like + An Info file tags table appears at the end of the file and looks like this: @example -^_ +^_^L Tag Table: File: info, Node: Cross-refs^?21419 File: info, Node: Tags^?22145 ^_ End Tag Table @end example @noindent Note that it contains one line per node, and this line contains the beginning of the node's header (ending just after the node name), -a Delete character, and the character position in the file of the +a @samp{DEL} character, and the character position in the file of the beginning of the node. @node Checking, Emacs Info Variables, Tags, Advanced Info @section Checking an Info File When creating an Info file, it is easy to forget the name of a node when you are making a pointer to it from another node. If you put in the wrong name for a node, this is not detected until someone tries to go through the pointer using Info. Verification of the Info file is an automatic process which checks all pointers to nodes and reports any pointers which are invalid. Every @samp{Next}, @samp{Previous}, and @samp{Up} is checked, as is every menu item and every cross reference. In addition, any @samp{Next} which does not have a @samp{Previous} pointing back is reported. Only pointers within the file are checked, because checking pointers to other files would be terribly slow. But those are usually few. +@findex Info-validate To check an Info file, do @kbd{M-x Info-validate} while looking at any node of the file with Emacs Info mode. @node Emacs Info Variables, , Checking, Advanced Info @section Emacs Info-mode Variables -The following variables may modify the behaviour of Info-mode in Emacs; +The following variables may modify the behavior of Info-mode in Emacs; you may wish to set one or several of these variables interactively, or in your @file{~/.emacs} init file. @xref{Examining, Examining and Setting Variables, Examining and Setting Variables, emacs, The GNU Emacs -Manual}. +Manual}. The stand-alone Info reader program has its own set of +variables, described in @ref{Variables,, Manipulating Variables, +info-stnd, GNU Info}. @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}. +@item Info-directory-list +The list of directories to search for Info files. Each element is a +string (directory name) or @code{nil} (try default directory). If not +initialized Info uses the environment variable @env{INFOPATH} to +initialize it, or @code{Info-default-directory-list} if there is no +@env{INFOPATH} variable in the environment. + +If you wish to customize the Info directory search list for both Emacs +info and stand-alone Info, it is best to set the @env{INFOPATH} +environment variable, since that applies to both programs. + +@item Info-additional-directory-list +A list of additional directories to search for Info documentation files. +These directories are not searched for merging the @file{dir} file. + +@item Info-fontify +When set to a non-@code{nil} value, enables highlighting of Info +files. The default is @code{t}. You can change how the highlighting +looks by customizing the faces @code{info-node}, @code{info-menu-5}, +@code{info-xref}, @code{info-header-xref}, @code{info-header-node}, +@code{info-title-@var{n}-face} (where @var{n} is the level of the +section, a number between 1 and 4), and @code{info-menu-header}. To +customize a face, type @kbd{M-x customize-face @key{RET} @var{face} +@key{RET}}, where @var{face} is one of the face names listed here. + +@item Info-use-header-line +If non-@code{nil}, Emacs puts in the Info buffer a header line showing +the @samp{Next}, @samp{Prev}, and @samp{Up} links. A header line does +not scroll with the rest of the buffer, making these links always +visible. + +@item Info-scroll-prefer-subnodes +If set to a non-@code{nil} value, @key{SPC} and @key{BACKSPACE} (or +@key{DEL}) keys in a menu visit subnodes of the current node before +scrolling to its end or beginning, respectively. For example, if the +node's menu appears on the screen, the next @key{SPC} moves to a +subnode indicated by the following menu item. Setting this option to +@code{nil} results in behavior similar to the stand-alone Info reader +program, which visits the first subnode from the menu only when you +hit the end of the current node. The default is @code{t}. @item Info-enable-active-nodes When set to a non-@code{nil} value, allows Info to execute Lisp code associated with nodes. The Lisp code is executed when the node is -selected. +selected. The Lisp code to be executed should follow the node +delimiter (the @samp{DEL} character) and an @samp{execute: } tag, like +this: -@item Info-directory-list -The list of directories to search for Info files. Each element is a -string (directory name) or @code{nil} (try default directory). +@example +^_execute: (message "This is an active node!") +@end example -@item Info-directory -The standard directory for Info documentation files. Only used when the -function @code{Info-directory} is called. +@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}. @end vtable @node Creating an Info File -@chapter Creating an Info File +@chapter Creating an Info File from a Texinfo File + +@code{makeinfo} is a utility that converts a Texinfo file into an Info +file; @code{texinfo-format-region} and @code{texinfo-format-buffer} are +GNU Emacs functions that do the same. + +@xref{Top,, Overview of Texinfo, texinfo, Texinfo: The GNU +Documentation Format}, to learn how to write a Texinfo file. + +@xref{Creating an Info File,,, texinfo, Texinfo: The GNU Documentation +Format}, to learn how to create an Info file from a Texinfo file. + +@xref{Installing an Info File,,, texinfo, Texinfo: The GNU +Documentation Format}, to learn how to install an Info file after you +have created one. -@xref{Top,, Overview of Texinfo, texinfo, Texinfo}, to learn how to -write a Texinfo file. +@node Index +@unnumbered Index -@xref{Creating an Info File,,, texinfo, Texinfo}, to learn how to create -an Info file from a Texinfo file. +This is an alphabetical listing of all the commands, variables, and +topics discussed in this document. -@xref{Installing an Info File,,, texinfo, Texinfo}, to learn how to -install an Info file after you have created one. +@printindex cp @bye diff --git a/contrib/texinfo/doc/install-info.1 b/contrib/texinfo/doc/install-info.1 index f2b8c2ace7aa..54b8fcfc39bb 100644 --- a/contrib/texinfo/doc/install-info.1 +++ b/contrib/texinfo/doc/install-info.1 @@ -1,84 +1,77 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.013. -.TH INSTALL-INFO "1" "September 1999" "GNU texinfo 4.0" FSF +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.24. +.TH INSTALL-INFO "1" "March 2002" "GNU texinfo 4.1" FSF .SH NAME install-info \- update info/dir entries .SH SYNOPSIS .B install-info [\fIOPTION\fR]... [\fIINFO-FILE \fR[\fIDIR-FILE\fR]] .SH DESCRIPTION -.PP Install or delete dir entries from INFO-FILE in the Info directory file DIR-FILE. .SH OPTIONS .TP \fB\-\-delete\fR delete existing entries for INFO-FILE from DIR-FILE; -.IP don't insert any new entries. .TP \fB\-\-dir\-file\fR=\fINAME\fR specify file name of Info directory file. -.IP This is equivalent to using the DIR-FILE argument. .TP \fB\-\-entry\fR=\fITEXT\fR insert TEXT as an Info directory entry. -.IP 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. .TP \fB\-\-help\fR display this help and exit. .TP \fB\-\-info\-file\fR=\fIFILE\fR specify Info file to install in the directory. -.IP This is equivalent to using the INFO-FILE argument. .TP \fB\-\-info\-dir\fR=\fIDIR\fR same as \fB\-\-dir\-file\fR=\fIDIR\fR/dir. .TP \fB\-\-item\fR=\fITEXT\fR same as \fB\-\-entry\fR TEXT. -.IP An Info directory entry is actually a menu item. .TP \fB\-\-quiet\fR suppress warnings. .TP \fB\-\-remove\fR same as \fB\-\-delete\fR. .TP \fB\-\-section\fR=\fISEC\fR put this file's entries in section SEC of the directory. -.IP 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. .TP \fB\-\-version\fR display version information and exit. .SH "REPORTING BUGS" Email bug reports to bug-texinfo@gnu.org, general questions and discussion to help-texinfo@gnu.org. +.SH COPYRIGHT +Copyright \(co 2002 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. .SH "SEE ALSO" The full documentation for .B install-info is maintained as a Texinfo manual. If the .B info and .B install-info programs are properly installed at your site, the command .IP .B info install-info .PP should give you access to the complete manual. -.SH COPYRIGHT -Copyright \(co 1999 Free Software Foundation, Inc. -There is NO warranty. You may redistribute this software -under the terms of the GNU General Public License. -For more information about these matters, see the files named COPYING. diff --git a/contrib/texinfo/doc/makeinfo.1 b/contrib/texinfo/doc/makeinfo.1 index 62d22b831b0b..b56cb838f110 100644 --- a/contrib/texinfo/doc/makeinfo.1 +++ b/contrib/texinfo/doc/makeinfo.1 @@ -1,152 +1,163 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.013. -.TH MAKEINFO "1" "September 1999" "GNU texinfo 4.0" FSF +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.24. +.TH MAKEINFO "1" "March 2002" "GNU texinfo 4.1" FSF .SH NAME makeinfo \- translate Texinfo documents .SH SYNOPSIS .B makeinfo -[\fIOPTION\fR]...\fI TEXINFO-FILE\fR... +[\fIOPTION\fR]... \fITEXINFO-FILE\fR... .SH DESCRIPTION -.PP -Translate Texinfo source documentation to various other formats: -Info files suitable for reading online with Emacs or standalone GNU Info -(by default); plain text (with \fB\-\-no\-headers\fR); or HTML (with \fB\-\-html\fR). -.SH OPTIONS +Translate Texinfo source documentation to various other formats, by default +Info files suitable for reading online with Emacs or standalone GNU Info. +.SS "General options:" .TP -\fB\-\-commands\-in\-node\-names\fR -allow @ commands in node names. +\fB\-\-error\-limit\fR=\fINUM\fR +quit after NUM errors (default 100). .TP -\fB\-D\fR VAR -define a variable, as with @set. +\fB\-\-force\fR +preserve output even if errors. +.TP +\fB\-\-help\fR +display this help and exit. +.TP +\fB\-\-no\-validate\fR +suppress node cross-reference validation. +.TP +\fB\-\-no\-warn\fR +suppress warnings (but not errors). +.TP +\fB\-\-reference\-limit\fR=\fINUM\fR +warn about at most NUM references (default 1000). +.TP +\fB\-v\fR, \fB\-\-verbose\fR +explain what is being done. +.TP +\fB\-\-version\fR +display version information and exit. +.SS "Output format selection (default is to produce Info):" +.TP +\fB\-\-docbook\fR +output DocBook rather than Info. +.TP +\fB\-\-html\fR +output HTML rather than Info. +.TP +\fB\-\-no\-headers\fR +output plain text, suppressing Info node +separators and Node: lines; also, write to +standard output without \fB\-\-output\fR. +.TP +\fB\-\-xml\fR +output XML (TexinfoML) rather than Info. +.SS "General output options:" .TP \fB\-E\fR, \fB\-\-macro\-expand\fR FILE output macro-expanded source to FILE. +ignoring any @setfilename. .TP -\fB\-\-error\-limit\fR=\fINUM\fR -quit after NUM errors (default 100). +\fB\-\-no\-split\fR +suppress splitting of Info or HTML output, +generate only one output file. +.TP +\fB\-\-number\-sections\fR +output chapter and sectioning numbers. +.TP +\fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR +output to FILE (directory if split HTML), +.SS "Options for Info and plain text:" +.TP +\fB\-\-enable\-encoding\fR +output accented and special characters in +Info output based on @documentencoding. .TP \fB\-\-fill\-column\fR=\fINUM\fR break Info lines at NUM characters (default 72). .TP \fB\-\-footnote\-style\fR=\fISTYLE\fR -output footnotes according to STYLE: -.IP -`separate' to place footnotes in their own node, -`end' to place the footnotes at the end of the +output footnotes in Info according to STYLE: +`separate' to put them in their own node; +`end' to put them at the end of the node .IP -node in which they are defined (the default). +in which they are defined (default). .TP -\fB\-\-force\fR -preserve output even if errors. +\fB\-\-paragraph\-indent\fR=\fIVAL\fR +indent Info paragraphs by VAL spaces (default 3). +If VAL is `none', do not indent; if VAL is +`asis', preserve existing indentation. .TP -\fB\-\-help\fR -display this help and exit. +\fB\-\-split\-size\fR=\fINUM\fR +split Info files at size NUM (default 50000). +.SS "Input file options:" .TP -\fB\-\-html\fR -output HTML rather than Info format; +\fB\-\-commands\-in\-node\-names\fR +allow @ commands in node names. +.TP +\fB\-D\fR VAR +define the variable VAR, as with @set. .TP \fB\-I\fR DIR append DIR to the @include search path. .TP +\fB\-P\fR DIR +prepend DIR to the @include search path. +.TP +\fB\-U\fR VAR +undefine the variable VAR, as with @clear. +.SS "Conditional processing in input:" +.TP \fB\-\-ifhtml\fR -process @ifhtml and @html text even when not -.IP -generating HTML. +process @ifhtml and @html even if not generating HTML. .TP \fB\-\-ifinfo\fR process @ifinfo text even when generating HTML. .TP \fB\-\-iftex\fR -process @iftex and @tex text. -.IP -implies \fB\-\-no\-split\fR. -.TP -\fB\-\-no\-headers\fR -suppress Info node separators and Node: lines and -.IP -write to standard output without \fB\-\-output\fR. +process @iftex and @tex text; implies \fB\-\-no\-split\fR. .TP \fB\-\-no\-ifhtml\fR do not process @ifhtml and @html text. .TP \fB\-\-no\-ifinfo\fR do not process @ifinfo text. .TP \fB\-\-no\-iftex\fR do not process @iftex and @tex text. -.TP -\fB\-\-no\-split\fR -suppress splitting of large Info output files or -generation of one HTML file per node. -.TP -\fB\-\-no\-validate\fR -suppress node cross-reference validation. -.TP -\fB\-\-no\-warn\fR -suppress warnings (but not errors). -.TP -\fB\-\-number\-sections\fR -include chapter, section, etc. numbers in output. -.TP -\fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR -output to FILE, ignoring any @setfilename. -.TP -\fB\-P\fR DIR -prepend DIR to the @include search path. -.TP -\fB\-\-paragraph\-indent\fR=\fIVAL\fR -indent Info paragraphs by VAL spaces (default 3). .IP -if VAL is `none', do not indent; -if VAL is `asis', preserve existing indentation. -.TP -\fB\-\-reference\-limit\fR=\fINUM\fR -warn about at most NUM references (default 1000). -.TP -\fB\-U\fR VAR -undefine a variable, as with @clear. -.TP -\fB\-v\fR, \fB\-\-verbose\fR -explain what is being done. -.TP -\fB\-\-version\fR -display version information and exit. -.PP The defaults for the @if... conditionals depend on the output format: if generating HTML, \fB\-\-ifhtml\fR is on and the others are off; if generating Info or plain text, \fB\-\-ifinfo\fR is on and the others are off. .SH EXAMPLES .TP makeinfo foo.texi write Info to foo's @setfilename .TP makeinfo \fB\-\-html\fR foo.texi write HTML to foo's @setfilename .TP makeinfo \fB\-\-no\-headers\fR \fB\-o\fR - foo.texi write plain text to standard output .TP makeinfo \fB\-\-number\-sections\fR foo.texi write Info with numbered sections .TP makeinfo \fB\-\-no\-split\fR foo.texi write one Info file however big .SH "REPORTING BUGS" Email bug reports to bug-texinfo@gnu.org, general questions and discussion to help-texinfo@gnu.org. +.SH COPYRIGHT +Copyright \(co 2002 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. .SH "SEE ALSO" The full documentation for .B makeinfo is maintained as a Texinfo manual. If the .B info and .B makeinfo programs are properly installed at your site, the command .IP .B info makeinfo .PP should give you access to the complete manual. -.SH COPYRIGHT -Copyright \(co 1999 Free Software Foundation, Inc. -There is NO warranty. You may redistribute this software -under the terms of the GNU General Public License. -For more information about these matters, see the files named COPYING. diff --git a/contrib/texinfo/doc/texindex.1 b/contrib/texinfo/doc/texindex.1 index 6708829704ce..019d5e4626b4 100644 --- a/contrib/texinfo/doc/texindex.1 +++ b/contrib/texinfo/doc/texindex.1 @@ -1,47 +1,46 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.013. -.TH TEXINDEX "1" "September 1999" "GNU texinfo 4.0" FSF +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.24. +.TH TEXINDEX "1" "March 2002" "GNU texinfo 4.1" FSF .SH NAME texindex \- sort Texinfo index files .SH SYNOPSIS .B texindex -[\fIOPTION\fR]...\fI FILE\fR... +[\fIOPTION\fR]... \fIFILE\fR... .SH DESCRIPTION -.PP Generate a sorted index for each TeX output FILE. Usually FILE... is specified as `foo.??' for a document `foo.texi'. .SH OPTIONS .TP \fB\-h\fR, \fB\-\-help\fR display this help and exit .TP \fB\-k\fR, \fB\-\-keep\fR keep temporary files around after processing .TP \fB\-\-no\-keep\fR do not keep temporary files around after processing (default) .TP \fB\-o\fR, \fB\-\-output\fR FILE send output to FILE .TP \fB\-\-version\fR display version information and exit .SH "REPORTING BUGS" Email bug reports to bug-texinfo@gnu.org, general questions and discussion to help-texinfo@gnu.org. +.SH COPYRIGHT +Copyright \(co 2002 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. .SH "SEE ALSO" The full documentation for .B texindex is maintained as a Texinfo manual. If the .B info and .B texindex programs are properly installed at your site, the command .IP .B info texindex .PP should give you access to the complete manual. -.SH COPYRIGHT -Copyright \(co 1999 Free Software Foundation, Inc. -There is NO warranty. You may redistribute this software -under the terms of the GNU General Public License. -For more information about these matters, see the files named COPYING. diff --git a/contrib/texinfo/doc/texinfo.txi b/contrib/texinfo/doc/texinfo.txi index 7e0bbd0f21e8..fed4c4cc0002 100644 --- a/contrib/texinfo/doc/texinfo.txi +++ b/contrib/texinfo/doc/texinfo.txi @@ -1,18391 +1,18870 @@ \input texinfo.tex @c -*-texinfo-*- -@c $Id: texinfo.txi,v 1.162 1999/09/28 19:38:01 karl Exp $ +@c $Id: texinfo.txi,v 1.192 2002/03/04 14:52:52 karl Exp $ @c %**start of header @c All text is ignored before the setfilename. @setfilename texinfo @include version.texi @settitle Texinfo @value{VERSION} @c Define a new index for options. @defcodeindex op @c Put everything except function (command, in this case) names in one @c index (arbitrarily chosen to be the concept index). @syncodeindex op cp @syncodeindex vr cp @syncodeindex pg cp @footnotestyle separate @paragraphindent 2 -@finalout +@c finalout @comment %**end of header @dircategory Texinfo documentation system @direntry * Texinfo: (texinfo). The GNU documentation format. * install-info: (texinfo)Invoking install-info. Update info/dir entries. * texi2dvi: (texinfo)Format with texi2dvi. Print Texinfo documents. * texindex: (texinfo)Format with tex/texindex. Sort Texinfo index files. -* makeinfo: (texinfo)makeinfo Preferred. Translate Texinfo source. +* makeinfo: (texinfo)Invoking makeinfo. Translate Texinfo source. @end direntry @c Before release, run C-u C-c C-u C-a (texinfo-all-menus-update with a @c prefix arg). This updates the node pointers, which texinfmt.el needs. @c Set smallbook if printing in smallbook format so the example of the @c smallbook font is actually written using smallbook; in bigbook, a kludge @c is used for TeX output. Do this through the -t option to texi2dvi, @c so this same source can be used for other paper sizes as well. @c smallbook @c set smallbook @c @@clear smallbook @c If you like blank pages. Can add through texi2dvi -t. @c setchapternewpage odd @c Currently undocumented command, 5 December 1993: @c nwnode (Same as node, but no warnings; for `makeinfo'.) @ifinfo This file documents Texinfo, a documentation system that can produce -both online information and a printed manual from a single source file. +both online information and a printed manual from a single source. This +edition is for Texinfo version @value{VERSION}, @value{UPDATED}. -Copyright (C) 1988, 90, 91, 92, 93, 95, 96, 97, 98, 99 +Copyright (C) 1988, 90, 91, 92, 93, 95, 96, 97, 98, 99, 2000, 01, 02 Free Software Foundation, Inc. -This edition is for Texinfo version @value{VERSION}, @value{UPDATED}. - -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. - -@ignore -Permission is granted to process this file through TeX and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). - -@end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed 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, -except that this permission notice may be stated in a translation approved -by the Free Software Foundation. +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation; with the +Invariant Section being ``History'', with no Front-Cover Texts, and with +no Back-Cover Texts. A copy of the license is included in the section +entitled ``GNU Free Documentation License''. @end ifinfo @shorttitlepage Texinfo @titlepage -@c use the new format for titles @title Texinfo @subtitle The GNU Documentation Format @subtitle for Texinfo version @value{VERSION}, @value{UPDATED} @author Robert J. Chassell @author Richard M. Stallman @c Include the Distribution inside the titlepage so @c that headings are turned off. @page @vskip 0pt plus 1filll -Copyright @copyright{} 1988, 90, 91, 92, 93, 95, 96, 97, 98, 99 +Copyright @copyright{} 1988, 90, 91, 92, 93, 95, 96, 97, 98, 99, 2000, 01, 02 Free Software Foundation, Inc. This manual is for Texinfo version @value{VERSION}, @value{UPDATED}. Published by the Free Software Foundation @* 59 Temple Place Suite 330 @* Boston, MA 02111-1307 @* USA @* ISBN 1-882114-67-1 @c for version 4.0, September 1999. @c ISBN 1-882114-65-5 @c for version 3.12, March 1998. @c ISBN 1-882114-63-9 is for edition 2.20 of 28 February 1995 @c ISBN 1-882114-64-7 is for edition 2.24 of November 1996. -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. +Cover art by Etienne Suvasa. -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation; with the +Invariant Section being ``History'', with no Front-Cover Texts, and with +no Back-Cover Texts. A copy of the license is included in the section +entitled ``GNU Free Documentation License''. -Permission is granted to copy and distribute 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. -@sp 2 -Cover art by Etienne Suvasa. @end titlepage @summarycontents @contents @ifnottex @node Top @top Texinfo -Texinfo is a documentation system that uses a single source file to -produce both online information and printed output. +Texinfo is a documentation system that uses a single source to produce +both online information and printed output. The first part of this master menu lists the major nodes in this Info document, including the @@-command and concept indices. The rest of the menu lists all the lower level nodes in the document. This is Edition @value{VERSION} of the Texinfo manual, updated @value{UPDATED}. @end ifnottex @menu * 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? * Ending a File:: What is at the end of a Texinfo file? * Structuring:: How to create chapters, sections, subsections, appendices, and other parts. * Nodes:: How to write nodes. * Menus:: How to write menus. * Cross References:: How to write cross references. * Marking Text:: How to mark words and phrases as code, keyboard input, meta-syntactic variables, and the like. * Quotations and Examples:: How to write quotations, examples, etc. * Lists and Tables:: How to write lists and tables. * Indices:: How to create indices. * Insertions:: How to insert @@-signs, braces, etc. * Breaks:: How to force and prevent line and page breaks. * Definition Commands:: How to describe functions and the like in a uniform manner. * Conditionals:: How to specify text for either @TeX{} or Info. * Internationalization:: * Defining New Texinfo Commands:: * Hardcopy:: How to convert a Texinfo file to a file for printing and how to print that file. * Creating and Installing Info Files:: * Command List:: All the Texinfo @@-commands. * Tips:: Hints on how to write a Texinfo document. * Sample Texinfo File:: A sample Texinfo file to look at. -* Sample Permissions:: Tell readers they have the right to copy - and distribute. * Include Files:: How to incorporate other Texinfo files. * Headings:: How to write page headings and footings. * Catching Mistakes:: How to find formatting mistakes. * Refilling Paragraphs:: All about paragraph refilling. * Command Syntax:: A description of @@-Command syntax. * Obtaining TeX:: How to Obtain @TeX{}. +* Documentation Copying:: The GNU Free Documentation License. * 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 * Reporting Bugs:: Submitting effective bug reports. * Using Texinfo:: Create printed or online output. * Info Files:: What is an Info file? * Printed Books:: Characteristics of a printed book or manual. * Formatting Commands:: @@-commands are used for formatting. * Conventions:: General rules for writing a Texinfo file. * Comments:: Writing comments and ignored text in general. * Minimum:: What a Texinfo file must have. * Six Parts:: Usually, a Texinfo file has six parts. * Short Sample:: A short sample Texinfo file. -* Acknowledgements and History:: Contributors and genesis. +* History:: Acknowledgements, contributors and genesis. 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. * 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. * Printing:: How to format and print part or all of a file. * Texinfo Mode Summary:: Summary of all the Texinfo mode commands. Updating Nodes and Menus * Updating Commands:: Five major updating commands. * Updating Requirements:: How to structure a Texinfo file for using the updating command. * Other Updating Commands:: How to indent descriptions, insert missing nodes lines, and update nodes in sequence. Beginning a Texinfo File * Four Parts:: Four parts begin a Texinfo file. * Sample Beginning:: Here is a sample beginning for a Texinfo file. * Header:: The very beginning of a Texinfo file. * Info Summary and Permissions:: Summary and copying permissions for Info. * Titlepage & Copyright Page:: Creating the title and copyright pages. * The Top Node:: Creating the `Top' node and master menu. * Software Copying Permissions:: Ensure that you and others continue to have the right to use and share software. The Texinfo File Header * 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. +* documentdescription:: Document summary for the HTML output. * setchapternewpage:: Start chapters on right-hand pages. * paragraphindent:: Specify paragraph indentation. * exampleindent:: Specify environment indentation. * End of Header:: Formatting a region requires this. The Title and Copyright Pages * titlepage:: Create a title for the printed document. * titlefont center sp:: The @code{@@titlefont}, @code{@@center}, and @code{@@sp} commands. * title subtitle author:: The @code{@@title}, @code{@@subtitle}, and @code{@@author} commands. * Copyright & Permissions:: How to write the copyright notice and include copying permissions. * end titlepage:: Turn on page headings after the title and copyright pages. * headings on off:: An option for turning headings on and off and double or single sided printing. The `Top' Node and Master Menu * Title of Top Node:: Sketch what the file is about. * Master Menu Parts:: A master menu has three or more parts. Ending a Texinfo File * 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. Chapter Structuring * Tree Structuring:: A manual is like an upside down tree @dots{} * Structuring Command Types:: How to divide a manual into parts. * makeinfo top:: The @code{@@top} command, part of the `Top' node. * chapter:: * unnumbered & appendix:: * majorheading & chapheading:: * section:: * unnumberedsec appendixsec heading:: * subsection:: * unnumberedsubsec appendixsubsec subheading:: * subsubsection:: Commands for the lowest level sections. * Raise/lower sections:: How to change commands' hierarchical level. Nodes * Two Paths:: Different commands to structure Info output and printed output. * Node Menu Illustration:: A diagram, and sample nodes and menus. * node:: Creating nodes, in detail. * makeinfo Pointer Creation:: Letting makeinfo determine node pointers. * anchor:: Defining arbitrary cross-reference targets. The @code{@@node} Command * Node Names:: How to choose node and pointer names. * Writing a Node:: How to write an @code{@@node} line. * 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. * Top Node Summary:: Write a brief description for readers. Menus * Menu Location:: Put a menu in a short node. * Writing a Menu:: What is a menu? * Menu Parts:: A menu entry has three parts. * Less Cluttered Menu Entry:: Two part menu entry. * Menu Example:: Two and three part menu entries. * Other Info Files:: How to refer to a different Info file. Cross References * References:: What cross references are for. * Cross Reference Commands:: A summary of the different commands. * Cross Reference Parts:: A cross reference has several parts. * xref:: Begin a reference with `See' @dots{} * Top Node Naming:: How to refer to the beginning of another file. * ref:: A reference for the last part of a sentence. * pxref:: How to write a parenthetical cross reference. * inforef:: How to refer to an Info-only file. * uref:: How to refer to a uniform resource locator. @code{@@xref} * Reference Syntax:: What a reference looks like and requires. * One Argument:: @code{@@xref} with one argument. * Two Arguments:: @code{@@xref} with two arguments. * Three Arguments:: @code{@@xref} with three arguments. * Four and Five Arguments:: @code{@@xref} with four and five arguments. Marking Words and Phrases * Indicating:: How to indicate definitions, files, etc. * Emphasis:: How to emphasize text. Indicating Definitions, Commands, etc. * Useful Highlighting:: Highlighting provides useful information. * code:: Indicating program code. * kbd:: Showing keyboard input. * key:: Specifying keys. -* samp:: Showing a literal sequence of characters. +* samp:: A literal sequence of characters. +* verb:: A verbatim sequence of characters. * var:: Indicating metasyntactic variables. * env:: Indicating environment variables. * file:: Indicating file names. * command:: Indicating command names. * option:: Indicating option names. * dfn:: Specifying definitions. * cite:: Referring to books not in the Info system. * acronym:: Indicating acronyms. * url:: Indicating a World Wide Web reference. * email:: Indicating an electronic mail address. Emphasizing Text * emph & strong:: How to emphasize text in Texinfo. * Smallcaps:: How to use the small caps font. * Fonts:: Various font commands for printed output. Quotations and Examples -* 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. -* noindent:: How to prevent paragraph indentation. -* lisp:: How to illustrate Lisp code. +* Block Enclosing Commands:: Different constructs for different purposes. +* quotation:: Writing a quotation. +* example:: Writing an example in a fixed-width font. +* verbatim:: Writing a verbatim example. +* verbatiminclude:: Including a file verbatim. +* lisp:: Illustrating Lisp code. * small:: Forms for @code{@@smallbook}. -* display:: How to write an example in the current font. -* format:: How to write an example that does not narrow - the margins. -* exdent:: How to undo the indentation of a line. -* flushleft & flushright:: How to push text flushleft or flushright. -* cartouche:: How to draw cartouches around examples. +* display:: Writing an example in the current font. +* format:: Writing an example without narrowed margins. +* exdent:: Undo indentation on a line. +* flushleft & flushright:: Pushing text flush left or flush right. +* noindent:: Preventing paragraph indentation. +* cartouche:: Drawing rounded rectangles around examples. Lists and Tables * Introducing Lists:: Texinfo formats lists for you. * 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 * table:: How to construct a two-column table. * ftable vtable:: Automatic indexing for two-column tables. * 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. Indices * Index Entries:: Choose different words for index entries. * Predefined Indices:: Use different indices for different kinds of entry. * Indexing Commands:: How to make an index entry. * Combining Indices:: How to combine indices. * New Indices:: How to define your own indices. Combining Indices * syncodeindex:: How to merge two indices, using @code{@@code} font for the merged-from index. * synindex:: How to merge two indices, using the default font of the merged-to index. Special Insertions * 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 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. * Glyphs:: How to indicate results of evaluation, expansion of macros, errors, etc. * Footnotes:: How to include footnotes. * Images:: How to include graphics. Inserting @@ and Braces * 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 +Inserting Ellipsis and Bullets * dots:: How to insert dots @dots{} * bullet:: How to insert a bullet. Inserting @TeX{} and the Copyright Symbol * tex:: How to insert the @TeX{} logo. * copyright symbol:: How to use @code{@@copyright}@{@}. Glyphs for Examples * Glyphs Summary:: * result:: How to show the result of expression. * expansion:: How to indicate an expansion. * Print Glyph:: How to indicate printed output. * Error Glyph:: How to indicate an error message. * Equivalence:: How to indicate equivalence. * Point Glyph:: How to indicate the location of point. Glyphs Summary * result:: * expansion:: * Print Glyph:: * Error Glyph:: * Equivalence:: * Point Glyph:: Footnotes * Footnote Commands:: How to write a footnote in Texinfo. * Footnote Styles:: Controlling how footnotes appear in Info. Making and Preventing Breaks * Break Commands:: Cause and prevent splits. * Line Breaks:: How to force a single line to use two lines. -* - and hyphenation:: How to tell TeX about hyphenation points. +* - 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. * need:: Another way to prevent unwanted page breaks. Definition Commands * Def Cmd Template:: How to structure a description using a definition command. * Optional Arguments:: How to handle optional and repeated arguments. * deffnx:: How to group two or more `first' lines. * Def Cmds in Detail:: All the definition commands. * Def Cmd Conventions:: Conventions for writing definitions. * Sample Function Definition:: The Definition Commands * Functions Commands:: Commands for functions and similar entities. * Variables Commands:: Commands for variables and similar entities. * Typed Functions:: Commands for functions in typed languages. * Typed Variables:: Commands for variables in typed languages. * Abstract Objects:: Commands for object-oriented programming. * Data Types:: The definition command for data types. Conditionally Visible Text * Conditional Commands:: Specifying text for HTML, Info, or @TeX{}. * Conditional Not Commands:: Specifying text for not HTML, Info, or @TeX{}. * Raw Formatter Commands:: Using raw @TeX{} or HTML commands. * set clear value:: Designating which text to format (for all output formats); and how to set a flag to a string that you can insert. @code{@@set}, @code{@@clear}, and @code{@@value} -* ifset ifclear:: Format a region if a flag is set. * set value:: Expand a flag variable to a string. +* ifset ifclear:: Format a region if a flag is set. * value Example:: An easy way to update edition information. Internationalization * documentlanguage:: Declaring the current language. * documentencoding:: Declaring the input encoding. Defining New Texinfo Commands * Defining Macros:: Defining and undefining new commands. * Invoking Macros:: Using a macro, once you've defined it. * Macro Details:: Beyond basic macro usage. * alias:: Command aliases. * definfoenclose:: Customized highlighting. Formatting and Printing Hardcopy * Use TeX:: Use @TeX{} to format for hardcopy. * Format with tex/texindex:: How to format with explicit shell commands. * Format with texi2dvi:: A simpler way to format. * Print with lpr:: How to print. * Within Emacs:: How to format and print from an Emacs shell. * Texinfo Mode Printing:: How to format and print in Texinfo mode. * Compile-Command:: How to print using Emacs's compile command. * Requirements Summary:: @TeX{} formatting requirements summary. * Preparing for TeX:: What to do before you use @TeX{}. * Overfull hboxes:: What are and what to do with overfull hboxes. * smallbook:: How to print small format books and manuals. -* A4 Paper:: How to print on European A4 paper. +* A4 Paper:: How to print on A4 or A5 paper. * pagesizes:: How to print with customized page sizes. * Cropmarks and Magnification:: How to print marks to indicate the size of pages and how to print scaled up output. * PDF Output:: Portable Document Format output. Creating and Installing Info Files * Creating an Info File:: -* Install an Info File:: +* Installing an Info File:: Creating an Info File * makeinfo advantages:: @code{makeinfo} provides better error checking. * Invoking makeinfo:: How to run @code{makeinfo} from a shell. * makeinfo options:: Specify fill-column and other options. * 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 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 to run better. * makeinfo html:: Generating HTML output. Installing an Info File * Directory File:: The top level menu for all Info files. -* New Info File:: Listing a new info file. +* New Info File:: Listing a new Info file. * 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 - -* Inserting Permissions:: How to put permissions in your document. -* ifinfo Permissions:: Sample @samp{ifinfo} copying permissions. -* Titlepage Permissions:: Sample Titlepage copying permissions. - Include Files * Using Include Files:: How to use the @code{@@include} command. * texinfo-multiple-files-update:: How to create and update nodes and menus when using included files. * Include File Requirements:: What @code{texinfo-multiple-files-update} expects. * Sample Include File:: A sample outer file with included files within it; and a sample included file. * Include Files Evolution:: How use of the @code{@@include} command has changed over time. Page Headings * Headings Introduced:: Conventions for using page headings. * Heading Format:: Standard page heading formats. * Heading Choice:: How to specify the type of page heading. * Custom Headings:: How to create your own headings and footings. Formatting Mistakes * makeinfo Preferred:: @code{makeinfo} finds errors. * Debugging with Info:: How to catch errors with Info formatting. * Debugging with TeX:: How to catch errors with @TeX{} formatting. * Using texinfo-show-structure:: How to use @code{texinfo-show-structure}. * Using occur:: How to list all lines containing a pattern. * Running Info-Validate:: How to find badly referenced nodes. Finding Badly Referenced Nodes * Using Info-validate:: How to run @code{Info-validate}. * Unsplit:: How to create an unsplit file. * Tagifying:: How to tagify a file. * Splitting:: How to split a file manually. + @end detailmenu @end menu @c Reward readers for getting to the end of the menu :). @c Contributed by Arnold Robbins. @quotation Documentation is like sex: when it is good, it is very, very good; and when it is bad, it is better than nothing. ---Dick Brandon @end quotation @node Copying @unnumbered Texinfo Copying Conditions @cindex Copying conditions @cindex Conditions for copying Texinfo The programs currently being distributed that relate to Texinfo include -portions of GNU Emacs, plus other separate programs (including -@code{makeinfo}, @code{info}, @code{texindex}, and @file{texinfo.tex}). +@code{makeinfo}, @code{info}, @code{texindex}, and @file{texinfo.tex}. These programs are @dfn{free}; this means that everyone is free to use them and free to redistribute them on a free basis. The Texinfo-related programs are not in the public domain; they are copyrighted and there are restrictions on their distribution, but these restrictions are designed to permit everything that a good cooperating citizen would want to do. What is not allowed is to try to prevent others from further -sharing any version of these programs that they might get from -you.@refill +sharing any version of these programs that they might get from you. - Specifically, we want to make sure that you have the right to give -away copies of the programs that relate to Texinfo, that you receive -source code or else can get it if you want it, that you can change these +Specifically, we want to make sure that you have the right to give away +copies of the programs that relate to Texinfo, that you receive source +code or else can get it if you want it, that you can change these programs or use pieces of them in new free programs, and that you know -you can do these things.@refill +you can do these things. - To make sure that everyone has such rights, we have to forbid you to +To make sure that everyone has such rights, we have to forbid you to deprive anyone else of these rights. For example, if you distribute copies of the Texinfo related programs, you must give the recipients all the rights that you have. You must make sure that they, too, receive or -can get the source code. And you must tell them their rights.@refill +can get the source code. And you must tell them their rights. - Also, for our own protection, we must make certain that everyone finds +Also, for our own protection, we must make certain that everyone finds out that there is no warranty for the programs that relate to Texinfo. If these programs are modified by someone else and passed on, we want their recipients to know that what they have is not what we distributed, so that any problems introduced by others will not reflect on our -reputation.@refill +reputation. -The precise conditions of the licenses for the programs currently -being distributed that relate to Texinfo are found in the General Public +The precise conditions of the licenses for the programs currently being +distributed that relate to Texinfo are found in the General Public Licenses that accompany them. @node Overview @chapter Overview of Texinfo @cindex Overview of Texinfo @cindex Texinfo overview @dfn{Texinfo}@footnote{The first syllable of ``Texinfo'' is pronounced like ``speck'', not ``hex''. This odd pronunciation is derived from, but is not the same as, the pronunciation of @TeX{}. In the word @TeX{}, the @samp{X} is actually the Greek letter ``chi'' rather than the English letter ``ex''. Pronounce @TeX{} as if the @samp{X} were the last sound in the name `Bach'; but pronounce Texinfo as if the @samp{x} were a `k'. Spell ``Texinfo'' with a capital ``T'' and the other letters in lower case.} is a documentation system that uses a single source file to produce both online information and printed output. This means that instead of writing two different documents, one for the online information and the other for a printed work, you need write only one document. Therefore, when the work is revised, you need revise only that one document. @menu * Reporting Bugs:: Submitting effective bug reports. * Using Texinfo:: Create printed or online output. * Info Files:: What is an Info file? * Printed Books:: Characteristics of a printed book or manual. * Formatting Commands:: @@-commands are used for formatting. * Conventions:: General rules for writing a Texinfo file. * Comments:: Writing comments and ignored text in general. * Minimum:: What a Texinfo file must have. * Six Parts:: Usually, a Texinfo file has six parts. * Short Sample:: A short sample Texinfo file. -* Acknowledgements and History:: Contributors and genesis. +* History:: Acknowledgements, contributors and genesis. @end menu @node Reporting Bugs @section Reporting Bugs @cindex Bugs, reporting @cindex Suggestions for Texinfo, making @cindex Reporting bugs -We welcome bug reports or suggestions for the Texinfo system, both -programs and documentation. Please email them to +We welcome bug reports and suggestions for any aspect of the Texinfo system, +programs, documentation, installation, anything. Please email them to @email{bug-texinfo@@gnu.org}. You can get the latest version of Texinfo from @uref{ftp://ftp.gnu.org/gnu/texinfo/} and its mirrors worldwide. @cindex Checklist for bug reports For bug reports, please include enough information for the maintainers to reproduce the problem. Generally speaking, that means: @itemize @bullet @item the version number of Texinfo and the program(s) or manual(s) involved. @item hardware, operating system, and compiler versions. @item any unusual options you gave to @command{configure}. @item the contents of any input files necessary to reproduce the bug. @item a description of the problem and samples of any erroneous output. @item anything else that you think would be helpful. @end itemize When in doubt whether something is needed or not, include it. It's better to include too much than to leave out something important. Patches are most welcome; if possible, please make them with @samp{@w{diff -c}} (@pxref{Top,, Overview, diffutils, Comparing and Merging Files}) and include @file{ChangeLog} entries (@pxref{Change Log,,, emacs, The GNU Emacs Manual}). -When sending email, please do not encode or split the messages in any -way if possible; it's much easier to deal with one plain text message, -however large, than many small ones. -@uref{ftp://ftp.gnu.org/gnu/sharutils/, GNU shar} is a convenient way of -packaging multiple and/or binary files for email. +When sending patches, if possible please do not encode or split them in +any way; it's much easier to deal with one plain text message, however +large, than many small ones. @uref{ftp://ftp.gnu.org/gnu/sharutils/, +GNU shar} is a convenient way of packaging multiple and/or binary files +for email. @node Using Texinfo @section Using Texinfo @cindex Using Texinfo in general @cindex Texinfo, introduction to @cindex Introduction to Texinfo Using Texinfo, you can create a printed document with the normal features of a book, including chapters, sections, cross references, and indices. From the same Texinfo source file, you can create a menu-driven, online Info file with nodes, menus, cross references, and indices. You can also create from that same source file an HTML output -file suitable for use with a web browser. @cite{The GNU Emacs Manual} -is a good example of a Texinfo file, as is this manual. +file suitable for use with a web browser, or an XML file. @cite{The GNU +Emacs Manual} is a good example of a Texinfo file, as is this manual. To make a printed document, you process a Texinfo source file with the @TeX{} typesetting program (but the Texinfo language is very different from @TeX{}'s usual language, plain @TeX{}). This creates a DVI file that you can typeset and print as a book or report (@pxref{Hardcopy}). @pindex makeinfo To output an Info file, process your Texinfo source with the @code{makeinfo} utility or Emacs's @code{texinfo-format-buffer} command. -You can install the result in your Info tree (@pxref{Install an Info +You can install the result in your Info tree (@pxref{Installing an Info File}). -To output an HTML file, process your Texinfo source with @code{makeinfo} -using the @samp{--html} option. You can (for example) install the -result on your web site. +To output an HTML file, run @code{makeinfo --html} on your Texinfo +source. You can (for example) install the result on your web site. + +@cindex Docbook, converting to Texinfo +@cindex Conversion, from Docbook to Texinfo +To output an XML file, run @code{makeinfo --xml} on your Texinfo source. +To output DocBook, run @code{makeinfo --docbook}. If you want to +convert from Docbook @emph{to} Texinfo, please see +@uref{http://docbook2X.sourceforge.net/}. @cindex Output formats, supporting more -@cindex Docbook output format @cindex SGML-tools output format If you are a programmer and would like to contribute to the GNU project by implementing additional output formats for Texinfo, that would be excellent. But please do not write a separate translator texi2foo for your favorite format foo! That is the hard way to do the job, and makes extra work in subsequent maintenance, since the Texinfo language is continually being enhanced and updated. Instead, the best approach is modify @code{makeinfo} to generate the new format, as it does now for Info and HTML. @TeX{} works with virtually all printers; Info works with virtually all computer terminals; the HTML output works with virtually all web browsers. Thus Texinfo can be used by almost any computer user. @cindex Source file A Texinfo source file is a plain @sc{ascii} file containing text and @dfn{@@-commands} (words preceded by an @samp{@@}) that tell the typesetting and formatting programs what to do. You may edit a Texinfo file with any text editor; but it is especially convenient to use GNU Emacs since that editor has a special mode, called Texinfo mode, that provides various Texinfo-related features. (@xref{Texinfo Mode}.) Before writing a Texinfo source file, you should learn about nodes, menus, cross references, and the rest, for example by reading this manual. You can use Texinfo to create both online help and printed manuals; moreover, Texinfo is freely redistributable. For these reasons, Texinfo is the official documentation format of the GNU project. More information is available at the @uref{http://www.gnu.org/doc/, GNU documentation web page}. @cindex Man page output, not supported From time to time, proposals are made to generate traditional Unix man pages from Texinfo source. This is not likely to ever be supported, because man pages have a very strict conventional format. Merely enhancing @command{makeinfo} to output troff format would be insufficient. Generating a good man page therefore requires a completely different source than the typical Texinfo applications of generating a good user manual or a good reference manual. This makes generating man pages incompatible with the Texinfo design goal of not having to document the same information in different ways for different output formats. You might as well just write the man page directly. @pindex help2man @cindex O'Dea, Brendan If you wish to support man pages, the program @command{help2man} may be useful; it generates a traditional man page from the @samp{--help} output of a program. In fact, this is currently used to generate man -pages for the Texinfo programs themselves. It is free software written +pages for the Texinfo programs themselves. It is GNU software written by Brendan O'Dea, available from @uref{http://www.ozemail.com.au/~bod/help2man.tar.gz}. @node Info Files @section Info files @cindex Info files An Info file is a Texinfo file formatted so that the Info documentation reading program can operate on it. (@code{makeinfo} and @code{texinfo-format-buffer} are two commands that convert a Texinfo file into an Info file.)@refill Info files are divided into pieces called @dfn{nodes}, each of which contains the discussion of one topic. Each node has a name, and contains both text for the user to read and pointers to other nodes, which are identified by their names. The Info program displays one node at a time, and provides commands with which the user can move to other related nodes.@refill @ifinfo @inforef{Top, info, info}, for more information about using Info.@refill @end ifinfo Each node of an Info file may have any number of child nodes that describe subtopics of the node's topic. The names of child nodes are listed in a @dfn{menu} within the parent node; this allows you to use certain Info commands to move to one of the child 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 provides a link to the previous section. This means that all the nodes that are at the level of sections within a chapter are linked together. Normally the order in this chain is the same as the order of the children in the parent's menu. Each child node records the parent node name as its `Up' pointer. The last child has no `Next' pointer, and the first child has the parent both as its `Previous' and as its `Up' pointer.@footnote{In some documents, the first child has no `Previous' pointer. Occasionally, the last child has the node name of the next following higher level node as its `Next' pointer.}@refill The book-like structuring of an Info file into nodes that correspond to chapters, sections, and the like is a matter of convention, not a requirement. The `Up', `Previous', and `Next' pointers of a node can point to any other nodes, and a menu can contain any other nodes. Thus, the node structure can be any directed graph. But it is usually more comprehensible to follow a structure that corresponds to the structure of chapters and sections in a printed book or report.@refill In addition to menus and to `Next', `Previous', and `Up' pointers, Info provides pointers of another kind, called references, that can be sprinkled throughout the text. This is usually the best way to represent links that do not fit a hierarchical structure.@refill Usually, you will design a document so that its nodes match the structure of chapters and sections in the printed output. But occasionally there are times when this is not right for the material being discussed. Therefore, Texinfo uses separate commands to specify the node structure for the Info file and the section structure for the printed output.@refill Generally, you enter an Info file through a node that by convention is named `Top'. This node normally contains just a brief summary of the file's purpose, and a large menu through which the rest of the file is reached. From this node, you can either traverse the file 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. Alternatively, with the standalone Info program, you can specify specific menu items on the command line (@pxref{Top,,, info, Info}). If you want to read through an Info file in sequence, as if it were a printed manual, you can hit @key{SPC} repeatedly, or you get the whole file with the advanced Info command @kbd{g *}. (@inforef{Expert, Advanced Info commands, info}.)@refill @c !!! dir file may be located in one of many places: @c /usr/local/emacs/info mentioned in info.c DEFAULT_INFOPATH @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 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 @cindex URI syntax for Info If you wish to refer to an Info file in a URI, you can use the (unofficial) syntax exemplified in the following. This works with Emacs/W3, for example: @example info:///usr/info/emacs#Dissociated%20Press info:emacs#Dissociated%20Press info://localhost/usr/info/emacs#Dissociated%20Press @end example The @command{info} program itself does not follow URI's of any kind. @node Printed Books @section Printed Books @cindex Printed book and manual characteristics @cindex Manual characteristics, printed @cindex Book characteristics, printed @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 @pindex texi2roff@r{, unsupported software} @uref{ftp://tug.org/texi2roff.tar.gz, @code{texi2roff}} program if you do not have @TeX{}; since Texinfo is designed for use with @TeX{}, @code{texi2roff} is not described here. @code{texi2roff} is not part of the standard GNU distribution and is not maintained or up-to-date with all the Texinfo features described in this manual.} A Texinfo-based book is similar to any other typeset, printed work: it can have a title page, copyright page, table of contents, and preface, as well as chapters, numbered or unnumbered sections and subsections, page headers, cross references, footnotes, and indices.@refill You can use Texinfo to write a book without ever having the intention of converting it into online information. You can use Texinfo for writing a printed novel, and even to write a printed memo, although this latter application is not recommended since electronic mail is so much easier.@refill @TeX{} is a general purpose typesetting program. Texinfo provides a file @file{texinfo.tex} that contains information (definitions or @dfn{macros}) that @TeX{} uses when it typesets a Texinfo file. (@file{texinfo.tex} tells @TeX{} how to convert the Texinfo @@-commands to @TeX{} commands, which @TeX{} can then process to create the typeset document.) @file{texinfo.tex} contains the specifications for printing a document. You can get the latest version of @file{texinfo.tex} from @uref{ftp://ftp.gnu.org/gnu/texinfo.tex}. -Most often, documents are printed on 8.5 inch by 11 inch -pages (216@dmn{mm} by 280@dmn{mm}; this is the default size), but you -can also print for 7 inch by 9.25 inch pages (178@dmn{mm} by -235@dmn{mm}; the @code{@@smallbook} size) or on European A4 size paper -(@code{@@afourpaper}). (@xref{smallbook, , Printing ``Small'' Books}. -Also, see @ref{A4 Paper, ,Printing on A4 Paper}.)@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 can also +print for 7 inch by 9.25 inch pages (178@dmn{mm} by 235@dmn{mm}; the +@code{@@smallbook} size) or on A4 or A5 size paper (@code{@@afourpaper}, +@code{@@afivepaper}). (@xref{smallbook, , Printing ``Small'' Books}. +Also, see @ref{A4 Paper, ,Printing on A4 Paper}.) By changing the parameters in @file{texinfo.tex}, you can change the size of the printed document. In addition, you can change the style in which the printed document is formatted; for example, you can change the sizes and fonts used, the amount of indentation for each paragraph, the degree to which words are hyphenated, and the like. By changing the specifications, you can make a book look dignified, old and serious, or light-hearted, young and cheery.@refill @TeX{} is freely distributable. It is written in a superset of Pascal called WEB and can be compiled either in Pascal or (by using a conversion program that comes with the @TeX{} distribution) in C. (@xref{TeX Mode, ,@TeX{} Mode, emacs, The GNU Emacs Manual}, for information about @TeX{}.)@refill @TeX{} is very powerful and has a great many features. Because a Texinfo file must be able to present information both on a character-only terminal in Info form and in a typeset book, the formatting commands that Texinfo supports are necessarily limited.@refill To get a copy of @TeX{}, see @ref{Obtaining TeX, , How to Obtain @TeX{}}. @node Formatting Commands, Conventions, Printed Books, Overview -@comment node-name, next, previous, up @section @@-commands @cindex @@-commands @cindex Formatting commands In a Texinfo file, the commands that tell @TeX{} how to typeset the printed manual and tell @code{makeinfo} and @code{texinfo-format-buffer} how to create an Info file are preceded by @samp{@@}; they are called @dfn{@@-commands}. For example, @code{@@node} is the command to indicate a node and @code{@@chapter} is the command to indicate the start of a chapter.@refill @quotation @strong{Please note:} All the @@-commands, with the exception of the @code{@@TeX@{@}} command, must be written entirely in lower case.@refill @end quotation The Texinfo @@-commands are a strictly limited set of constructs. The strict limits make it possible for Texinfo files to be understood both by @TeX{} and by the code that converts them into Info files. You can display Info files on any terminal that displays alphabetic and numeric characters. Similarly, you can print the output generated by @TeX{} on a wide variety of printers.@refill Depending on what they do or what arguments@footnote{The word @dfn{argument} comes from the way it is used in mathematics and does not refer to a dispute between two people; it refers to the information presented to the command. According to the @cite{Oxford English Dictionary}, the word derives from the Latin for @dfn{to make clear, prove}; thus it came to mean `the evidence offered as proof', which is to say, `the information offered', which led to its mathematical meaning. In its other thread of derivation, the word came to mean `to assert in a manner against which others may make counter assertions', which led to the meaning of `argument' as a dispute.} they take, you need to write @@-commands on lines of their own or as part of sentences: @itemize @bullet @item Write a command such as @code{@@noindent} at the beginning of a line as the only text on the line. (@code{@@noindent} prevents the beginning of the next line from being indented as the beginning of a paragraph.)@refill @item Write a command such as @code{@@chapter} at the beginning of a line followed by the command's arguments, in this case the chapter title, on the rest of the line. (@code{@@chapter} creates chapter titles.)@refill @item Write a command such as @code{@@dots@{@}} wherever you wish but usually within a sentence. (@code{@@dots@{@}} creates dots @dots{})@refill @item Write a command such as @code{@@code@{@var{sample-code}@}} wherever you wish (but usually within a sentence) with its argument, @var{sample-code} in this example, between the braces. (@code{@@code} marks text as being code.)@refill @item Write a command such as @code{@@example} on a line of its own; write the body-text on following lines; and write the matching @code{@@end} command, @code{@@end example} in this case, at the on a line of its own after the body-text. (@code{@@example} @dots{} @code{@@end example} indents and typesets body-text as an example.) It's usually ok to indent environment commands like this, but in complicated and hard-to-define circumstances the extra spaces cause extra space to appear in the output, so beware. @end itemize @noindent @cindex Braces, when to use As a general rule, a command requires braces if it mingles among other text; but it does not need braces if it starts a line of its own. The non-alphabetic commands, such as @code{@@:}, are exceptions to the rule; they do not need braces.@refill As you gain experience with Texinfo, you will rapidly learn how to write the different commands: the different ways to write commands make it easier to write and read Texinfo files than if all commands followed exactly the same syntax. (For details about @@-command syntax, see @ref{Command Syntax, , @@-Command Syntax}.)@refill + @node Conventions, Comments, Formatting Commands, Overview -@comment node-name, next, previous, up @section General Syntactic Conventions @cindex General syntactic conventions @cindex Syntactic conventions @cindex Conventions, syntactic This section describes the general conventions used in all Texinfo documents. @itemize @bullet @item All printable @sc{ascii} characters except @samp{@@}, @samp{@{} and @samp{@}} can appear in a Texinfo file and stand for themselves. @samp{@@} is the escape character which introduces commands. @samp{@{} and @samp{@}} should be used only to surround arguments to certain commands. To put one of these special characters into the document, put an @samp{@@} character in front of it, like this: @samp{@@@@}, @samp{@@@{}, and @samp{@@@}}.@refill @item @ifinfo It is customary in @TeX{} to use doubled single-quote characters to begin and end quotations: ` ` and ' ' (but without a space between the two single-quote characters). This convention should be followed in Texinfo files. @TeX{} converts doubled single-quote characters to left- and right-hand doubled quotation marks and Info converts doubled single-quote characters to @sc{ascii} double-quotes: ` ` and ' ' to " .@refill @end ifinfo @iftex It is customary in @TeX{} to use doubled single-quote characters to begin and end quotations: @w{@t{ `` }} and @w{@t{ '' }}. This convention should be followed in Texinfo files. @TeX{} converts doubled single-quote characters to left- and right-hand doubled quotation marks, ``like this'', and Info converts doubled single-quote characters to @sc{ascii} double-quotes: @w{@t{ `` }} and @w{@t{ '' }} to @w{@t{ " }}.@refill @end iftex @item Use three hyphens in a row, @samp{---}, for a dash---like this. In @TeX{}, a single or double hyphen produces a printed dash that is shorter than the usual typeset dash. Info reduces three hyphens to two for display on the screen. @item To prevent a paragraph from being indented in the printed manual, put the command @code{@@noindent} on a line by itself before the paragraph.@refill @item If you mark off a region of the Texinfo file with the @code{@@iftex} and @w{@code{@@end iftex}} commands, that region will appear only in the printed copy; in that region, you can use certain commands 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{}. Similarly for @code{@@ifhtml @dots{} @@end ifhtml}, @code{@@ifnothtml @dots{} @@end ifnothtml}, @code{@@ifnotinfo @dots{} @@end ifnotinfo}, @code{@@ifnottex @dots{} @@end ifnottex}. @xref{Conditionals}. @end itemize @cindex Tabs; don't use! @quotation -@strong{Caution:} Do not use tabs in a Texinfo file! @TeX{} uses -variable-width fonts, which means that it cannot predefine a tab to work -in all circumstances. Consequently, @TeX{} treats tabs like single -spaces, and that is not what they look like. Furthermore, -@code{makeinfo} does nothing special with tabs, and thus a tab character -in your input file may appear differently in the output. +@strong{Caution:} Do not use tabs in a Texinfo file (except in verbatim +modes) ! @TeX{} uses variable-width fonts, which means that it is +impractical at best to define a tab to work in all circumstances. +Consequently, @TeX{} treats tabs like single spaces, and that is not +what they look like. Furthermore, @code{makeinfo} does nothing special +with tabs, and thus a tab character in your input file may appear +differently in the output, for example, in an indented example. @noindent To avoid this problem, Texinfo mode causes GNU Emacs to insert multiple -spaces when you press the @key{TAB} key.@refill +spaces when you press the @key{TAB} key. @noindent Also, you can run @code{untabify} in Emacs to convert tabs in a region -to multiple spaces.@refill +to multiple spaces. @end quotation + @node Comments, Minimum, Conventions, Overview -@comment node-name, next, previous, up @section Comments You can write comments in a Texinfo file that will not appear in either the Info file or the printed manual by using the @code{@@comment} command (which may be abbreviated to @code{@@c}). Such comments are for the person who revises the Texinfo file. All the text on a line that follows either @code{@@comment} or @code{@@c} is a comment; the rest of the line does not appear in either the Info file or the printed manual. (Often, you can write the @code{@@comment} or @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 whole line. You cannot use @code{@@comment} or @code{@@c} in a line beginning with such a command.)@refill @cindex Comments @findex comment @findex c @r{(comment)} You can write long stretches of text that will not appear in either the Info file or the printed manual by using the @code{@@ignore} and @code{@@end ignore} commands. Write each of these commands on a line of its own, starting each command at the beginning of the line. Text between these two commands does not appear in the processed output. You can use @code{@@ignore} and @code{@@end ignore} for writing -comments. Often, @code{@@ignore} and @code{@@end ignore} is used -to enclose a part of the copying permissions that applies to the -Texinfo source file of a document, but not to the Info or printed -version of the document.@refill +comments. + @cindex Ignored text @cindex Unprocessed text @findex ignore @c !!! Perhaps include this comment about ignore and ifset: @ignore Text enclosed by @code{@@ignore} or by failing @code{@@ifset} or @code{@@ifclear} conditions is ignored in the sense that it will not -contribute to the formatted output. However, TeX and makeinfo must +contribute to the formatted output. However, @TeX{} and makeinfo must still parse the ignored text, in order to understand when to @emph{stop} ignoring text from the source file; that means that you will still get error messages if you have invalid Texinfo markup within ignored text. @end ignore + @node Minimum, Six Parts, Comments, Overview -@comment node-name, next, previous, up @section What a Texinfo File Must Have @cindex Minimal Texinfo file (requirements) @cindex Must have in Texinfo file @cindex Required in Texinfo file @cindex Texinfo file minimum By convention, the names of Texinfo files end with one of the extensions @file{.texinfo}, @file{.texi}, @file{.txi}, or @file{.tex}. The longer extension is preferred since it describes more clearly to a human reader the nature of the file. The shorter extensions are for operating systems that cannot handle long file names.@refill In order to be made into a printed manual and an Info file, a Texinfo file @strong{must} begin with lines like this:@refill @example @group \input texinfo @@setfilename @var{info-file-name} @@settitle @var{name-of-manual} @end group @end example @noindent The contents of the file follow this beginning, and then you @strong{must} end a Texinfo file with a line like this:@refill @example @@bye @end example @findex input @r{(@TeX{} command)} @noindent 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 tells @TeX{} to open auxiliary files. The @samp{@@settitle} line specifies a -title for the page headers (or footers) of the printed manual.@refill +title for the page headers (or footers) of the printed manual, and the +default document description title for the @samp{<head>} in HTML format. 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 Usually, you will not use quite such a spare format, but will include mode setting and start-of-header and end-of-header lines at the beginning of a Texinfo file, like this:@refill @example @group \input texinfo @@c -*-texinfo-*- @@c %**start of header @@setfilename @var{info-file-name} @@settitle @var{name-of-manual} @@c %**end of header @end group @end example @noindent In the first line, @samp{-*-texinfo-*-} causes Emacs to switch into 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 run @TeX{} or Info on just part of the file. (@xref{Start of Header}, for more information.)@refill Furthermore, you will usually provide a Texinfo file with a title page, indices, and the like. But the minimum, which can be useful for short documents, is just the three lines at the beginning and the one line at the end.@refill @node Six Parts, Short Sample, Minimum, Overview @comment node-name, next, previous, up @section Six Parts of a Texinfo File Generally, a Texinfo file contains more than the minimal beginning and end---it usually contains six parts:@refill @table @r @item 1. Header The @dfn{Header} names the file, tells @TeX{} which definitions' file to use, and performs other ``housekeeping'' tasks.@refill @item 2. Summary Description and Copyright The @dfn{Summary Description and Copyright} segment describes the document and contains the copyright notice and copying permissions for the Info 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 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. The title and copyright page appear only in the printed @w{manual}.@refill @item 4. `Top' Node and Master Menu The @dfn{Master Menu} contains a complete menu of all the nodes in the whole Info file. It appears only in the Info file, in the `Top' node.@refill @item 5. Body The @dfn{Body} of the document may be structured like a traditional book or encyclopedia or it may be free form.@refill @item 6. End The @dfn{End} contains commands for printing indices and generating the table of contents, and the @code{@@bye} command on a line of its own.@refill @end table @node Short Sample @section A Short Sample Texinfo File @cindex Sample Texinfo file Here is a complete but very short Texinfo file, in six parts. The first three parts of the file, from @samp{\input texinfo} through to @samp{@@end titlepage}, look more intimidating than they are. Most of the material is standard boilerplate; when you write a manual, simply insert the names for your own manual in this segment. (@xref{Beginning a File}.)@refill 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}. @subheading Part 1: Header @noindent The header does not appear in either the Info file or the printed output. It sets various parameters, including the name of the Info file and the title used in the header. @example @group \input texinfo @@c -*-texinfo-*- @@c %**start of header @@setfilename sample.info @@settitle Sample Document @@setchapternewpage odd @@c %**end of header @end group @end example @subheading Part 2: Summary Description and Copyright @noindent The summary description and copyright segment does not appear in the printed document. @example @group @@ifinfo This is a short example of a complete Texinfo file. -Copyright @@copyright@{@} 1990 Free Software Foundation, Inc. +Copyright @@copyright@{@} 2002 Free Software Foundation, Inc. @@end ifinfo @end group @end example @subheading Part 3: Titlepage and Copyright @noindent The titlepage segment does not appear in the Info file. @example @group +@@contents @@titlepage @@sp 10 -@@comment The title is printed in a large font. -@@center @@titlefont@{Sample Title@} +@@title Sample Title @end group @group @@c The following two commands start the copyright page. @@page @@vskip 0pt plus 1filll -Copyright @@copyright@{@} 1990 Free Software Foundation, Inc. +Copyright @@copyright@{@} 2002 Free Software Foundation, Inc. @@end titlepage @end group @end example @subheading Part 4: `Top' Node and Master Menu @noindent The `Top' node contains the master menu for the Info file. Since a printed manual uses a table of contents rather than -a menu, the master menu appears only in the Info file. +a menu, the master menu appears only in online output. @example @group -@@node Top, First Chapter, , (dir) -@@comment node-name, next, previous, up +@@ifnottex +@@node Top +@@end ifnottex @end group @end example @example @group @@menu * First Chapter:: The first chapter is the only chapter in this sample. * Concept Index:: This index has two entries. @@end menu @end group @end example @subheading Part 5: The Body of the Document @noindent The body segment contains all the text of the document, but not the indices or table of contents. This example illustrates a node and a chapter containing an enumerated list.@refill @example @group -@@node First Chapter, Concept Index, Top, Top -@@comment node-name, next, previous, up +@@node First Chapter @@chapter First Chapter -@@cindex Sample index entry +@@cindex Chapter, first @end group @group This is the contents of the first chapter. @@cindex Another sample index entry @end group @group Here is a numbered list. @@enumerate @@item This is the first item. @@item This is the second item. @@end enumerate @end group @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 -manual. +The @@code@{makeinfo@} command transforms a Texinfo file +such as this into an Info file or other output; +@@TeX@ typesets it for a printed manual. @end group @end example @subheading Part 6: The End of the Document @noindent The end segment contains commands for generating an index in a node and unnumbered chapter of its own, (usually) for generating the table of contents, and the @code{@@bye} command that marks the end of the document.@refill @example @group -@@node Concept Index, , First Chapter, Top +@@node Concept Index @@unnumbered Concept Index @end group @group @@printindex cp -@@contents @@bye @end group @end example @subheading The Results 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. Here is a numbered list. @enumerate @item This is the first item. @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 manual. @end quotation -@node Acknowledgements and History -@section Acknowledgements and History +@node History +@section History @cindex Stallman, Richard M. @cindex Chassell, Robert J. @cindex Berry, Karl Richard M.@: Stallman invented the Texinfo format, wrote the initial processors, and created Edition 1.0 of this manual. @w{Robert J.@: Chassell} greatly revised and extended the manual, starting with Edition 1.1. Brian Fox was responsible for the standalone Texinfo distribution until version 3.8, and wrote the standalone @command{makeinfo} and @command{info}. Karl Berry has made the updates since Texinfo 3.8 and subsequent releases, starting with Edition 2.22 of the manual. @cindex Pinard, Fran@,{c}ois @cindex Zuhn, David D. @cindex Weisshaus, Melissa @cindex Zaretskii, Eli @cindex Schwab, Andreas @cindex Weinberg, Zack Our thanks go out to all who helped improve this work, particularly to Fran@,{c}ois Pinard and @w{David D.@: Zuhn}, who tirelessly recorded and reported mistakes and obscurities; our special thanks go to Melissa Weisshaus for her frequent and often tedious reviews of nearly similar editions. The indefatigable Eli Zaretskii and Andreas Schwab have provided patches beyond counting. Zack Weinberg did the impossible by implementing the macro syntax in @file{texinfo.tex}. Dozens of others have contributed patches and suggestions, they are gratefully acknowledged in the @file{ChangeLog} file. Our mistakes are our own. @cindex Scribe @cindex Reid, Brian @cindex History of Texinfo A bit of history: in the 1970's at CMU, Brian Reid developed a program and format named Scribe to mark up documents for printing. It used the @code{@@} character to introduce commands as Texinfo does and strived to describe document contents rather than formatting. @cindex Bolio @cindex Bo@TeX{} Meanwhile, people at MIT developed another, not too dissimilar format called Bolio. This then was converted to using @TeX{} as its typesetting language: Bo@TeX{}. Bo@TeX{} could only be used as a markup language for documents to be printed, not for online documents. Richard Stallman (RMS) worked on both Bolio and Bo@TeX{}. He also developed a nifty on-line help format called Info, and then combined Bo@TeX{} and Info to create Texinfo, a mark up language for text that is intended to be read both on line and as printed hard copy. @node Texinfo Mode @chapter Using Texinfo Mode @cindex Texinfo mode @cindex Mode, using Texinfo @cindex GNU Emacs @cindex Emacs You may edit a Texinfo file with any text editor you choose. A Texinfo file is no different from any other @sc{ascii} file. However, GNU Emacs comes with a special mode, called Texinfo mode, that provides Emacs commands and tools to help ease your work.@refill This chapter describes features of GNU Emacs' Texinfo mode but not any features of the Texinfo formatting language. If you are reading this manual straight through from the beginning, you may want to skim through this chapter briefly and come back to it after reading succeeding chapters which describe the Texinfo formatting language in detail.@refill @menu * 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. * 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. * Printing:: How to format and print part or all of a file. * Texinfo Mode Summary:: Summary of all the Texinfo mode commands. @end menu @node Texinfo Mode Overview, Emacs Editing, Texinfo Mode, Texinfo Mode @ifinfo @heading Texinfo Mode Overview @end ifinfo Texinfo mode provides special features for working with Texinfo files. You can:@refill @itemize @bullet @item Insert frequently used @@-commands. @refill @item Automatically create @code{@@node} lines. @item Show the structure of a Texinfo source file.@refill @item Automatically create or update the `Next', `Previous', and `Up' pointers of a node. @item Automatically create or update menus.@refill @item Automatically create a master menu.@refill @item Format a part or all of a file for Info.@refill @item Typeset and print part or all of a file.@refill @end itemize 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 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 and tools to GNU Emacs' general purpose editing features. The major difference concerns filling. In Texinfo mode, the paragraph separation variable and syntax table are redefined so that Texinfo commands that should be on lines of their own are not inadvertently included in paragraphs. Thus, the @kbd{M-q} (@code{fill-paragraph}) command will refill a paragraph but not mix an indexing command on a line adjacent to it into the paragraph.@refill In addition, Texinfo mode sets the @code{page-delimiter} variable to the value of @code{texinfo-chapter-level-regexp}; by default, this is a regular expression matching the commands for chapters and their equivalents, such as appendices. With this value for the page delimiter, you can jump from chapter title to chapter title with the @kbd{C-x ]} (@code{forward-page}) and @kbd{C-x [} (@code{backward-page}) commands and narrow to a chapter with the @kbd{C-x p} (@code{narrow-to-page}) command. (@xref{Pages, , ,emacs, The GNU Emacs Manual}, for details about the page commands.)@refill You may name a Texinfo file however you wish, but the convention is to end a Texinfo file name with one of the extensions @file{.texinfo}, @file{.texi}, @file{.txi}, or @file{.tex}. A longer extension is preferred, since it is explicit, but a shorter extension may be necessary for operating systems that limit the length of file names. GNU Emacs automatically enters Texinfo mode when you visit a file with a @file{.texinfo}, @file{.texi} or @file{.txi} extension. Also, Emacs switches to Texinfo mode when you visit a file that has @samp{-*-texinfo-*-} in its first line. If ever you are in another mode and wish to switch to Texinfo mode, type @code{M-x texinfo-mode}.@refill Like all other Emacs features, you can customize or enhance Texinfo mode as you wish. In particular, the keybindings are very easy to change. The keybindings described here are the default or standard ones.@refill @node Inserting, Showing the Structure, Emacs Editing, Texinfo Mode @comment node-name, next, previous, up @section Inserting Frequently Used Commands @cindex Inserting frequently used commands @cindex Frequently used commands, inserting @cindex Commands, inserting them Texinfo mode provides commands to insert various frequently used @@-commands into the buffer. You can use these commands to save keystrokes.@refill The insert commands are invoked by typing @kbd{C-c} twice and then the first letter of the @@-command:@refill @table @kbd @item C-c C-c c @itemx M-x texinfo-insert-@@code @findex texinfo-insert-@@code Insert @code{@@code@{@}} and put the cursor between the braces.@refill @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 @itemx M-x texinfo-insert-@@end @findex texinfo-insert-@@end Insert @code{@@end} and attempt to insert the correct following word, 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 @itemx M-x texinfo-insert-@@item @findex texinfo-insert-@@item Insert @code{@@item} and put the cursor at the beginning of the next line.@refill @item C-c C-c k @itemx M-x texinfo-insert-@@kbd @findex texinfo-insert-@@kbd Insert @code{@@kbd@{@}} and put the cursor between the braces.@refill @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', `Previous', and `Up' nodes. Leave point after the @code{@@node}.@refill @item C-c C-c o @itemx M-x texinfo-insert-@@noindent @findex texinfo-insert-@@noindent Insert @code{@@noindent} and put the cursor at the beginning of the next line.@refill @item C-c C-c s @itemx M-x texinfo-insert-@@samp @findex texinfo-insert-@@samp Insert @code{@@samp@{@}} and put the 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} and leave the cursor after the @key{SPC}.@refill @item C-c C-c v @itemx M-x texinfo-insert-@@var @findex texinfo-insert-@@var Insert @code{@@var@{@}} and put the cursor between the braces.@refill @item C-c C-c x @itemx M-x texinfo-insert-@@example @findex texinfo-insert-@@example 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 in Emacs 19, backward-paragraph will take this binding. @item C-c C-c @{ @itemx M-x texinfo-insert-braces @findex texinfo-insert-braces Insert @code{@{@}} and put the cursor between the braces.@refill @item C-c C-c @} @itemx C-c C-c ] @itemx M-x up-list @findex up-list Move from between a pair of braces forward past the closing brace. Typing @kbd{C-c C-c ]} is easier than typing @kbd{C-c C-c @}}, which is, however, more mnemonic; hence the two keybindings. (Also, you can move out from between braces by typing @kbd{C-f}.)@refill @end table To put a command such as @w{@code{@@code@{@dots{}@}}} around an @emph{existing} word, position the cursor in front of the word and type @kbd{C-u 1 C-c C-c c}. This makes it easy to edit existing plain text. The value of the prefix argument tells Emacs how many words following point to include between braces---@samp{1} for one word, @samp{2} for two words, and so on. Use a negative argument to enclose the previous word or words. If you do not specify a prefix argument, Emacs inserts the @@-command string and positions the cursor between the braces. This feature works only for those @@-commands that operate on a word or words within one line, such as @code{@@kbd} and @code{@@var}.@refill This set of insert commands was created after analyzing the frequency with which different @@-commands are used in the @cite{GNU Emacs Manual} and the @cite{GDB Manual}. If you wish to add your own insert commands, you can bind a keyboard macro to a key, use abbreviations, or extend the code in @file{texinfo.el}.@refill @findex texinfo-start-menu-description @cindex Menu description, start @cindex Description for menu, start @kbd{C-c C-c C-d} (@code{texinfo-start-menu-description}) is an insert command that works differently from the other insert commands. It inserts a node's section or chapter title in the space for the description in a menu entry line. (A menu entry has three parts, the entry name, the node name, and the description. Only the node name is required, but a description helps explain what the node is about. @xref{Menu Parts, , The Parts of a Menu}.)@refill To use @code{texinfo-start-menu-description}, position point in a menu entry line and type @kbd{C-c C-c C-d}. The command looks for and copies the title that goes with the node name, and inserts the title as a description; it positions point at beginning of the inserted text so you can edit it. The function does not insert the title if the menu entry line already contains a description.@refill This command is only an aid to writing descriptions; it does not do the whole job. You must edit the inserted text since a title tends to use the same words as a node name but a useful description uses different words.@refill @node Showing the Structure, Updating Nodes and Menus, Inserting, Texinfo Mode @comment node-name, next, previous, up @section Showing the Section Structure of a File @cindex Showing the section structure of a file @cindex Section structure of a file, showing it @cindex Structure of a file, showing it @cindex Outline of file structure, showing it @cindex Contents-like outline of file structure @cindex File section structure, showing it @cindex Texinfo file section structure, showing it You can show the section structure of a Texinfo file by using the @kbd{C-c C-s} command (@code{texinfo-show-structure}). This command shows the section structure of a Texinfo file by listing the lines that begin with the @@-commands for @code{@@chapter}, @code{@@section}, and the like. It constructs what amounts to a table of contents. These lines are displayed in another buffer called the @samp{*Occur*} buffer. In that buffer, you can position the cursor over one of the lines and use the @kbd{C-c C-c} command (@code{occur-mode-goto-occurrence}), to jump to the corresponding spot in the Texinfo file.@refill @table @kbd @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 Texinfo file.@refill @item C-c C-c @itemx M-x occur-mode-goto-occurrence @findex occur-mode-goto-occurrence Go to the line in the Texinfo file corresponding to the line under the cursor in the @file{*Occur*} buffer.@refill @end table If you call @code{texinfo-show-structure} with a prefix argument by typing @w{@kbd{C-u C-c C-s}}, it will list not only those lines with the @@-commands for @code{@@chapter}, @code{@@section}, and the like, but also the @code{@@node} lines. You can use @code{texinfo-show-structure} with a prefix argument to check whether the `Next', `Previous', and `Up' pointers of an @code{@@node} line are correct. Often, when you are working on a manual, you will be interested only in the structure of the current chapter. In this case, you can mark off the region of the buffer that you are interested in by using the @kbd{C-x n n} (@code{narrow-to-region}) command and @code{texinfo-show-structure} will work on only that region. To see 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 @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 the chapter-level @@-commands. This enables you to use the @kbd{C-x ]} (@code{forward-page}) and @kbd{C-x [} (@code{backward-page}) commands to move forward and backward by chapter, and to use the @kbd{C-x p} (@code{narrow-to-page}) command to narrow to a chapter. @xref{Pages, , , emacs, The GNU Emacs Manual}, for more information about the page commands.@refill @node Updating Nodes and Menus, Info Formatting, Showing the Structure, Texinfo Mode @comment node-name, next, previous, up @section Updating Nodes and Menus @cindex Updating nodes and menus @cindex Create nodes, menus automatically @cindex Insert nodes, menus automatically @cindex Automatically insert nodes, menus Texinfo mode provides commands for automatically creating or updating menus and node pointers. The commands are called ``update'' commands -because their most frequent use is for updating a Texinfo file after -you have worked on it; but you can use them to insert the `Next', -`Previous', and `Up' pointers into an @code{@@node} line that has none and to -create menus in a file that has none.@refill +because their most frequent use is for updating a Texinfo file after you +have worked on it; but you can use them to insert the `Next', +`Previous', and `Up' pointers into an @code{@@node} line that has none +and to create menus in a file that has none. If you do not use the updating commands, you need to write menus and node pointers by hand, which is a tedious task.@refill @menu * Updating Commands:: Five major updating commands. * Updating Requirements:: How to structure a Texinfo file for using the updating command. * Other Updating Commands:: How to indent descriptions, insert missing nodes lines, and update nodes in sequence. @end menu @node Updating Commands, Updating Requirements, Updating Nodes and Menus, Updating Nodes and Menus @ifinfo @subheading The Updating Commands @end ifinfo You can use the updating commands to:@refill @itemize @bullet @item insert or update the `Next', `Previous', and `Up' pointers of a node,@refill @item insert or update the menu for a section, and@refill @item create a master menu for a Texinfo source file.@refill @end itemize You can also use the commands to update all the nodes and menus in a region or in a whole Texinfo file.@refill The updating commands work only with conventional Texinfo files, which are structured hierarchically like books. In such files, a structuring command line must follow closely after each @code{@@node} line, except for the `Top' @code{@@node} line. (A @dfn{structuring command line} is a line beginning with @code{@@chapter}, @code{@@section}, or other similar command.) You can write the structuring command line on the line that follows immediately after an @code{@@node} line or else on the line that follows after a single @code{@@comment} line or a single @code{@@ifinfo} line. You cannot interpose more than one line between the @code{@@node} line and the structuring command line; and you may interpose only an @code{@@comment} line or an @code{@@ifinfo} line. Commands which work on a whole buffer require that the `Top' node be followed by a node with an @code{@@chapter} or equivalent-level command. The menu updating commands will not create a main or master menu for a Texinfo file that has only @code{@@chapter}-level nodes! The menu updating commands only create menus @emph{within} nodes for lower level nodes. To create a menu of chapters, you must provide a `Top' node. The menu updating commands remove menu entries that refer to other Info files since they do not refer to nodes within the current buffer. This is a deficiency. Rather than use menu entries, you can use cross references to refer to other Info files. None of the updating commands affect cross references.@refill Texinfo mode has five updating commands that are used most often: two are for updating the node pointers or menu of a single node (or a region); two are for updating every node pointer and menu in a file; and one, the @code{texinfo-master-menu} command, is for creating a master menu for a complete file, and optionally, for updating every node and menu in the whole Texinfo file.@refill The @code{texinfo-master-menu} command is the primary command:@refill @table @kbd @item C-c C-u m @itemx M-x texinfo-master-menu @findex texinfo-master-menu Create or update a master menu that includes all the other menus (incorporating the descriptions from pre-existing menus, if any).@refill With an argument (prefix argument, @kbd{C-u,} if interactive), first create or update all the nodes and all the regular menus in the buffer before constructing the master menu. (@xref{The Top Node, , The Top Node and Master Menu}, for more about a master menu.)@refill For @code{texinfo-master-menu} to work, the Texinfo file must have a `Top' node and at least one subsequent node.@refill After extensively editing a Texinfo file, you can type the following: @example C-u M-x texinfo-master-menu @exdent or C-u C-c C-u m @end example @noindent This updates all the nodes and menus completely and all at once.@refill @end table The other major updating commands do smaller jobs and are designed for the person who updates nodes and menus as he or she writes a Texinfo file.@refill @need 1000 The commands are:@refill @table @kbd @item C-c C-u C-n @itemx M-x texinfo-update-node @findex texinfo-update-node Insert the `Next', `Previous', and `Up' pointers for the node that point is within (i.e., for the @code{@@node} line preceding point). If the @code{@@node} line has pre-existing `Next', `Previous', or `Up' pointers in it, the old pointers are removed and new ones inserted. With an argument (prefix argument, @kbd{C-u}, if interactive), this command updates all @code{@@node} lines in the region (which is the text between point and mark).@refill @item C-c C-u C-m @itemx M-x texinfo-make-menu @findex texinfo-make-menu Create or update the menu in the node that point is within. With an argument (@kbd{C-u} as prefix argument, if interactive), the command makes or updates menus for the nodes which are either within or a part of the region.@refill Whenever @code{texinfo-make-menu} updates an existing menu, 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.@refill @item C-c C-u C-e @itemx M-x texinfo-every-node-update @findex texinfo-every-node-update Insert or update the `Next', `Previous', and `Up' pointers for every node in the buffer.@refill @item C-c C-u C-a @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 or update all the node pointers before working on the menus.@refill If a master menu exists, the @code{texinfo-all-menus-update} command updates it; but the command does not create a new master menu if none already exists. (Use the @code{texinfo-master-menu} command for that.)@refill When working on a document that does not merit a master menu, you can type the following: @example C-u C-c C-u C-a @exdent or C-u M-x texinfo-all-menus-update @end example @noindent This updates all the nodes and menus.@refill @end table The @code{texinfo-column-for-description} variable specifies the column to which menu descriptions are indented. By default, the value is 32 although it is often useful to reduce it to as low as 24. You can set the variable with the @kbd{M-x edit-options} command (@pxref{Edit Options, , Editing Variable Values, emacs, The GNU Emacs Manual}) or with the @kbd{M-x set-variable} command (@pxref{Examining, , Examining and Setting Variables, emacs, The GNU Emacs Manual}).@refill Also, the @code{texinfo-indent-menu-description} command may be used to indent existing menu descriptions to a specified column. Finally, if you wish, you can use the @code{texinfo-insert-node-lines} command to insert missing @code{@@node} lines into a file. (@xref{Other Updating Commands}, for more information.)@refill @node Updating Requirements, Other Updating Commands, Updating Commands, Updating Nodes and Menus @comment node-name, next, previous, up @subsection Updating Requirements @cindex Updating requirements @cindex Requirements for updating commands To use the updating commands, you must organize the Texinfo file 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 section, but not with a subsection. However, you may `jump up' any number of levels at one time---for example, from a subsection to a chapter.@refill Each @code{@@node} line, with the exception of the line for the `Top' node, must be followed by a line with a structuring command such as @code{@@chapter}, @code{@@section}, or @code{@@unnumberedsubsec}.@refill Each @code{@@node} line/structuring-command line combination must look either like this:@refill @example @group @@node Comments, Minimum, Conventions, Overview @@comment node-name, next, previous, up @@section Comments @end group @end example or like this (without the @code{@@comment} line): @example @group @@node Comments, Minimum, Conventions, Overview @@section Comments @end group @end example @noindent In this example, `Comments' is the name of both the node and the section. The next node is called `Minimum' and the previous node is called `Conventions'. The `Comments' section is within the `Overview' node, which is specified by the `Up' pointer. (Instead of an @code{@@comment} line, you may also write an @code{@@ifinfo} line.)@refill If a file has a `Top' node, it must be called @samp{top} or @samp{Top} and be the first node in the file.@refill The menu updating commands create a menu of sections within a chapter, a menu of subsections within a section, and so on. This means that you must have a `Top' node if you want a menu of chapters.@refill Incidentally, the @code{makeinfo} command will create an Info file for a hierarchically organized Texinfo file that lacks `Next', `Previous' and `Up' pointers. Thus, if you can be sure that your Texinfo file will be formatted with @code{makeinfo}, you have no need for the update node commands. (@xref{Creating an Info File}, for more information about @code{makeinfo}.) However, both @code{makeinfo} and the @code{texinfo-format-@dots{}} commands require that you insert menus in the file. @node Other Updating Commands, , Updating Requirements, Updating Nodes and Menus @comment node-name, next, previous, up @subsection Other Updating Commands In addition to the five major updating commands, Texinfo mode possesses several less frequently used updating commands:@refill @table @kbd @item M-x texinfo-insert-node-lines @findex texinfo-insert-node-lines Insert @code{@@node} lines before the @code{@@chapter}, @code{@@section}, and other sectioning commands wherever they are missing throughout a region in a Texinfo file.@refill With an argument (@kbd{C-u} as prefix argument, if interactive), the @code{texinfo-insert-node-lines} command not only inserts @code{@@node} lines but also inserts the chapter or section titles as the names of the corresponding nodes. In addition, it inserts the titles as node names in pre-existing @code{@@node} lines that lack names. Since node names should be more concise than section or chapter titles, you must manually edit node names so inserted.@refill For example, the following marks a whole buffer as a region and inserts @code{@@node} lines and titles throughout:@refill @example C-x h C-u M-x texinfo-insert-node-lines @end example This command inserts titles as node names in @code{@@node} lines; the @code{texinfo-start-menu-description} command (@pxref{Inserting, Inserting Frequently Used Commands}) inserts titles as descriptions in menu entries, a different action. However, in both cases, you need to edit the inserted text. @item M-x texinfo-multiple-files-update @findex texinfo-multiple-files-update @r{(in brief)} Update nodes and menus in a document built from several separate files. With @kbd{C-u} as a prefix argument, create and insert a master menu in the outer file. With a numeric prefix argument, such as @kbd{C-u 2}, first update all the menus and all the `Next', `Previous', and `Up' pointers of all the included files before creating and inserting a master menu in the outer file. The @code{texinfo-multiple-files-update} command is described in the appendix on @code{@@include} files. @ifinfo @xref{texinfo-multiple-files-update}.@refill @end ifinfo @iftex @xref{texinfo-multiple-files-update, , @code{texinfo-multiple-files-update}}.@refill @end iftex @item M-x texinfo-indent-menu-description @findex texinfo-indent-menu-description Indent every description in the menu following point to the specified column. You can use this command to give yourself more space for descriptions. With an argument (@kbd{C-u} as prefix argument, if interactive), the @code{texinfo-indent-menu-description} command indents every description in every menu in the region. However, this command does not indent the second and subsequent lines of a multi-line description.@refill @item M-x texinfo-sequential-node-update @findex texinfo-sequential-node-update Insert the names of the nodes immediately following and preceding the current node as the `Next' or `Previous' pointers regardless of those nodes' hierarchical level. This means that the `Next' node of a subsection may well be the next chapter. Sequentially ordered nodes are useful for novels and other documents that you read through sequentially. (However, in Info, the @kbd{g *} command lets you look through the file sequentially, so sequentially ordered nodes are not strictly necessary.) With an argument (prefix argument, if interactive), the @code{texinfo-sequential-node-update} command sequentially updates all the nodes in the region.@refill @end table @node Info Formatting, Printing, Updating Nodes and Menus, Texinfo Mode @comment node-name, next, previous, up @section Formatting for Info @cindex Formatting for Info @cindex Running an Info formatter @cindex Info formatting Texinfo mode provides several commands for formatting part or all of a Texinfo file for Info. Often, when you are writing a document, you want to format only part of a file---that is, a region.@refill You can use either the @code{texinfo-format-region} or the @code{makeinfo-region} command to format a region:@refill @table @kbd @findex texinfo-format-region @item C-c C-e C-r @itemx M-x texinfo-format-region @itemx C-c C-m C-r @itemx M-x makeinfo-region Format the current region for Info.@refill @end table You can use either the @code{texinfo-format-buffer} or the @code{makeinfo-buffer} command to format a whole buffer:@refill @table @kbd @findex texinfo-format-buffer @item C-c C-e C-b @itemx M-x texinfo-format-buffer @itemx C-c C-m C-b @itemx M-x makeinfo-buffer Format the current buffer for Info.@refill @end table @need 1000 For example, after writing a Texinfo file, you can type the following: @example C-u C-c C-u m @exdent or C-u M-x texinfo-master-menu @end example @noindent This updates all the nodes and menus. Then type the following to create an Info file: @example C-c C-m C-b @exdent or M-x makeinfo-buffer @end example 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{Creating an Info File}, for details about Info formatting.@refill @node Printing, Texinfo Mode Summary, Info Formatting, Texinfo Mode @comment node-name, next, previous, up @section Formatting and Printing @cindex Formatting for printing @cindex Printing a region or buffer @cindex Region formatting and printing @cindex Buffer formatting and printing @cindex Part of file formatting and printing Typesetting and printing a Texinfo file is a multi-step process in which you first create a file for printing (called a DVI file), and then print the file. Optionally, you may also create indices. To do this, you must run the @code{texindex} command after first running the @code{tex} typesetting command; and then you must run the @code{tex} command again. Or else run the @code{texi2dvi} command which automatically creates indices as needed (@pxref{Format with texi2dvi}). Often, when you are writing a document, you want to typeset and print only part of a file to see what it will look like. You can use the @code{texinfo-tex-region} and related commands for this purpose. Use the @code{texinfo-tex-buffer} command to format all of a buffer.@refill @table @kbd @item C-c C-t C-b @itemx M-x texinfo-tex-buffer @findex texinfo-tex-buffer Run @code{texi2dvi} on the buffer. In addition to running @TeX{} on the buffer, this command automatically creates or updates indices as needed.@refill @item C-c C-t C-r @itemx M-x texinfo-tex-region @findex texinfo-tex-region Run @TeX{} on the region.@refill @item C-c C-t C-i @itemx M-x texinfo-texindex Run @code{texindex} to sort the indices of a Texinfo file formatted with @code{texinfo-tex-region}. The @code{texinfo-tex-region} command does not run @code{texindex} automatically; it only runs the @code{tex} typesetting command. You must run the @code{texinfo-tex-region} command a second time after sorting the raw index files with the @code{texindex} command. (Usually, you do not format an index when you format a region, only when you format a buffer. Now that the @code{texi2dvi} command exists, there is little or no need for this command.)@refill @item C-c C-t C-p @itemx M-x texinfo-tex-print @findex texinfo-tex-print Print the file (or the part of the file) previously formatted with @code{texinfo-tex-buffer} or @code{texinfo-tex-region}.@refill @end table For @code{texinfo-tex-region} or @code{texinfo-tex-buffer} to work, the file @emph{must} start with a @samp{\input texinfo} line and must include an @code{@@settitle} line. The file must end with @code{@@bye} on a line by itself. (When you use @code{texinfo-tex-region}, you must surround the @code{@@settitle} line with start-of-header and end-of-header lines.)@refill @xref{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 @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 mnemonic.@refill @subheading Insert Commands The insert commands are invoked by typing @kbd{C-c} twice and then the first letter of the @@-command to be inserted. (It might make more sense mnemonically to use @kbd{C-c C-i}, for `custom insert', but @kbd{C-c C-c} is quick to type.)@refill @example C-c C-c c @r{Insert} @samp{@@code}. C-c C-c d @r{Insert} @samp{@@dfn}. C-c C-c e @r{Insert} @samp{@@end}. C-c C-c i @r{Insert} @samp{@@item}. C-c C-c n @r{Insert} @samp{@@node}. C-c C-c s @r{Insert} @samp{@@samp}. C-c C-c v @r{Insert} @samp{@@var}. C-c C-c @{ @r{Insert braces.} C-c C-c ] C-c C-c @} @r{Move out of enclosing braces.} @group C-c C-c C-d @r{Insert a node's section title} @r{in the space for the description} @r{in a menu entry line.} @end group @end example @subheading Show Structure The @code{texinfo-show-structure} command is often used within a narrowed region.@refill @example C-c C-s @r{List all the headings.} @end example @subheading The Master Update Command The @code{texinfo-master-menu} command creates a master menu; and can be used to update every node and menu in a file as well.@refill @c Probably should use @tables in this section. @example @group C-c C-u m M-x texinfo-master-menu @r{Create or update a master menu.} @end group @group C-u C-c C-u m @r{With @kbd{C-u} as a prefix argument, first} @r{create or update all nodes and regular} @r{menus, and then create a master menu.} @end group @end example @subheading Update Pointers The update pointer commands are invoked by typing @kbd{C-c C-u} and then either @kbd{C-n} for @code{texinfo-update-node} or @kbd{C-e} for @code{texinfo-every-node-update}.@refill @example C-c C-u C-n @r{Update a node.} C-c C-u C-e @r{Update every node in the buffer.} @end example @subheading Update Menus Invoke the update menu commands by typing @kbd{C-c C-u} and then either @kbd{C-m} for @code{texinfo-make-menu} or @kbd{C-a} for @code{texinfo-all-menus-update}. To update both nodes and menus at the same time, precede @kbd{C-c C-u C-a} with @kbd{C-u}.@refill @example 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.} @end group @group C-u C-c C-u C-a @r{With @kbd{C-u} as a prefix argument,} @r{first create or update all nodes and} @r{then create or update all menus.} @end group @end example @subheading Format for Info The Info formatting commands that are written in Emacs Lisp are invoked by typing @kbd{C-c C-e} and then either @kbd{C-r} for a region or @kbd{C-b} for the whole buffer.@refill The Info formatting commands that are written in C and based on the @code{makeinfo} program are invoked by typing @kbd{C-c C-m} and then either @kbd{C-r} for a region or @kbd{C-b} for the whole buffer.@refill @need 800 @noindent Use the @code{texinfo-format@dots{}} commands: @example @group C-c C-e C-r @r{Format the region.} C-c C-e C-b @r{Format the buffer.} @end group @end example @need 750 @noindent Use @code{makeinfo}: @example C-c C-m C-r @r{Format the region.} C-c C-m C-b @r{Format the buffer.} C-c C-m C-l @r{Recenter the @code{makeinfo} output buffer.} C-c C-m C-k @r{Kill the @code{makeinfo} formatting job.} @end example @subheading Typeset and Print The @TeX{} typesetting and printing commands are invoked by typing @kbd{C-c C-t} and then another control command: @kbd{C-r} for @code{texinfo-tex-region}, @kbd{C-b} for @code{texinfo-tex-buffer}, and so on.@refill @example C-c C-t C-r @r{Run @TeX{} on the region.} C-c C-t C-b @r{Run} @code{texi2dvi} @r{on the buffer.} C-c C-t C-i @r{Run} @code{texindex}. C-c C-t C-p @r{Print the DVI file.} C-c C-t C-q @r{Show the print queue.} C-c C-t C-d @r{Delete a job from the print queue.} C-c C-t C-k @r{Kill the current @TeX{} formatting job.} C-c C-t C-x @r{Quit a currently stopped @TeX{} formatting job.} C-c C-t C-l @r{Recenter the output buffer.} @end example @subheading Other Updating Commands The remaining updating commands do not have standard keybindings because they are rarely used. @example @group M-x texinfo-insert-node-lines @r{Insert missing @code{@@node} lines in region.} @r{With @kbd{C-u} as a prefix argument,} @r{use section titles as node names.} @end group @group M-x texinfo-multiple-files-update @r{Update a multi-file document.} @r{With @kbd{C-u 2} as a prefix argument,} @r{create or update all nodes and menus} @r{in all included files first.} @end group @group M-x texinfo-indent-menu-description @r{Indent descriptions.} @end group @group M-x texinfo-sequential-node-update @r{Insert node pointers in strict sequence.} @end group @end example -@node Beginning a File, Ending a File, Texinfo Mode, Top -@comment node-name, next, previous, up +@node Beginning a File @chapter Beginning a Texinfo File @cindex Beginning a Texinfo file @cindex Texinfo file beginning @cindex File beginning Certain pieces of information must be provided at the beginning of a Texinfo file, such as the name of the file and the title of the document.@refill @menu * Four Parts:: Four parts begin a Texinfo file. * Sample Beginning:: Here is a sample beginning for a Texinfo file. * Header:: The very beginning of a Texinfo file. * Info Summary and Permissions:: Summary and copying permissions for Info. * Titlepage & Copyright Page:: Creating the title and copyright pages. * The Top Node:: Creating the `Top' node and master menu. * Software Copying Permissions:: Ensure that you and others continue to have the right to use and share software. @end menu @node Four Parts, Sample Beginning, Beginning a File, Beginning a File @ifinfo @heading Four Parts Begin a File @end ifinfo Generally, the beginning of a Texinfo file has four parts:@refill @enumerate @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 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 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 only in the printed @w{manual}.@refill @item The `Top' node that contains a menu for the whole Info file. The contents of this node appear only in the Info file.@refill @end enumerate Also, optionally, you may include the copying conditions for a program and a warranty disclaimer. The copying section will be followed by an introduction or else by the first chapter of the manual.@refill Since the copyright notice and copying permissions for the Texinfo document (in contrast to the copying permissions for a program) are in parts that appear only in the Info file or only in the printed manual, this information must be given twice.@refill -@node Sample Beginning, Header, Four Parts, Beginning a File -@comment node-name, next, previous, up + +@node Sample Beginning @section Sample Texinfo File Beginning The following sample shows what is needed.@refill @example \input texinfo @@c -*-texinfo-*- @@c %**start of header @@setfilename @var{name-of-info-file} @@settitle @var{name-of-manual} @@setchapternewpage odd @@c %**end of header @@ifinfo This file documents @dots{} Copyright @var{year} @var{copyright-owner} @group Permission is granted to @dots{} @@end ifinfo @end group @group @@c This title page illustrates only one of the @@c two methods of forming a title page. @end group @group @@titlepage @@title @var{name-of-manual-when-printed} @@subtitle @var{subtitle-if-any} @@subtitle @var{second-subtitle} @@author @var{author} @end group @group @@c The following two commands @@c start the copyright page. @@page @@vskip 0pt plus 1filll Copyright @@copyright@{@} @var{year} @var{copyright-owner} @end group Published by @dots{} Permission is granted to @dots{} @@end titlepage -@@node Top, Overview, , (dir) +@@ifnottex +@@node Top +@@top @var{title} -@@ifinfo This document describes @dots{} This document applies to version @dots{} of the program named @dots{} -@@end ifinfo +@@end ifnottex @group @@menu * Copying:: Your rights and freedoms. * First Chapter:: Getting started @dots{} * Second Chapter:: @dots{} @dots{} @dots{} @@end menu @end group @group -@@node First Chapter, Second Chapter, top, top -@@comment node-name, next, previous, up +@@node First Chapter @@chapter First Chapter @@cindex Index entry for First Chapter @end group @end example -@node Header, Info Summary and Permissions, Sample Beginning, Beginning a File -@comment node-name, next, previous, up + +@node Header @section The Texinfo File Header @cindex Header for Texinfo files @cindex Texinfo file header Texinfo files start with at least three lines that provide Info and -@TeX{} with necessary information. These are the @code{\input -texinfo} line, the @code{@@settitle} line, and the -@code{@@setfilename} line. If you want to run @TeX{} on just a part -of the Texinfo File, you must write the @code{@@settitle} -and @code{@@setfilename} lines between start-of-header and end-of-header -lines.@refill +@TeX{} with necessary information. These are the @code{\input texinfo} +line, the @code{@@settitle} line, and the @code{@@setfilename} line. If +you want to run @TeX{} on just a part of the Texinfo file, you must +write the @code{@@settitle} and @code{@@setfilename} lines between +start-of-header and end-of-header lines. Thus, the beginning of a Texinfo file looks like this: @example @group \input texinfo @@c -*-texinfo-*- @@setfilename sample.info @@settitle Sample Document @end group @end example @noindent or else like this: @example @group \input texinfo @@c -*-texinfo-*- @@c %**start of header @@setfilename sample.info @@settitle Sample Document @@c %**end of header @end group @end example @menu * 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. +* documentdescription:: Document summary for the HTML output. * setchapternewpage:: Start chapters on right-hand pages. * paragraphindent:: Specify paragraph indentation. * exampleindent:: Specify environment indentation. * End of Header:: Formatting a region requires this. @end menu @node First Line @subsection The First Line of a Texinfo File @cindex First line of a Texinfo file @cindex Beginning line of a Texinfo file @cindex Header of a Texinfo file Every Texinfo file that is to be the top-level input to @TeX{} must begin with a line that looks like this:@refill @example \input texinfo @@c -*-texinfo-*- @end example @noindent This line serves two functions: @enumerate @item When the file is processed by @TeX{}, the @samp{\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 in the @file{/usr/lib/tex/macros} directory. @TeX{} uses the backslash, @samp{\}, to mark the beginning of a command, just as Texinfo uses @samp{@@}. The @file{texinfo.tex} file causes the switch from @samp{\} to @samp{@@}; before the switch occurs, @TeX{} requires @samp{\}, which is why it appears at the beginning of the file.@refill @item When the file is edited in GNU Emacs, the @samp{-*-texinfo-*-} mode specification tells Emacs to use Texinfo mode.@refill @end enumerate -@node Start of Header, setfilename, First Line, Header -@comment node-name, next, previous, up + +@node Start of Header @subsection Start of Header @cindex Start of header line Write a start-of-header line on the second line of a Texinfo file. Follow the start-of-header line with @code{@@setfilename} and @code{@@settitle} lines and, optionally, with other command lines, such as @code{@@smallbook} or @code{@@footnotestyle}; and then by an end-of-header line (@pxref{End of Header}).@refill With these lines, you can format part of a Texinfo file for Info or typeset part for printing.@refill A start-of-header line looks like this:@refill @example @@c %**start of header @end example The odd string of characters, @samp{%**}, is to ensure that no other comment is accidentally taken for a start-of-header line.@refill @node setfilename @subsection @code{@@setfilename} @cindex Info file requires @code{@@setfilename} @findex setfilename 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} @end example Write the @code{@@setfilename} command at the beginning of a line and follow it on the same line by the Info file name. Do not write anything else on the line; anything on the line after the command is considered part of the file name, including what would otherwise be a comment. The @code{@@setfilename} line specifies the name of the output file to be generated. This name should be different from the name of the Texinfo file. There are two conventions for choosing the name: you can either remove the extension (such as @samp{.texi}) from the input file name, or replace it with the @samp{.info} extension. When producing HTML output, @code{makeinfo} will replace any extension with @samp{html}, or add @samp{.html} if the given name has no extension. Some operating systems cannot handle long file names. You can run into a problem even when the file name you specify is itself short enough. This occurs because the Info formatters split a long Info file into short indirect subfiles, and name them by appending @samp{-1}, @samp{-2}, @dots{}, @samp{-10}, @samp{-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 @file{texinfo} rather than @file{texinfo.info}. When @code{makeinfo} is running on operating systems such as MS-DOS which impose grave limits on file names, it will sometimes remove some characters from the original file name to leave enough space for the subfile suffix, thus producing files named @file{texin-10}, @file{gcc.i12}, etc. @cindex Ignored before @code{@@setfilename} @cindex @samp{\input} source line ignored The Info formatting commands ignore everything written before the @code{@@setfilename} line, which is why the very first line of the file (the @code{\input} line) does not show up in the output. @pindex texinfo.cnf The @code{@@setfilename} line produces no output when you typeset a manual with @TeX{}, but it is nevertheless essential: it opens the index, cross-reference, and other auxiliary files used by Texinfo, and also reads @file{texinfo.cnf} if that file is present on your system (@pxref{Preparing for TeX,, Preparing for @TeX{}}). -@node settitle, setchapternewpage, setfilename, Header -@comment node-name, next, previous, up -@subsection @code{@@settitle} +@node settitle +@subsection @code{@@settitle}: Set the document title @findex settitle In order to be made into a printed manual, a Texinfo file must contain -a line that looks like this:@refill +a line that looks like this: @example @@settitle @var{title} @end example +In the HTML file produced by @command{makeinfo}, @var{title} serves as +the default document description in the @samp{<head>} part; see +@ref{documentdescription}, for how to change that. + Write the @code{@@settitle} command at the beginning of a line and follow it on the same line by the title. This tells @TeX{} the title to use in a header or footer. Do not write anything else on the line; anything on the line after the command is considered part of the title, including a comment.@refill Conventionally, when @TeX{} formats a Texinfo file for double-sided output, the title is printed in the left-hand (even-numbered) page headings and the current chapter title is printed in the right-hand (odd-numbered) page headings. (@TeX{} learns the title of each chapter from each @code{@@chapter} command.) Page footers are not printed.@refill Even if you are printing in a single-sided style, @TeX{} looks for an @code{@@settitle} command line, in case you include the manual title in the heading. @refill The @code{@@settitle} command should precede everything that generates actual output in @TeX{}.@refill Although the title in the @code{@@settitle} command is usually the same as the title on the title page, it does not affect the title as it appears on the title page. Thus, the two do not need not match exactly; and the title in the @code{@@settitle} command can be a shortened or expanded version of the title as it appears on the title page. (@xref{titlepage, , @code{@@titlepage}}.)@refill @TeX{} prints page headings only for that text that comes after the @code{@@end titlepage} command in the Texinfo file, or that comes after an @code{@@headings} command that turns on headings. (@xref{headings on off, , The @code{@@headings} Command}, for more information.)@refill You may, if you wish, create your own, customized headings and footings. @xref{Headings, , Page Headings}, for a detailed discussion of this process.@refill +@node documentdescription +@subsection @code{@@documentdescription}: Summary text +@cindex Document description +@cindex Description of document +@cindex Summary of document +@cindex <meta> HTML tag, and document description + +When producing HTML output for a document, @command{makeinfo} writes a +@samp{<meta>} element in the @samp{<head>} to give some idea of the +content of the document. By default, this @dfn{description} is the title +of the document, taken from the @code{@@settitle} command +(@pxref{settitle}). To change this, use the @code{@@documentdescription} +environment, as in: + +@example +@@documentdescription +descriptive text +@@end documendescription +@end example + +@noindent +This will produce the following output in the @samp{<head>} of the HTML: + +@example +<meta name=description content="descriptive text"> +@end example + +@code{@@documentdescription} must be specified before the first node of +the document. + + +@findex documentdescription @node setchapternewpage -@subsection @code{@@setchapternewpage} +@subsection @code{@@setchapternewpage}: @cindex Starting chapters @cindex Pages, starting odd @findex setchapternewpage In an officially bound book, text is usually printed on both sides of the paper, chapters start on right-hand pages, and right-hand pages have odd numbers. But in short reports, text often is printed only on one side of the paper. Also in short reports, chapters sometimes do not start on new pages, but are printed on the same page as the end of the -preceding chapter, after a small amount of vertical whitespace.@refill +preceding chapter, after a small amount of vertical whitespace. You can use the @code{@@setchapternewpage} command with various arguments to specify how @TeX{} should start chapters and whether it should format headers for printing on one or both sides of the paper -(single-sided or double-sided printing).@refill +(single-sided or double-sided printing). Write the @code{@@setchapternewpage} command at the beginning of a -line followed by its argument.@refill +line followed by its argument. For example, you would write the following to cause each chapter to -start on a fresh odd-numbered page:@refill +start on a fresh odd-numbered page: @example @@setchapternewpage odd @end example You can specify one of three alternatives with the -@code{@@setchapternewpage} command:@refill +@code{@@setchapternewpage} command: @table @asis @item @code{@@setchapternewpage off} Cause @TeX{} to typeset a new chapter on the same page as the last chapter, after skipping some vertical whitespace. Also, cause @TeX{} to -format page headers 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 +format page headers for single-sided printing. @item @code{@@setchapternewpage on} Cause @TeX{} to start new chapters on new pages and to format page -headers for single-sided printing. This is the form most often -used for short reports or personal printing. - -This alternative is the default.@refill +headers for single-sided printing. This is the form most often used for +short reports or personal printing. This is the default. @item @code{@@setchapternewpage odd} Cause @TeX{} to start new chapters on new, odd-numbered pages (right-handed pages) and to typeset for double-sided printing. This is -the form most often used for books and manuals.@refill +the form most often used for books and manuals. @end table -Texinfo does not have an @code{@@setchapternewpage even} command.@refill +Texinfo does not have an @code{@@setchapternewpage even} command, +because there is no printing tradition of starting chapters or books on +an even-numbered page. -You can countermand or modify the effect on headers of an -@code{@@setchapternewpage} command with an @code{@@headings} command. -@xref{headings on off, , The @code{@@headings} Command}.@refill +If you don't like the default headers that @code{@@setchapternewpage} +sets, you can explicit control them with the @code{@@headings} command. +@xref{headings on off, , The @code{@@headings} Command}. At the beginning of a manual or book, pages are not numbered---for -example, the title and copyright pages of a book are not numbered. -By convention, table of contents pages are numbered with roman -numerals and not in sequence with the rest of the document.@refill +example, the title and copyright pages of a book are not numbered. By +convention, table of contents and frontmatter pages are numbered with +roman numerals and not in sequence with the rest of the document. Since an Info file does not have pages, the @code{@@setchapternewpage} -command has no effect on it.@refill +command has no effect on it. We recommend not including any @code{@@setchapternewpage} command in your manual sources at all, since the desired output is not intrinsic to the document. Instead, if you don't want the default option (no blank pages, same headers on all pages) use the @option{--texinfo} option to @command{texi2dvi} to specify the output you want. @node paragraphindent @subsection Paragraph Indenting @cindex Indenting paragraphs @cindex Paragraph indentation @findex paragraphindent The Texinfo processors may insert whitespace at the beginning of the first line of each paragraph, thereby indenting that paragraph. You can use the @code{@@paragraphindent} command to specify this indentation. Write an @code{@@paragraphindent} command at the beginning of a line followed by either @samp{asis} or a number: @example @@paragraphindent @var{indent} @end example The indentation is according to the value of @var{indent}: @table @asis @item @code{asis} Do not change the existing indentation (not implemented in @TeX{}). @item 0 Omit all indentation. @item @var{n} Indent by @var{n} space characters in Info output, by @var{n} ems in @TeX{}. @end table The default value of @var{indent} is @samp{asis}. @code{@@paragraphindent} is ignored for HTML output. Write the @code{@@paragraphindent} command before or shortly after the end-of-header line at the beginning of a Texinfo file. (If you write the command between the start-of-header and end-of-header lines, the region formatting commands indent paragraphs as specified.) A peculiarity of the @code{texinfo-format-buffer} and @code{texinfo-format-region} commands is that they do not indent (nor fill) paragraphs that contain @code{@@w} or @code{@@*} commands. @xref{Refilling Paragraphs}, for further information. @node exampleindent @subsection @code{@@exampleindent}: Environment Indenting @cindex Indenting environments @cindex Environment indentation @cindex Example indentation @findex exampleindent The Texinfo processors indent each line of @code{@@example} and similar environments. You can use the @code{@@exampleindent} command to specify this indentation. Write an @code{@@exampleindent} command at the beginning of a line followed by either @samp{asis} or a number: @example @@exampleindent @var{indent} @end example The indentation is according to the value of @var{indent}: @table @asis @item @code{asis} Do not change the existing indentation (not implemented in @TeX{}). @item 0 Omit all indentation. @item @var{n} Indent environments by @var{n} space characters in Info output, by @var{n} ems in @TeX{}. @end table The default value of @var{indent} is 5. @code{@@exampleindent} is ignored for HTML output. Write the @code{@@exampleindent} command before or shortly after the end-of-header line at the beginning of a Texinfo file. (If you write the command between the start-of-header and end-of-header lines, the region formatting commands indent examples as specified.) @node End of Header @subsection End of Header @cindex End of header line Follow the header lines with an @w{end-of-header} line. An end-of-header line looks like this:@refill @example @@c %**end of header @end example If you include the @code{@@setchapternewpage} command between the start-of-header and end-of-header lines, @TeX{} will typeset a region as that command specifies. Similarly, if you include an @code{@@smallbook} command between the start-of-header and end-of-header lines, @TeX{} will typeset a region in the ``small'' book format.@refill @ifinfo The reason for the odd string of characters (@samp{%**}) is so that the @code{texinfo-tex-region} command does not accidentally find something that it should not when it is looking for the header.@refill The start-of-header line and the end-of-header line are Texinfo mode variables that you can change.@refill @end ifinfo @iftex @xref{Start of Header}. @end iftex @node Info Summary and Permissions @section Summary and Copying Permissions for Info The title page and the copyright page appear only in the printed copy of the manual; therefore, the same information must be inserted in a section that appears only in the Info file. This section usually contains a brief description of the contents of the Info file, a copyright notice, and copying permissions.@refill -The copyright notice should read:@refill +The copyright notice should read: @example Copyright @var{year} @var{copyright-owner} @end example @noindent -and be put on a line by itself.@refill +and be put on a line by itself. -Standard text for the copyright permissions is contained in an appendix -to this manual; see @ref{ifinfo Permissions, , @samp{ifinfo} Copying -Permissions}, for the complete text.@refill +Standard text for the copyright permissions of free manuals is contained +in an appendix to this manual (@pxref{Documentation Copying, , GNU Free +Documentation License}). The permissions text appears in an Info file @emph{before} the first node. This mean that a reader does @emph{not} see this text when -reading the file using Info, except when using the advanced Info command -@kbd{g *}. +reading the file using Info (except when using the advanced Info command +@kbd{g *}). @node Titlepage & Copyright Page @section The Title and Copyright Pages A manual's name and author are usually printed on a title page. Sometimes copyright information is printed on the title page as well; more often, copyright information is printed on the back of the title page. The title and copyright pages appear in the printed manual, but not in the Info file. Because of this, it is possible to use several slightly obscure @TeX{} typesetting commands that cannot be used in an Info file. In addition, this part of the beginning of a Texinfo file contains the text of the copying permissions that will appear in the printed manual.@refill @cindex Titlepage, for plain text You may wish to include titlepage-like information for plain text output. Simply place any such leading material between @code{@@ifinfo} and @code{@@end ifinfo}; @command{makeinfo} includes this in its plain text output. It will not show up in the Info readers. -@xref{Titlepage Permissions, , Titlepage Copying Permissions}, for the -standard text for the copyright permissions.@refill +@xref{Documentation Copying, , GNU Free Documentation License}, for the +standard text for the copyright permissions. @menu * titlepage:: Create a title for the printed document. * titlefont center sp:: The @code{@@titlefont}, @code{@@center}, and @code{@@sp} commands. * title subtitle author:: The @code{@@title}, @code{@@subtitle}, and @code{@@author} commands. * Copyright & Permissions:: How to write the copyright notice and include copying permissions. * end titlepage:: Turn on page headings after the title and copyright pages. * headings on off:: An option for turning headings on and off and double or single sided printing. @end menu @node titlepage, titlefont center sp, Titlepage & Copyright Page, Titlepage & Copyright Page @comment node-name, next, previous, up @subsection @code{@@titlepage} @cindex Title page @findex titlepage Start the material for the title page and following copyright page 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 page headings.) All the material that you want to appear on unnumbered pages should be put between the @code{@@titlepage} and @code{@@end titlepage} commands. You can force the table of contents to appear there with the @code{@@setcontentsaftertitlepage} command (@pxref{Contents}). @findex page@r{, within @code{@@titlepage}} By using the @code{@@page} command you can force a page break within the region delineated by the @code{@@titlepage} and @code{@@end titlepage} commands and thereby create more than one unnumbered page. This is how the copyright page is produced. (The @code{@@titlepage} command might perhaps have been better named the @code{@@titleandadditionalpages} command, but that would have been rather long!) When you write a manual about a computer program, you should write the version of the program to which the manual applies on the title page. If the manual changes more frequently than the program or is independent of it, you should also include an edition number@footnote{We have found that it is helpful to refer to versions of manuals as `editions' and versions of programs as `versions'; otherwise, we find we are liable to confuse each other in conversation by referring to both the documentation and the software with the same words.} for the manual. This helps readers keep track of which manual is for which version of the program. (The `Top' node should also contain this information; see @ref{makeinfo top, , @code{@@top}}.) 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. The second method uses the @code{@@title}, @code{@@subtitle}, and @code{@@author} commands to create a title page with black rules under the title and author lines and the subtitle text set flush to the right hand side of the page. With this method, you do not specify any of the actual formatting of the title page. You specify the text you want, and Texinfo does the formatting. You may use either method, or you may combine them; see the examples in the sections below. @findex shorttitlepage @cindex Bastard title page @cindex Title page, bastard For extremely simple applications, and for the bastard title page in traditional book front matter, Texinfo also provides a command @code{@@shorttitlepage} which takes a single argument as the title. The argument is typeset on a page by itself and followed by a blank page. @node titlefont center sp @subsection @code{@@titlefont}, @code{@@center}, and @code{@@sp} @findex titlefont @findex center @findex sp @r{(titlepage line spacing)} You can use the @code{@@titlefont}, @code{@@sp}, and @code{@@center} commands to create a title page for a printed document. (This is the first of the two methods for creating a title page in Texinfo.)@refill Use the @code{@@titlefont} command to select a large font suitable for the title itself. You can use @code{@@titlefont} more than once if you have an especially long title. @need 700 For example: @example @@titlefont@{Texinfo@} @end example Use the @code{@@center} command at the beginning of a line to center the remaining text on that line. Thus,@refill @example @@center @@titlefont@{Texinfo@} @end example @noindent centers the title, which in this example is ``Texinfo'' printed in the title font.@refill Use the @code{@@sp} command to insert vertical space. For example:@refill @example @@sp 2 @end example @noindent This inserts two blank lines on the printed page. (@xref{sp, , @code{@@sp}}, for more information about the @code{@@sp} command.)@refill A template for this method looks like this:@refill @example @group @@titlepage @@sp 10 @@center @@titlefont@{@var{name-of-manual-when-printed}@} @@sp 2 @@center @var{subtitle-if-any} @@sp 2 @@center @var{author} @dots{} @@end titlepage @end group @end example The spacing of the example fits an 8.5 by 11 inch manual.@refill @node title subtitle author @subsection @code{@@title}, @code{@@subtitle}, and @code{@@author} @findex title @findex subtitle @findex author You can use the @code{@@title}, @code{@@subtitle}, and @code{@@author} commands to create a title page in which the vertical and horizontal spacing is done for you automatically. This contrasts with the method described in the previous section, in which the @code{@@sp} command is needed to adjust vertical spacing. Write the @code{@@title}, @code{@@subtitle}, or @code{@@author} commands at the beginning of a line followed by the title, subtitle, or author.@refill The @code{@@title} command produces a line in which the title is set flush to the left-hand side of the page in a larger than normal font. The title is underlined with a black rule. Only a single line is allowed; the @code{@@*} command may not be used to break the title into two lines. To handle very long titles, you may find it profitable to use both @code{@@title} and @code{@@titlefont}; see the final example in this section. The @code{@@subtitle} command sets subtitles in a normal-sized font flush to the right-hand side of the page.@refill The @code{@@author} command sets the names of the author or authors in a middle-sized font flush to the left-hand side of the page on a line near the bottom of the title page. The names are underlined with a black rule that is thinner than the rule that underlines the title. (The black rule only occurs if the @code{@@author} command line is followed by an @code{@@page} command line.)@refill There are two ways to use the @code{@@author} command: you can write the name or names on the remaining part of the line that starts with an @code{@@author} command:@refill @example @@author by Jane Smith and John Doe @end example @noindent or you can write the names one above each other by using two (or more) @code{@@author} commands:@refill @example @group @@author Jane Smith @@author John Doe @end group @end example @noindent (Only the bottom name is underlined with a black rule.)@refill @need 950 A template for this method looks like this:@refill @example @group @@titlepage @@title @var{name-of-manual-when-printed} @@subtitle @var{subtitle-if-any} @@subtitle @var{second-subtitle} @@author @var{author} @@page @dots{} @@end titlepage @end group @end example You may also combine the @code{@@titlefont} method described in the previous section and @code{@@title} method described in this one. This may be useful if you have a very long title. Here is a real-life example: @example @group @@titlepage @@titlefont@{GNU Software@} @@sp 1 @@title for MS-Windows and MS-DOS -@@subtitle Edition @@value@{edition@} for Release @@value@{cd-edition@} +@@subtitle Edition @@value@{e@} for Release @@value@{cde@} @@author by Daniel Hagerty, Melissa Weisshaus @@author and Eli Zaretskii @end group @end example @noindent (The use of @code{@@value} here is explained in @ref{value Example,,@code{@@value} Example}.) @node Copyright & Permissions @subsection Copyright Page and Permissions @cindex Copyright page @cindex Printed permissions @cindex Permissions, printed By international treaty, the copyright notice for a book should be either on the title page or on the back of the title page. The copyright notice should include the year followed by the name of the organization or person who owns the copyright.@refill When the copyright notice is on the back of the title page, that page is customarily not numbered. Therefore, in Texinfo, the information on the copyright page should be within @code{@@titlepage} and @code{@@end titlepage} commands.@refill @findex vskip @findex filll @cindex Vertical whitespace (@samp{vskip}) Use the @code{@@page} command to cause a page break. To push the copyright notice and the other text on the copyright page towards the bottom of the page, you can write a somewhat mysterious line after the @code{@@page} command that reads like this:@refill @example @@vskip 0pt plus 1filll @end example @noindent This is a @TeX{} command that is not supported by the Info formatting commands. The @code{@@vskip} command inserts whitespace. The @samp{0pt plus 1filll} means to put in zero points of mandatory whitespace, and as much optional whitespace as needed to push the following text to the bottom of the page. Note the use of three @samp{l}s in the word @samp{filll}; this is the correct usage in @TeX{}.@refill @findex copyright In a printed manual, the @code{@@copyright@{@}} command generates a @samp{c} inside a circle. (In Info, it generates @samp{(C)}.) The copyright notice itself has the following legally defined sequence:@refill @example Copyright @copyright{} @var{year} @var{copyright-owner} @end example It is customary to put information on how to get a manual after the copyright notice, followed by the copying permissions for the manual. Permissions must be given here as well as in the summary segment within @code{@@ifinfo} and @code{@@end ifinfo} that immediately follows the header since this text appears only in the printed manual and the @samp{ifinfo} text appears only in the Info file. -@xref{Sample Permissions}, for the standard text.@refill +@xref{Documentation Copying,,GNU Free Documentation License}, for the +standard text. @node end titlepage @subsection Heading Generation @findex end titlepage @cindex Headings, page, begin to appear @cindex Titlepage end starts headings @cindex End titlepage starts headings An @code{@@end titlepage} command on a line by itself not only marks the end of the title and copyright pages, but also causes @TeX{} to start 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). (@xref{setchapternewpage, ,@code{@@setchapternewpage}}.) You can specify these formats in different ways:@refill @itemize @bullet @item The conventional way is to write an @code{@@setchapternewpage} command before the title page commands, and then have the @code{@@end titlepage} command start generating page headings in the manner desired. (@xref{setchapternewpage, , @code{@@setchapternewpage}}.)@refill @item Alternatively, you can use the @code{@@headings} command to prevent page headings from being generated or to start them for either single or double-sided printing. (Write an @code{@@headings} command immediately after the @code{@@end titlepage} command. @xref{headings on off, , The @code{@@headings} Command}, for more information.)@refill @item Or, you may specify your own page heading and footing format. @xref{Headings, , Page Headings}, for detailed information about page headings and footings.@refill @end itemize Most documents are formatted with the standard single-sided or 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 @comment node-name, next, previous, up @subsection The @code{@@headings} Command @findex headings The @code{@@headings} command is rarely used. It specifies what kind of page headings and footings to print on each page. Usually, this is controlled by the @code{@@setchapternewpage} command. You need the @code{@@headings} command only if the @code{@@setchapternewpage} command 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 You can use @code{@@headings} as follows:@refill @table @code @item @@headings off Turn off printing of page headings.@refill @item @@headings single 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 @code{@@titlepage} command to tell @TeX{} to start a new chapter on the same page as the end of the last chapter. This command also causes @TeX{} to typeset page headers for single-sided printing. To cause @TeX{} to typeset for double sided printing, write @code{@@headings double} after the @code{@@end titlepage} command. You can stop @TeX{} from generating any page headings at all by writing @code{@@headings off} on a line of its own immediately after the line containing the @code{@@end titlepage} command, like this:@refill @example @@end titlepage @@headings off @end example @noindent The @code{@@headings off} command overrides the @code{@@end titlepage} command, which would otherwise cause @TeX{} to print page headings.@refill You can also specify your own style of page heading and footing. @xref{Headings, , Page Headings}, for more information.@refill @node The Top Node @section The `Top' Node and Master Menu @cindex @samp{@r{Top}} node @cindex Master menu @cindex Node, `Top' 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. 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 The contents of the `Top' node should appear only in the Info file; none of it should appear in printed output, so enclose it between @code{@@ifinfo} and @code{@@end ifinfo} commands. (@TeX{} does not print either an @code{@@node} line or a menu; they appear only in Info; strictly speaking, you are not required to enclose these parts between @code{@@ifinfo} and @code{@@end ifinfo}, but it is simplest to do so. @xref{Conditionals, , Conditionally Visible Text}.)@refill @menu * Title of Top Node:: Sketch what the file is about. * Master Menu Parts:: A master menu has three or more parts. @end menu @node Title of Top Node @subsection `Top' Node Title Sometimes, you will want to place an @code{@@top} sectioning command line containing the title of the document immediately after the @code{@@node Top} line (@pxref{makeinfo top command, , The @code{@@top} Sectioning Command}, for more information).@refill For example, the beginning of the Top node of this manual contains an @code{@@top} sectioning command, a short description, and edition and version information. It looks like this:@refill @example @group @dots{} @@end titlepage @@ifnottex @@node Top, Copying, , (dir) @@top Texinfo Texinfo is a documentation system@dots{} @end group @group This is edition@dots{} @dots{} @@end ifnottex @end group @group @@menu * Copying:: Texinfo is freely redistributable. * Overview:: What is Texinfo? @dots{} @end group @@end menu @end example In a `Top' node, the `Previous', and `Up' nodes usually refer to the top level directory of the whole Info system, which is called @samp{(dir)}. 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 @subsection Parts of a Master Menu @cindex Master menu parts @cindex Parts of a master menu A @dfn{master menu} is a detailed main menu listing all the nodes in a file. A master menu is enclosed in @code{@@menu} and @code{@@end menu} commands and does not appear in the printed document.@refill Generally, a master menu is divided into parts.@refill @itemize @bullet @item The first part contains the major nodes in the Texinfo file: the nodes for the chapters, chapter-like sections, and the appendices.@refill @item The second part contains nodes for the indices.@refill @item The third and subsequent parts contain a listing of the other, lower 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. 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 long as the line does not begin with an asterisk, it will not be treated as a menu entry. (@xref{Writing a Menu}, for more information.)@refill For example, the master menu for this manual looks like the following (but has many more entries):@refill @example @group @@menu * Copying:: Texinfo is freely redistributable. * Overview:: What is Texinfo? * Texinfo Mode:: Special features in GNU Emacs. @dots{} @dots{} @end group @group * 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 a printed manual. @dots{} @dots{} @end group @group Using Texinfo Mode * 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 @comment node-name, next, previous, up @section Software Copying Permissions @cindex Software copying permissions @cindex Copying software @cindex Distribution @cindex License agreement If the Texinfo file has a section containing the ``General Public License'' and the distribution information and a warranty disclaimer for the software that is documented, this section usually follows the `Top' node. The General Public License is very important to Project GNU software. It ensures that you and others will continue to have a right to use and share the software.@refill -The copying and distribution information and the disclaimer are -followed by an introduction or else by the first chapter of the -manual.@refill +The copying and distribution information and the disclaimer are followed +by an introduction or else by the first chapter of the manual.@refill @cindex Introduction, as part of file Although an introduction is not a required part of a Texinfo file, it is very helpful. Ideally, it should state clearly and concisely what the file is about and who would be interested in reading it. In general, an introduction would follow the licensing and distribution information, although sometimes people put it earlier in the document. Usually, an introduction is put in an @code{@@unnumbered} section. (@xref{unnumbered & appendix, , The @code{@@unnumbered} and @code{@@appendix} Commands}.)@refill @node Ending a File, Structuring, Beginning a File, Top @comment node-name, next, previous, up @chapter Ending a Texinfo File @cindex Ending a Texinfo file @cindex Texinfo file ending @cindex File ending @findex bye The end of a Texinfo file should include commands to create indices and (usually) to generate detailed and summary tables of contents. And it must include the @code{@@bye} command that marks the last line processed by @TeX{}.@refill @need 700 For example: @example @@node Concept Index, , Variables Index, Top @@c node-name, next, previous, up @@unnumbered Concept Index @@printindex cp @@contents @@bye @end example @menu * 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. @end menu @node Printing Indices & Menus, Contents, Ending a File, Ending a File @comment node-name, next, previous, up @section Index Menus and Printing an Index @findex printindex @cindex Printing an index @cindex Indices, printing and menus @cindex Generating menus with indices @cindex Menus generated with indices To print an index means to include it as part of a manual or Info file. This does not happen automatically just because you use @code{@@cindex} or other index-entry generating commands in the Texinfo file; those just cause the raw data for the index to be accumulated. To generate an index, you must include the @code{@@printindex} command at the place in the document where you want the index to appear. Also, as part of the process of creating a printed manual, you must run a program called @code{texindex} (@pxref{Hardcopy}) to sort the raw data to produce a sorted index file. The sorted index file is what is actually used to print the index.@refill Texinfo offers six different types of predefined index: the concept index, the function index, the variables index, the keystroke index, the program index, and the data type index (@pxref{Predefined Indices}). Each index type has a two-letter name: @samp{cp}, @samp{fn}, @samp{vr}, @samp{ky}, @samp{pg}, and @samp{tp}. You may merge indices, or put them into separate sections (@pxref{Combining Indices}); or you may define your own indices (@pxref{New Indices, , Defining New Indices}).@refill The @code{@@printindex} command takes a two-letter index name, reads the corresponding sorted index file and formats it appropriately into an index.@refill @ignore The two-letter index names are: @table @samp @item cp concept index @item fn function index @item vr variable index @item ky key index @item pg program index @item tp data type index @end table @end ignore The @code{@@printindex} command does not generate a chapter heading for the index. Consequently, you should precede the @code{@@printindex} command with a suitable section or chapter command (usually @code{@@unnumbered}) to supply the chapter heading and put the index into the table of contents. Precede the @code{@@unnumbered} command with an @code{@@node} line.@refill @need 1200 For example: @smallexample @group @@node Variable Index, Concept Index, Function Index, Top @@comment node-name, next, previous, up @@unnumbered Variable Index @@printindex vr @end group @group @@node Concept Index, , Variable Index, Top @@comment node-name, next, previous, up @@unnumbered Concept Index @@printindex cp @end group @end smallexample @noindent Readers often prefer that the concept index come last in a book, since that makes it easiest to find. Having just one index helps readers also, since then they have only one place to look (@pxref{synindex}). @node Contents @section Generating a Table of Contents @cindex Table of contents @cindex Contents, Table of @cindex Short table of contents @findex contents @findex summarycontents @findex shortcontents The @code{@@chapter}, @code{@@section}, and other structuring commands supply the information to make up a table of contents, but they do not cause an actual table to appear in the manual. To do this, you must use the @code{@@contents} and/or @code{@@summarycontents} command(s). @table @code @item @@contents Generate a table of contents in a printed manual, including all chapters, sections, subsections, etc., as well as appendices and unnumbered chapters. (Headings generated by the @code{@@heading} series of commands do not appear in the table of contents.) @item @@shortcontents @itemx @@summarycontents (@code{@@summarycontents} is a synonym for @code{@@shortcontents}; the two commands are exactly the same.)@refill Generate a short or summary table of contents that lists only the chapters (and appendices and unnumbered chapters). Omit sections, subsections and subsubsections. Only a long manual needs a short table of contents in addition to the full table of contents.@refill @end table Both contents commands should be written on a line by themselves. The contents commands automatically generate a chapter-like heading at the top of the first table of contents page, so don't include any sectioning command such as @code{@@unnumbered} before them. Since an Info file uses menus instead of tables of contents, the Info formatting commands ignore the contents commands. But the contents are -included in plain text output (generated by @code{makeinfo --no-headers}). +included in plain text output (generated by @code{makeinfo +--no-headers}), unless @code{makeinfo} is writing its output to standard +output. + +When @code{makeinfo} writes a short table of contents while producing +html output, the links in the short table of contents point to +corresponding entries in the full table of contents rather than the text +of the document. The links in the full table of contents point to the +main text of the document. The contents commands can be placed either at the very end of the file, after any indices (see the previous section) and just before the @code{@@bye} (see the next section), or near the beginning of the file, after the @code{@@end titlepage} (@pxref{titlepage}). The advantage to the former is that then the contents output is always up to date, because it reflects the processing just done. The advantage to the latter is that the contents are printed in the proper place, thus you do not need to rearrange the DVI file with @command{dviselect} or shuffle -paper. However, contents commands at the beginning of the document are -ignored when outputting to standard output. +paper. @findex setcontentsaftertitlepage @findex setshortcontentsaftertitlepage @cindex Contents, after title page @cindex Table of contents, after title page As an author, you can put the contents commands wherever you prefer. But if you are a user simply printing a manual, you may wish to print the contents after the title page even if the author put the contents commands at the end of the document (as is the case in most existing Texinfo documents). You can do this by specifying @code{@@setcontentsaftertitlepage} and/or @code{@@setshortcontentsaftertitlepage}. The first prints only the main contents after the @code{@@end titlepage}; the second prints both the short contents and the main contents. In either case, any subsequent @code{@@contents} or @code{@@shortcontents} is ignored (unless no @code{@@end titlepage} is ever encountered). You need to include the @code{@@set@dots{}contentsaftertitlepage} commands early in the document (just after @code{@@setfilename}, for example). Or, if you're using @command{texi2dvi} (@pxref{Format with texi2dvi}), you can use its @option{--texinfo} option to specify this without altering the source file at all. For example: @example texi2dvi --texinfo=@@setshortcontentsaftertitlepage foo.texi @end example @node File End @section @code{@@bye} File Ending @findex bye An @code{@@bye} command terminates @TeX{} or Info formatting. None of the formatting commands see any of the file following @code{@@bye}. The @code{@@bye} command should be on a line by itself.@refill If you wish, you may follow the @code{@@bye} line with notes. These notes will not be formatted and will not appear in either Info or a printed manual; it is as if text after @code{@@bye} were within @code{@@ignore} @dots{} @code{@@end ignore}. Also, you may follow the @code{@@bye} line with a local variables list. @xref{Compile-Command, , Using Local Variables and the Compile Command}, for more information.@refill @node Structuring @chapter Chapter Structuring @cindex Chapter structuring @cindex Structuring of chapters The @dfn{chapter structuring} commands divide a document into a hierarchy of chapters, sections, subsections, and subsubsections. These commands generate large headings; they also provide information for the table of contents of a printed manual (@pxref{Contents, , Generating a Table of Contents}).@refill The chapter structuring commands do not create an Info node structure, so normally you should put an @code{@@node} command immediately before each chapter structuring command (@pxref{Nodes}). The only time you are likely to use the chapter structuring commands without using the node structuring commands is if you are writing a document that contains no cross references and will never be transformed into Info format.@refill It is unlikely that you will ever write a Texinfo file that is intended only as an Info file and not as a printable document. If you do, you might still use chapter structuring commands to create a heading at the top of each node---but you don't need to.@refill @menu * Tree Structuring:: A manual is like an upside down tree @dots{} * Structuring Command Types:: How to divide a manual into parts. * makeinfo top:: The @code{@@top} command, part of the `Top' node. * chapter:: * unnumbered & appendix:: * majorheading & chapheading:: * section:: * unnumberedsec appendixsec heading:: * subsection:: * unnumberedsubsec appendixsubsec subheading:: * subsubsection:: Commands for the lowest level sections. * Raise/lower sections:: How to change commands' hierarchical level. @end menu @node Tree Structuring @section Tree Structure of Sections @cindex Tree structuring A Texinfo file is usually structured like a book with chapters, sections, subsections, and the like. This structure can be visualized as a tree (or rather as an upside-down tree) with the root at the top and the levels corresponding to chapters, sections, subsection, and subsubsections.@refill Here is a diagram that shows a Texinfo file with three chapters, each of which has two sections.@refill @example @group Top | ------------------------------------- | | | Chapter 1 Chapter 2 Chapter 3 | | | -------- -------- -------- | | | | | | Section Section Section Section Section Section 1.1 1.2 2.1 2.2 3.1 3.2 @end group @end example In a Texinfo file that has this structure, the beginning of Chapter 2 looks like this:@refill @example @group @@node Chapter 2, Chapter 3, Chapter 1, top @@chapter Chapter 2 @end group @end example The chapter structuring commands are described in the sections that follow; the @code{@@node} and @code{@@menu} commands are described in following chapters. (@xref{Nodes}, and see @ref{Menus}.)@refill @node Structuring Command Types @section Structuring Command Types The chapter structuring commands fall into four groups or series, each of which contains structuring commands corresponding to the hierarchical levels of chapters, sections, subsections, and subsubsections.@refill The four groups are the @code{@@chapter} series, the @code{@@unnumbered} series, the @code{@@appendix} series, and the @code{@@heading} series.@refill Each command produces titles that have a different appearance on the printed page or Info file; only some of the commands produce titles that are listed in the table of contents of a printed book or manual.@refill @itemize @bullet @item The @code{@@chapter} and @code{@@appendix} series of commands produce numbered or lettered entries both in the body of a printed work and in its table of contents.@refill @item The @code{@@unnumbered} series of commands produce unnumbered entries both in the body of a printed work and in its table of contents. The @code{@@top} command, which has a special use, is a member of this series (@pxref{makeinfo top, , @code{@@top}}).@refill @item The @code{@@heading} series of commands produce unnumbered headings that do not appear in a table of contents. The heading commands never start a new page.@refill @item The @code{@@majorheading} command produces results similar to using the @code{@@chapheading} command but generates a larger vertical whitespace before the heading.@refill @item When an @code{@@setchapternewpage} command says to do so, the @code{@@chapter}, @code{@@unnumbered}, and @code{@@appendix} commands start new pages in the printed manual; the @code{@@heading} commands do not.@refill @end itemize -Here are the four groups of chapter structuring commands:@refill +Here are the four groups of chapter structuring commands: -@multitable @columnfractions .19 .30 .29 .22 +@tex +{\globaldefs = 1 \smallfonts} +@end tex -@item @tab @tab @tab No new page -@item Numbered @tab Unnumbered @tab Lettered and numbered - @tab Unnumbered -@item In contents @tab In contents @tab In contents @tab Not in contents -@item @tab @code{@@top} @tab - @tab @code{@@majorheading} -@item @code{@@chapter} @tab @code{@@unnumbered} @tab @code{@@appendix} - @tab @code{@@chapheading} -@item @code{@@section} @tab @code{@@unnumberedsec} @tab @code{@@appendixsec} - @tab @code{@@heading} -@item @code{@@subsection} @tab @code{@@unnumberedsubsec} @tab @code{@@appendixsubsec} - @tab @code{@@subheading} -@item @code{@@subsubsection} @tab @code{@@unnumberedsubsubsec} @tab @code{@@appendixsubsubsec} - @tab @code{@@subsubheading} +@multitable @columnfractions .19 .30 .29 .22 +@item @tab @tab @tab No new page +@item @i{Numbered} @tab @i{Unnumbered} @tab @i{Lettered/numbered} @tab @i{Unnumbered} +@item In contents @tab In contents @tab In contents @tab Omitted from@*contents +@item @tab @code{@@top} @tab @tab @code{@@majorheading} +@item @code{@@chapter} @tab @code{@@unnumbered} @tab @code{@@appendix} @tab @code{@@chapheading} +@item @code{@@section} @tab @code{@@unnumberedsec} @tab @code{@@appendixsec} @tab @code{@@heading} +@item @code{@@subsection} @tab @code{@@unnumberedsubsec} @tab @code{@@appendixsubsec} @tab @code{@@subheading} +@item @code{@@subsubsection} @tab @code{@@unnumberedsubsubsec} @tab @code{@@appendixsubsubsec} @tab @code{@@subsubheading} @end multitable +@tex +{\globaldefs = 1 \textfonts} +@end tex @node makeinfo top @section @code{@@top} The @code{@@top} command is a special sectioning command that you use only after an @samp{@@node Top} line at the beginning of a Texinfo file. The @code{@@top} command tells the @code{makeinfo} formatter which node is the `Top' node, so it can use it as the root of the node tree if your manual uses implicit pointers. It has the same typesetting effect as @code{@@unnumbered} (@pxref{unnumbered & appendix, , @code{@@unnumbered} and @code{@@appendix}}). For detailed information, see @ref{makeinfo top command, , The @code{@@top} Command}. The @code{@@top} node and its menu (if any) is conventionally wrapped in an @code{@@ifnottex} conditional so that it will appear only in Info and HTML output, not @TeX{}. @node chapter, unnumbered & appendix, makeinfo top, Structuring @comment node-name, next, previous, up @section @code{@@chapter} @findex chapter @code{@@chapter} identifies a chapter in the document. Write the command at the beginning of a line and follow it on the same line by the title of the chapter.@refill For example, this chapter in this manual is entitled ``Chapter Structuring''; the @code{@@chapter} line looks like this:@refill @example @@chapter Chapter Structuring @end example In @TeX{}, the @code{@@chapter} command creates a chapter in the document, specifying the chapter title. The chapter is numbered automatically.@refill In Info, the @code{@@chapter} command causes the title to appear on a line by itself, with a line of asterisks inserted underneath. Thus, in Info, the above example produces the following output:@refill @example 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 @section @code{@@unnumbered} and @code{@@appendix} @findex unnumbered @findex appendix Use the @code{@@unnumbered} command to create a chapter that appears in a printed manual without chapter numbers of any kind. Use the @code{@@appendix} command to create an appendix in a printed manual that is labelled by letter instead of by number.@refill For Info file output, the @code{@@unnumbered} and @code{@@appendix} commands are equivalent to @code{@@chapter}: the title is printed on a line by itself with a line of asterisks underneath. (@xref{chapter, , @code{@@chapter}}.)@refill To create an appendix or an unnumbered chapter, write an @code{@@appendix} or @code{@@unnumbered} command at the beginning of a 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 @findex chapheading The @code{@@majorheading} and @code{@@chapheading} commands put chapter-like headings in the body of a document.@refill However, neither command causes @TeX{} to produce a numbered heading or an entry in the table of contents; and neither command causes @TeX{} to start a new page in a printed manual.@refill In @TeX{}, an @code{@@majorheading} command generates a larger vertical whitespace before the heading than an @code{@@chapheading} command but is otherwise the same.@refill In Info, the @code{@@majorheading} and @code{@@chapheading} commands are equivalent to @code{@@chapter}: the title is printed on a line by itself with a line of asterisks underneath. (@xref{chapter, , @code{@@chapter}}.)@refill @node section, unnumberedsec appendixsec heading, majorheading & chapheading, Structuring @comment node-name, next, previous, up @section @code{@@section} @findex section In a printed manual, an @code{@@section} command identifies a numbered section within a chapter. The section title appears in the table of contents. In Info, an @code{@@section} command provides a title for a segment of text, underlined with @samp{=}.@refill This section is headed with an @code{@@section} command and looks like this in the Texinfo file:@refill @example @@section @@code@{@@@@section@} @end example To create a section, write the @code{@@section} command at the beginning of a line and follow it on the same line by the section title.@refill Thus, @example @@section This is a section @end example @noindent produces @example @group This is a section ================= @end group @end example @noindent in Info. @node unnumberedsec appendixsec heading, subsection, section, Structuring @comment node-name, next, previous, up @section @code{@@unnumberedsec}, @code{@@appendixsec}, @code{@@heading} @findex unnumberedsec @findex appendixsec @findex heading The @code{@@unnumberedsec}, @code{@@appendixsec}, and @code{@@heading} commands are, respectively, the unnumbered, appendix-like, and heading-like equivalents of the @code{@@section} command. (@xref{section, , @code{@@section}}.)@refill @table @code @item @@unnumberedsec The @code{@@unnumberedsec} command may be used within an unnumbered chapter or within a regular chapter or appendix to provide an unnumbered section.@refill @item @@appendixsec @itemx @@appendixsection @code{@@appendixsection} is a longer spelling of the @code{@@appendixsec} command; the two are synonymous.@refill @findex appendixsection Conventionally, the @code{@@appendixsec} or @code{@@appendixsection} command is used only within appendices.@refill @item @@heading You may use the @code{@@heading} command anywhere you wish for a section-style heading that will not appear in the table of contents.@refill @end table @node subsection, unnumberedsubsec appendixsubsec subheading, unnumberedsec appendixsec heading, Structuring @comment node-name, next, previous, up @section The @code{@@subsection} Command @findex subsection Subsections are to sections as sections are to chapters. (@xref{section, , @code{@@section}}.) In Info, subsection titles are underlined with @samp{-}. For example,@refill @example @@subsection This is a subsection @end example @noindent produces @example @group This is a subsection -------------------- @end group @end example In a printed manual, subsections are listed in the table of contents 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 @findex unnumberedsubsec @findex appendixsubsec @findex subheading The @code{@@unnumberedsubsec}, @code{@@appendixsubsec}, and @code{@@subheading} commands are, respectively, the unnumbered, appendix-like, and heading-like equivalents of the @code{@@subsection} command. (@xref{subsection, , @code{@@subsection}}.)@refill In Info, the @code{@@subsection}-like commands generate a title underlined with hyphens. In a printed manual, an @code{@@subheading} command produces a heading like that of a subsection except that it is not numbered and does not appear in the table of contents. Similarly, an @code{@@unnumberedsubsec} command produces an unnumbered heading like that of a subsection and an @code{@@appendixsubsec} command produces a subsection-like heading labelled with a letter and numbers; both of these commands produce headings that appear in the table of contents.@refill @node subsubsection, Raise/lower sections, unnumberedsubsec appendixsubsec subheading, Structuring @comment node-name, next, previous, up @section The `subsub' Commands @cindex Subsub commands @findex subsubsection @findex unnumberedsubsubsec @findex appendixsubsubsec @findex subsubheading The fourth and lowest level sectioning commands in Texinfo are the `subsub' commands. They are:@refill @table @code @item @@subsubsection Subsubsections are to subsections as subsections are to sections. (@xref{subsection, , @code{@@subsection}}.) In a printed manual, subsubsection titles appear in the table of contents and are numbered four levels deep.@refill @item @@unnumberedsubsubsec Unnumbered subsubsection titles appear in the table of contents of a printed manual, but lack numbers. Otherwise, unnumbered subsubsections are the same as subsubsections. In Info, unnumbered subsubsections look exactly like ordinary subsubsections.@refill @item @@appendixsubsubsec Conventionally, appendix commands are used only for appendices and are lettered and numbered appropriately in a printed manual. They also appear in the table of contents. In Info, appendix subsubsections look exactly like ordinary subsubsections.@refill @item @@subsubheading The @code{@@subsubheading} command may be used anywhere that you need a small heading that will not appear in the table of contents. In Info, subsubheadings look exactly like ordinary subsubsection headings.@refill @end table In Info, `subsub' titles are underlined with periods. For example,@refill @example @@subsubsection This is a subsubsection @end example @noindent produces @example @group This is a subsubsection ....................... @end group @end example @node Raise/lower sections, , subsubsection, Structuring @comment node-name, next, previous, up @section @code{@@raisesections} and @code{@@lowersections} @findex raisesections @findex lowersections @cindex Raising and lowering sections @cindex Sections, raising and lowering The @code{@@raisesections} and @code{@@lowersections} commands raise and lower the hierarchical level of chapters, sections, subsections and the like. The @code{@@raisesections} command changes sections to chapters, subsections to sections, and so on. The @code{@@lowersections} command changes chapters to sections, sections to subsections, and so on. @cindex Include files, and section levels An @code{@@lowersections} command is useful if you wish to include text that is written as an outer or standalone Texinfo file in another Texinfo file as an inner, included file. If you write the command at the beginning of the file, all your @code{@@chapter} commands are formatted as if they were @code{@@section} commands, all your @code{@@section} command are formatted as if they were @code{@@subsection} commands, and so on. @need 1000 @code{@@raisesections} raises a command one level in the chapter structuring hierarchy:@refill @example @group @r{Change} @r{To} @@subsection @@section, @@section @@chapter, @@heading @@chapheading, @r{etc.} @end group @end example @need 1000 @code{@@lowersections} lowers a command one level in the chapter structuring hierarchy:@refill @example @group @r{Change} @r{To} @@chapter @@section, @@subsection @@subsubsection, @@heading @@subheading, @r{etc.} @end group @end example An @code{@@raisesections} or @code{@@lowersections} command changes only those structuring commands that follow the command in the Texinfo file. Write an @code{@@raisesections} or @code{@@lowersections} command on a line of its own. An @code{@@lowersections} command cancels an @code{@@raisesections} command, and vice versa. Typically, the commands are used like this: @example @@lowersections @@include somefile.texi @@raisesections @end example Without the @code{@@raisesections}, all the subsequent sections in your document will be lowered. Repeated use of the commands continue to raise or lower the hierarchical level a step at a time. An attempt to raise above `chapters' reproduces chapter commands; an attempt to lower below `subsubsections' reproduces subsubsection commands. @node Nodes @chapter Nodes @dfn{Nodes} are the primary segments of a Texinfo file. They do not themselves impose a hierarchical or any other kind of structure on a file. Nodes contain @dfn{node pointers} that name other nodes, and can contain @dfn{menus} which are lists of nodes. In Info, the movement commands can carry you to a pointed-to node or to a node listed in a menu. Node pointers and menus provide structure for Info files just as chapters, sections, subsections, and the like, provide structure for printed books.@refill @menu * Two Paths:: Different commands to structure Info output and printed output. * Node Menu Illustration:: A diagram, and sample nodes and menus. * node:: Creating nodes, in detail. * makeinfo Pointer Creation:: Letting makeinfo determine node pointers. * anchor:: Defining arbitrary cross-reference targets. @end menu @node Two Paths @section Two Paths The node and menu commands and the chapter structuring commands are technically independent of each other: @itemize @bullet @item In Info, node and menu commands provide structure. The chapter structuring commands generate headings with different kinds of underlining---asterisks for chapters, hyphens for sections, and so on; they do nothing else.@refill @item In @TeX{}, the chapter structuring commands generate chapter and section numbers and tables of contents. The node and menu commands provide information for cross references; they do nothing else.@refill @end itemize You can use node pointers and menus to structure an Info file any way you want; and you can write a Texinfo file so that its Info output has a different structure than its printed output. However, virtually all Texinfo files are written such that the structure for the Info output corresponds to the structure for the printed output. It is neither convenient nor understandable to the reader to do otherwise.@refill Generally, printed output is structured in a tree-like hierarchy in which the chapters are the major limbs from which the sections branch out. Similarly, node pointers and menus are organized to create a matching structure in the Info output.@refill @node Node Menu Illustration @section Node and Menu Illustration Here is a copy of the diagram shown earlier that illustrates a Texinfo file with three chapters, each of which contains two sections.@refill The ``root'' is at the top of the diagram and the ``leaves'' are at the bottom. This is how such a diagram is drawn conventionally; it illustrates an upside-down tree. For this reason, the root node is called the `Top' node, and `Up' node pointers carry you closer to the root.@refill @example @group Top | ------------------------------------- | | | Chapter 1 Chapter 2 Chapter 3 | | | -------- -------- -------- | | | | | | Section Section Section Section Section Section 1.1 1.2 2.1 2.2 3.1 3.2 @end group @end example The fully-written command to start Chapter 2 would be this: @example @group @@node Chapter 2, Chapter 3, Chapter 1, Top @@comment node-name, next, previous, up @end group @end example @noindent This @code{@@node} line says that the name of this node is ``Chapter 2'', the name of the `Next' node is ``Chapter 3'', the name of the `Previous' node is ``Chapter 1'', and the name of the `Up' node is ``Top''. You can omit writing out these node names if your document is hierarchically organized (@pxref{makeinfo Pointer Creation}), but the pointer relationships still obtain. @quotation @strong{Please Note:} `Next' refers to the next node at the same hierarchical level in the manual, not necessarily to the next node within the Texinfo file. In the Texinfo file, the subsequent node may be at a lower level---a section-level node most often follows a chapter-level node, for example. `Next' and `Previous' refer to nodes at the @emph{same} hierarchical level. (The `Top' node contains the exception to this rule. Since the `Top' node is the only node at that level, `Next' refers to the first following node, which is almost always a chapter or chapter-level node.)@refill @end quotation To go to Sections 2.1 and 2.2 using Info, you need a menu inside Chapter 2. (@xref{Menus}.) You would write the menu just before the beginning of Section 2.1, like this:@refill @example @group @@menu * Sect. 2.1:: Description of this section. * Sect. 2.2:: @@end menu @end group @end example Write the node for Sect. 2.1 like this:@refill @example @group @@node Sect. 2.1, Sect. 2.2, Chapter 2, Chapter 2 @@comment node-name, next, previous, up @end group @end example In Info format, the `Next' and `Previous' pointers of a node usually lead to other nodes at the same level---from chapter to chapter or from section to section (sometimes, as shown, the `Previous' pointer points up); an `Up' pointer usually leads to a node at the level above (closer to the `Top' node); and a `Menu' leads to nodes at a level below (closer to `leaves'). (A cross reference can point to a node at any level; see @ref{Cross References}.)@refill Usually, an @code{@@node} command and a chapter structuring command are used in sequence, along with indexing commands. (You may follow the @code{@@node} line with a comment line that reminds you which pointer is which.)@refill Here is the beginning of the chapter in this manual called ``Ending a Texinfo File''. This shows an @code{@@node} line followed by a comment line, an @code{@@chapter} line, and then by indexing lines.@refill @example @group @@node Ending a File, Structuring, Beginning a File, Top @@comment node-name, next, previous, up @@chapter Ending a Texinfo File @@cindex Ending a Texinfo file @@cindex Texinfo file ending @@cindex File ending @end group @end example @node node @section The @code{@@node} Command @cindex Node, defined @findex node A @dfn{node} is a segment of text that begins at an @code{@@node} command and continues until the next @code{@@node} command. The definition of node is different from that for chapter or section. A chapter may contain sections and a section may contain subsections; but a node cannot contain subnodes; the text of a node continues only until the next @code{@@node} command in the file. A node usually contains only one chapter structuring command, the one that follows the @code{@@node} line. On the other hand, in printed output nodes are used only for cross references, so a chapter or section may contain any number of nodes. Indeed, a chapter usually contains several nodes, one for each section, subsection, and subsubsection.@refill To create a node, write an @code{@@node} command at the beginning of a line, and follow it with up to four arguments, separated by commas, on the rest of the same line. The first argument is required; it is the name of this node. The subsequent arguments are the names of the `Next', `Previous', and `Up' pointers, in that order, and may be omitted if your Texinfo document is hierarchically organized (@pxref{makeinfo Pointer Creation}). You may insert spaces before each name if you wish; the spaces are ignored. You must write the name of the node and the names of the `Next', `Previous', and `Up' pointers all on the same line. Otherwise, the formatters fail. (@inforef{Top, info, info}, for more information about nodes in Info.) Usually, you write one of the chapter-structuring command lines immediately after an @code{@@node} line---for example, an @code{@@section} or @code{@@subsection} line. (@xref{Structuring Command Types}.) @quotation @strong{Please note:} The GNU Emacs Texinfo mode updating commands work only with Texinfo files in which @code{@@node} lines are followed by chapter structuring lines. @xref{Updating Requirements}.@refill @end quotation @TeX{} uses @code{@@node} lines to identify the names to use for cross references. For this reason, you must write @code{@@node} lines in a Texinfo file that you intend to format for printing, even if you do not intend to format it for Info. (Cross references, such as the one at the end of this sentence, are made with @code{@@xref} and related commands; see @ref{Cross References}.)@refill @menu * Node Names:: How to choose node and pointer names. * Writing a Node:: How to write an @code{@@node} line. * 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. * Top Node Summary:: Write a brief description for readers. @end menu @node Node Names @subsection Choosing Node and Pointer Names @cindex Node names, choosing The name of a node identifies the node. The pointers enable you to reach other nodes and consist of the names of those nodes.@refill Normally, a node's `Up' pointer contains the name of the node whose menu mentions that node. The node's `Next' pointer contains the name of the node that follows that node in that menu and its `Previous' pointer contains the name of the node that precedes it in that menu. When a node's `Previous' node is the same as its `Up' node, both node pointers name the same node.@refill Usually, the first node of a Texinfo file is the `Top' node, and its `Up' and `Previous' pointers point to the @file{dir} file, which contains the main menu for all of Info.@refill The `Top' node itself contains the main or master menu for the manual. Also, it is helpful to include a brief description of the manual in the `Top' node. @xref{First Node}, for information on how to write the first node of a Texinfo file.@refill Even when you explicitly specify all pointers, that does not mean you can write the nodes in the Texinfo source file in an arbitrary order! Because @TeX{} processes the file sequentially, irrespective of node pointers, you must write the nodes in the order you wish them to appear in the printed output. @node Writing a Node @subsection How to Write an @code{@@node} Line @cindex Writing an @code{@@node} line @cindex @code{@@node} line writing @cindex Node line writing The easiest way to write an @code{@@node} line is to write @code{@@node} at the beginning of a line and then the name of the node, like this:@refill @example @@node @var{node-name} @end example If you are using GNU Emacs, you can use the update node commands provided by Texinfo mode to insert the names of the pointers; or you can leave the pointers out of the Texinfo file and let @code{makeinfo} insert node pointers into the Info file it creates. (@xref{Texinfo Mode}, and @ref{makeinfo Pointer Creation}.)@refill Alternatively, you can insert the `Next', `Previous', and `Up' pointers yourself. If you do this, you may find it helpful to use the Texinfo mode keyboard command @kbd{C-c C-c n}. This command inserts @samp{@@node} and a comment line listing the names of the pointers in their proper order. The comment line helps you keep track of which arguments are for which pointers. This comment line is especially useful if you are not familiar with Texinfo.@refill The template for a fully-written-out node line with `Next', `Previous', and `Up' pointers looks like this:@refill @example @@node @var{node-name}, @var{next}, @var{previous}, @var{up} @end example If you wish, you can ignore @code{@@node} lines altogether in your first draft and then use the @code{texinfo-insert-node-lines} command to create @code{@@node} lines for you. However, we do not recommend this practice. It is better to name the node itself at the same time that you write a segment so you can easily make cross references. A large number of cross references are an especially important feature of a good Info file. After you have inserted an @code{@@node} line, you should immediately write an @@-command for the chapter or section and insert its name. Next (and this is important!), put in several index entries. Usually, you will find at least two and often as many as four or five ways of referring to the node in the index. Use them all. This will make it much easier for people to find the node. @node Node Line Tips @subsection @code{@@node} Line Tips Here are three suggestions: @itemize @bullet @item Try to pick node names that are informative but short.@refill In the Info file, the file name, node name, and pointer names are all inserted on one line, which may run into the right edge of the window. (This does not cause a problem with Info, but is ugly.)@refill @item Try to pick node names that differ from each other near the beginnings of their names. This way, it is easy to use automatic name completion in Info.@refill @item By convention, node names are capitalized just as they would be for section or chapter titles---initial and significant words are capitalized; others are not.@refill @end itemize @node Node Line Requirements, First Node, Node Line Tips, node @subsection @code{@@node} Line Requirements @cindex Node line requirements +@cindex Restrictions on node names Here are several requirements for @code{@@node} lines: @itemize @bullet @cindex Unique nodename requirement @cindex Node name must be unique @item All the node names for a single Info file must be unique.@refill Duplicates confuse the Info movement commands. This means, for example, that if you end every chapter with a summary, you must name each summary node differently. You cannot just call each one ``Summary''. You may, however, duplicate the titles of chapters, sections, and the like. Thus you can end each chapter in a book with a section called ``Summary'', so long as the node names for those sections are all different.@refill @item A pointer name must be the name of a node.@refill The node to which a pointer points may come before or after the node containing the pointer. @cindex @@-commands in nodename @cindex Node name, should not contain @@-commands @item -@w{@@-commands} used in node names generally confuse Info, so you should -avoid them. For a few rare cases when this is useful, Texinfo has -limited support for using @w{@@-commands} in node names; see -@ref{Pointer Validation}. +@w{@@-commands} used in node names generally confuse Info, so you +should avoid them. This includes punctuation characters that are +escaped with a @samp{@@}, such as @code{@@} and @code{@{}. For a few +rare cases when this is useful, Texinfo has limited support for using +@w{@@-commands} in node names; see @ref{Pointer Validation}. @need 750 Thus, the beginning of the section called @code{@@chapter} looks like this:@refill @smallexample @group @@node chapter, unnumbered & appendix, makeinfo top, Structuring @@comment node-name, next, previous, up @@section @@code@{@@@@chapter@} @@findex chapter @end group @end smallexample +@item +@cindex Parentheses in nodename +You cannot use parentheses in node names, because a node name such as +@samp{(foo)bar} is interpreted by the Info readers as a node +@samp{bar} in an Info file @file{foo}. + @item @cindex Apostrophe in nodename @cindex Colon in nodename @cindex Comma in nodename @cindex Period in nodename @cindex Characters, invalid in node name @cindex Invalid characters in node names Unfortunately, you cannot use periods, commas, colons or apostrophes -within a node name; these confuse @TeX{} or the Info formatters.@refill +within a node name; these confuse @TeX{} or the Info formatters. @need 700 For example, the following is a section title: @smallexample @@code@{@@@@unnumberedsec@}, @@code@{@@@@appendixsec@}, @@code@{@@@@heading@} @end smallexample @noindent The corresponding node name is: @smallexample unnumberedsec appendixsec heading @end smallexample @cindex Case in nodename @item Case is significant. @end itemize @node First Node, makeinfo top command, Node Line Requirements, node @comment node-name, next, previous, up @subsection The First Node @cindex Top node is first @cindex First node The first node of a Texinfo file is the @dfn{Top} node, except in an included file (@pxref{Include Files}). The Top node contains the main or master menu for the document, and a short summary of the document (@pxref{Top Node Summary}). @cindex Up node of Top node @cindex (dir) as Up node of Top node The Top node (which must be named @samp{top} or @samp{Top}) should have as its `Up' node the name of a node in another file, where there is a menu that leads to this file. Specify the file name in parentheses. If the file is to be installed directly in the Info directory file, use @samp{(dir)} as the parent of the Top node; this is short for @samp{(dir)top}, and specifies the Top node in the @file{dir} file, which contains the main menu for the Info system as a whole. For example, the @code{@@node Top} line of this manual looks like this: @example @@node Top, Copying, , (dir) @end example @noindent (You can use the Texinfo updating commands or the @code{makeinfo} utility to insert these pointers automatically.) @cindex Previous node of Top node Do not define the `Previous' node of the Top node to be @samp{(dir)}, as it causes confusing behavior for users: if you are in the Top node and hits @key{DEL} to go backwards, you wind up in the middle of the some other entry in the @file{dir} file, which has nothing to do with what you were reading. -@xref{Install an Info File}, for more information about installing +@xref{Installing an Info File}, for more information about installing an Info file in the @file{info} directory. @node makeinfo top command, Top Node Summary, First Node, node @comment node-name, next, previous, up @subsection The @code{@@top} Sectioning Command @findex top @r{(@@-command)} A special sectioning command, @code{@@top}, has been created for use with the @code{@@node Top} line. The @code{@@top} sectioning command tells @code{makeinfo} that it marks the `Top' node in the file. It provides the information that @code{makeinfo} needs to insert node pointers automatically. Write the @code{@@top} command at the beginning of the line immediately following the @code{@@node Top} line. Write the title on the remaining part of the same line as the @code{@@top} command.@refill In Info, the @code{@@top} sectioning command causes the title to appear on a line by itself, with a line of asterisks inserted underneath.@refill In @TeX{} and @code{texinfo-format-buffer}, the @code{@@top} sectioning command is merely a synonym for @code{@@unnumbered}. Neither of these formatters require an @code{@@top} command, and do nothing special with it. You can use @code{@@chapter} or @code{@@unnumbered} after the @code{@@node Top} line when you use 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 @subsection The `Top' Node Summary @cindex @samp{@r{Top}} node summary You can help readers by writing a summary in the `Top' node, after the @code{@@top} line, before the main or master menu. The summary should briefly describe the document. In Info, this summary will appear just before the master menu. In a printed manual, this summary will appear on a page of its own.@refill If you do not want the summary to appear on a page of its own in a printed manual, you can enclose the whole of the `Top' node, including the @code{@@node Top} line and the @code{@@top} sectioning command line or other sectioning command line between @code{@@ifinfo} and @code{@@end ifinfo}. This prevents any of the text from appearing in the printed output. (@pxref{Conditionals, , Conditionally Visible Text}). You can repeat the brief description from the `Top' node within @code{@@iftex} @dots{} @code{@@end iftex} at the beginning of the first chapter, for those who read the printed manual. This saves paper and may look neater.@refill You should write the version number of the program to which the manual applies in the summary. This helps the reader keep track of which manual is for which version of the program. If the manual changes more frequently than the program or is independent of it, you should also 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 @section Creating Pointers with @code{makeinfo} @cindex Creating pointers with @code{makeinfo} @cindex Pointer creation with @code{makeinfo} @cindex Automatic pointer creation with @code{makeinfo} The @code{makeinfo} program has a feature for automatically defining node pointers for a hierarchically organized file. When you take advantage of this feature, you do not need to write the `Next', `Previous', and `Up' pointers after the name of a node. However, you must write a sectioning command, such as @code{@@chapter} or @code{@@section}, on the line immediately following each truncated @code{@@node} line (except that comment lines may intervene). In addition, you must follow the `Top' @code{@@node} line with a line beginning with @code{@@top} to mark the `Top' node in the file. @xref{makeinfo top, , @code{@@top}}. Finally, you must write the name of each node (except for the `Top' node) in a menu that is one or more hierarchical levels above the node's hierarchical level. This node pointer insertion feature in @code{makeinfo} relieves you from the need to update menus and pointers manually or with Texinfo mode commands. (@xref{Updating Nodes and Menus}.) +In most cases, you will want to take advantage of this feature and not +redundantly specify node pointers. However, Texinfo documents are not +required to be organized hierarchically or in fact contain sectioning +commands at all. For example, if you never intend the document to be +printed. In those cases, you will need to explicitly specify the pointers. + @node anchor @section @code{@@anchor}: Defining Arbitrary Cross-reference Targets @findex anchor @cindex Anchors @cindex Cross-reference targets, arbitrary @cindex Targets for cross-references, arbitrary An @dfn{anchor} is a position in your document, labeled so that cross-references can refer to it, just as they can to nodes. You create an anchor with the @code{@@anchor} command, and give the label as a normal brace-delimited argument. For example: @example This marks the @@anchor@{x-spot@}spot. @dots{} @@xref@{x-spot,,the spot@}. @end example @noindent produces: @example This marks the spot. @dots{} See [the spot], page 1. @end example As you can see, the @code{@@anchor} command itself produces no output. This example defines an anchor `x-spot' just before the word `spot'. You can refer to it later with an @code{@@xref} or other cross-reference command, as shown. @xref{Cross References}, for details on the cross-reference commands. It is best to put @code{@@anchor} commands just before the position you wish to refer to; that way, the reader's eye is led on to the correct text when they jump to the anchor. You can put the @code{@@anchor} command on a line by itself if that helps readability of the source. Spaces are always ignored after @code{@@anchor}. Anchor names and node names may not conflict. Anchors and nodes are given similar treatment in some ways; for example, the @code{goto-node} command in standalone Info takes either an anchor name or a node name as an argument. (@xref{goto-node,,,info-stnd,GNU Info}.) @node Menus @chapter Menus @cindex Menus @findex menu @dfn{Menus} contain pointers to subordinate nodes.@footnote{Menus can carry you to any node, regardless of the hierarchical structure; even to nodes in a different Info file. However, the GNU Emacs Texinfo mode updating commands work only to create menus of subordinate nodes. Conventionally, cross references are used to refer to other nodes.} In Info, you use menus to go to such nodes. Menus have no effect in printed manuals and do not appear in them. By convention, a menu is put at the end of a node since a reader who uses the menu may not see text that follows it. Furthermore, a node that has a menu should not contain much text. If you have a lot of text and a menu, move most of the text into a new subnode---all but a few lines. Otherwise, a reader with a terminal that displays only a few lines may miss the menu and its associated text. As a practical matter, you should locate a menu within 20 lines of the beginning of the node. @menu * Menu Location:: Put a menu in a short node. * Writing a Menu:: What is a menu? * Menu Parts:: A menu entry has three parts. * Less Cluttered Menu Entry:: Two part menu entry. * Menu Example:: Two and three part menu entries. * Other Info Files:: How to refer to a different Info file. @end menu @node Menu Location, Writing a Menu, Menus, Menus @ifinfo @heading Menus Need Short Nodes @end ifinfo @cindex Menu location @cindex Location of menus @cindex Nodes for menus are short @cindex Short nodes for menus The short text before a menu may look awkward in a printed manual. To avoid this, you can write a menu near the beginning of its node and follow the menu by an @code{@@node} line, and then an @code{@@heading} line located within @code{@@ifinfo} and @code{@@end ifinfo}. This way, the menu, @code{@@node} line, and title appear only in the Info file, not the printed document.@refill For example, the preceding two paragraphs follow an Info-only menu, @code{@@node} line, and heading, and look like this:@refill @example @group @@menu * Menu Location:: Put a menu in a short node. * Writing a Menu:: What is a 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 Info file. @@end menu @@node Menu Location, Writing a Menu, , Menus @@ifinfo @@heading Menus Need Short Nodes @@end ifinfo @end group @end example The Texinfo file for this document contains more than a dozen examples of this procedure. One is at the beginning of this chapter; another is at the beginning of @ref{Cross References}. @refill @node Writing a Menu, Menu Parts, Menu Location, Menus @section Writing a Menu @cindex Writing a menu @cindex Menu writing A menu consists of an @code{@@menu} command on a line by itself followed by menu entry lines or menu comment lines and then by an @code{@@end menu} command on a line by itself.@refill A menu looks like this:@refill @example @group @@menu Larger Units of Text * Files:: All about handling files. * Multiples: Buffers. Multiple buffers; editing several files at once. @@end menu @end group @end example In a menu, every line that begins with an @w{@samp{* }} is a @dfn{menu entry}. (Note the space after the asterisk.) A line that does not start with an @w{@samp{* }} may also appear in a menu. Such a line is not a menu entry but is a menu comment line that appears in the Info file. In the example above, the line @samp{Larger Units of Text} is a menu comment line; the two lines starting with @w{@samp{* }} are menu @cindex Spaces, in menus entries. Space characters in a menu are preserved as-is; this allows you to format the menu as you wish. @node Menu Parts, Less Cluttered Menu Entry, Writing a Menu, Menus @section The Parts of a Menu @cindex Parts of a menu @cindex Menu parts @cindex @code{@@menu} parts A menu entry has three parts, only the second of which is required: @enumerate @item The menu entry name (optional). @item The name of the node (required). @item A description of the item (optional). @end enumerate The template for a menu entry looks like this:@refill @example * @var{menu-entry-name}: @var{node-name}. @var{description} @end example Follow the menu entry name with a single colon and follow the node name with tab, comma, period, or newline.@refill In Info, a user selects a node with the @kbd{m} (@code{Info-menu}) command. The menu entry name is what the user types after the @kbd{m} command.@refill The third part of a menu entry is a descriptive phrase or sentence. Menu entry names and node names are often short; the description explains to the reader what the node is about. A useful description complements the node name rather than repeats it. The description, which is optional, can spread over two or more lines; if it does, some authors prefer to indent the second line while others prefer to align it with the first (and all others). It's up to you. @node Less Cluttered Menu Entry, Menu Example, Menu Parts, Menus @comment node-name, next, previous, up @section Less Cluttered Menu Entry @cindex Two part menu entry @cindex Double-colon menu entries @cindex Menu entries with two colons @cindex Less cluttered menu entry @cindex Uncluttered menu entry When the menu entry name and node name are the same, you can write the name immediately after the asterisk and space at the beginning of the line and follow the name with two colons.@refill @need 800 For example, write @example * Name:: @var{description} @end example @need 800 @noindent instead of @example * Name: Name. @var{description} @end example You should use the node name for the menu entry name whenever possible, since it reduces visual clutter in the menu.@refill @node Menu Example, Other Info Files, Less Cluttered Menu Entry, Menus @comment node-name, next, previous, up @section A Menu Example @cindex Menu example @cindex Example menu A menu looks like this in Texinfo:@refill @example @group @@menu * menu entry name: Node name. A short description. * Node name:: This form is preferred. @@end menu @end group @end example @need 800 @noindent This produces: @example @group * menu: * menu entry name: Node name. A short description. * Node name:: This form is preferred. @end group @end example @need 700 Here is an example as you might see it in a Texinfo file:@refill @example @group @@menu Larger Units of Text * Files:: All about handling files. * Multiples: Buffers. Multiple buffers; editing several files at once. @@end menu @end group @end example @need 800 @noindent This produces: @example @group * menu: Larger Units of Text * Files:: All about handling files. * Multiples: Buffers. Multiple buffers; editing several files at once. @end group @end example In this example, the menu has two entries. @samp{Files} is both a menu entry name and the name of the node referred to by that name. @samp{Multiples} is the menu entry name; it refers to the node named @samp{Buffers}. The line @samp{Larger Units of Text} is a comment; it appears in the menu, but is not an entry.@refill 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 @comment node-name, next, previous, up @section Referring to Other Info Files @cindex Referring to other Info files @cindex Nodes in other Info files @cindex Other Info files' nodes @cindex Going to other Info files' nodes @cindex Info; other files' nodes You can create a menu entry that enables a reader in Info to go to a node in another Info file by writing the file name in parentheses just before the node name. In this case, you should use the three-part menu entry format, which saves the reader from having to type the file name.@refill @need 800 The format looks like this:@refill @example @group @@menu * @var{first-entry-name}:(@var{filename})@var{nodename}. @var{description} * @var{second-entry-name}:(@var{filename})@var{second-node}. @var{description} @@end menu @end group @end example For example, to refer directly to the @samp{Outlining} and @samp{Rebinding} nodes in the @cite{Emacs Manual}, you would write a menu like this:@refill @example @group @@menu * Outlining: (emacs)Outline Mode. The major mode for editing outlines. * Rebinding: (emacs)Rebinding. How to redefine the meaning of a key. @@end menu @end group @end example If you do not list the node name, but only name the file, then Info presumes that you are referring to the `Top' node.@refill The @file{dir} file that contains the main menu for Info has menu entries that list only file names. These take you directly to the `Top' -nodes of each Info document. (@xref{Install an Info File}.)@refill +nodes of each Info document. (@xref{Installing an Info File}.) @need 700 For example: @example @group * Info: (info). Documentation browsing system. * Emacs: (emacs). The extensible, self-documenting text editor. @end group @end example @noindent (The @file{dir} top level directory for the Info system is an Info file, not a Texinfo file, but a menu entry looks the same in both types of file.)@refill The GNU Emacs Texinfo mode menu updating commands only work with nodes within the current buffer, so you cannot use them to create menus that refer to other files. You must write such menus by hand. @node Cross References @chapter Cross References @cindex Making cross references @cindex Cross references @cindex References @dfn{Cross references} are used to refer the reader to other parts of the same or different Texinfo files. In Texinfo, nodes and anchors are the places to which cross references can refer. @menu * References:: What cross references are for. * Cross Reference Commands:: A summary of the different commands. * Cross Reference Parts:: A cross reference has several parts. * xref:: Begin a reference with `See' @dots{} * Top Node Naming:: How to refer to the beginning of another file. * ref:: A reference for the last part of a sentence. * pxref:: How to write a parenthetical cross reference. * inforef:: How to refer to an Info-only file. * uref:: How to refer to a uniform resource locator. @end menu @node References, Cross Reference Commands, Cross References, Cross References @ifinfo @heading What References Are For @end ifinfo Often, but not always, a printed document should be designed so that it can be read sequentially. People tire of flipping back and forth to find information that should be presented to them as they need it.@refill However, in any document, some information will be too detailed for the current context, or incidental to it; use cross references to provide access to such information. Also, an online help system or a reference manual is not like a novel; few read such documents in sequence from beginning to end. Instead, people look up what they need. For this reason, such creations should contain many cross references to help readers find other information that they may not have read.@refill In a printed manual, a cross reference results in a page reference, unless it is to another manual altogether, in which case the cross reference names that manual.@refill In Info, a cross reference results in an entry that you can follow using the Info @samp{f} command. (@inforef{Help-Adv, Some advanced Info commands, info}.)@refill The various cross reference commands use nodes (or anchors, @pxref{anchor,,@code{@@anchor}}) to define cross reference locations. This is evident in Info, in which a cross reference takes you to the specified location. @TeX{} also uses nodes to define cross reference locations, but the action is less obvious. When @TeX{} generates a DVI file, it records each node's page number and uses the page numbers in making references. Thus, if you are writing a manual that will only be printed, and will not be used online, you must nonetheless write @code{@@node} lines to name the places to which you make cross references.@refill @need 800 @node Cross Reference Commands, Cross Reference Parts, References, Cross References @comment node-name, next, previous, up @section Different Cross Reference Commands @cindex Different cross reference commands There are four different cross reference commands:@refill @table @code @item @@xref Used to start a sentence in the printed manual saying @w{`See @dots{}'} or an Info cross-reference saying @samp{*Note @var{name}: @var{node}.}. @item @@ref Used within or, more often, at the end of a sentence; same as @code{@@xref} for Info; produces just the reference in the printed manual without a preceding `See'.@refill @item @@pxref Used within parentheses to make a reference that suits both an Info file and a printed book. Starts with a lower case `see' within the printed manual. (@samp{p} is for `parenthesis'.)@refill @item @@inforef Used to make a reference to an Info file for which there is no printed manual.@refill @end table @noindent (The @code{@@cite} command is used to make references to books and manuals for which there is no corresponding Info file and, therefore, no node to which to point. @xref{cite, , @code{@@cite}}.)@refill @node Cross Reference Parts, xref, Cross Reference Commands, Cross References @comment node-name, next, previous, up @section Parts of a Cross Reference @cindex Cross reference parts @cindex Parts of a cross reference A cross reference command requires only one argument, which is the name of the node to which it refers. But a cross reference command may contain up to four additional arguments. By using these arguments, you can provide a cross reference name for Info, a topic description or section title for the printed output, the name of a different Info file, and the name of a different printed manual.@refill Here is a simple cross reference example:@refill @example @@xref@{Node name@}. @end example @noindent which produces @example *Note Node name::. @end example @noindent and @quotation See Section @var{nnn} [Node name], page @var{ppp}. @end quotation @need 700 Here is an example of a full five-part cross reference:@refill @example @group @@xref@{Node name, Cross Reference Name, Particular Topic, info-file-name, A Printed Manual@}, for details. @end group @end example @noindent which produces @example *Note Cross Reference Name: (info-file-name)Node name, for details. @end example @noindent in Info and @quotation See section ``Particular Topic'' in @i{A Printed Manual}, for details. @end quotation @noindent in a printed book. The five possible arguments for a cross reference are:@refill @enumerate @item The node or anchor name (required). This is the location to which the cross reference takes you. In a printed document, the location of the node provides the page reference only for references within the same document.@refill @item The cross reference name for the Info reference, if it is to be different from the node name. If you include this argument, it becomes the first part of the cross reference. It is usually omitted.@refill @item A topic description or section name. Often, this is the title of the section. This is used as the name of the reference in the printed manual. If omitted, the node name is used.@refill @item The name of the Info file in which the reference is located, if it is different from the current file. You need not include any @samp{.info} suffix on the file name, since Info readers try appending it automatically. @item The name of a printed manual from a different Texinfo file.@refill @end enumerate The template for a full five argument cross reference looks like this:@refill @example @group @@xref@{@var{node-name}, @var{cross-reference-name}, @var{title-or-topic}, @var{info-file-name}, @var{printed-manual-title}@}. @end group @end example Cross references with one, two, three, four, and five arguments are described separately following the description of @code{@@xref}.@refill Write a node name in a cross reference in exactly the same way as in the @code{@@node} line, including the same capitalization; otherwise, the formatters may not find the reference.@refill You can write cross reference commands within a paragraph, but note how Info and @TeX{} format the output of each of the various commands: write @code{@@xref} at the beginning of a sentence; write @code{@@pxref} only within parentheses, and so on.@refill @node xref, Top Node Naming, Cross Reference Parts, Cross References @comment node-name, next, previous, up @section @code{@@xref} @findex xref @cindex Cross references using @code{@@xref} @cindex References using @code{@@xref} The @code{@@xref} command generates a cross reference for the beginning of a sentence. The Info formatting commands convert it into an Info cross reference, which the Info @samp{f} command can use to bring you directly to another node. The @TeX{} typesetting commands convert it into a page reference, or a reference to another book or manual.@refill @menu * Reference Syntax:: What a reference looks like and requires. * One Argument:: @code{@@xref} with one argument. * Two Arguments:: @code{@@xref} with two arguments. * Three Arguments:: @code{@@xref} with three arguments. * Four and Five Arguments:: @code{@@xref} with four and five arguments. @end menu @node Reference Syntax, One Argument, xref, xref @ifinfo @subheading What a Reference Looks Like and Requires @end ifinfo Most often, an Info cross reference looks like this:@refill @example *Note @var{node-name}::. @end example @noindent or like this @example *Note @var{cross-reference-name}: @var{node-name}. @end example @noindent In @TeX{}, a cross reference looks like this: @quotation See Section @var{section-number} [@var{node-name}], page @var{page}. @end quotation @noindent or like this @quotation See Section @var{section-number} [@var{title-or-topic}], page @var{page}. @end quotation The @code{@@xref} command does not generate a period or comma to end the cross reference in either the Info file or the printed output. You must write that period or comma yourself; otherwise, Info will not recognize the end of the reference. (The @code{@@pxref} command works differently. @xref{pxref, , @code{@@pxref}}.)@refill @quotation @strong{Please note:} A period or comma @strong{must} follow the closing brace of an @code{@@xref}. It is required to terminate the cross reference. This period or comma will appear in the output, both in the Info file and in the printed manual.@refill @end quotation @code{@@xref} must refer to an Info node by name. Use @code{@@node} to define the node (@pxref{Writing a Node}).@refill @code{@@xref} is followed by several arguments inside braces, separated by commas. Whitespace before and after these commas is ignored.@refill A cross reference requires only the name of a node; but it may contain up to four additional arguments. Each of these variations produces a cross reference that looks somewhat different.@refill @quotation @strong{Please note:} Commas separate arguments in a cross reference; avoid including them in the title or other part lest the formatters mistake them for separators.@refill @end quotation @node One Argument, Two Arguments, Reference Syntax, xref @subsection @code{@@xref} with One Argument The simplest form of @code{@@xref} takes one argument, the name of another node in the same Info file. The Info formatters produce output that the Info readers can use to jump to the reference; @TeX{} produces output that specifies the page and section number for you.@refill @need 700 @noindent For example, @example @@xref@{Tropical Storms@}. @end example @noindent produces @example *Note Tropical Storms::. @end example @noindent and @quotation See Section 3.1 [Tropical Storms], page 24. @end quotation @noindent (Note that in the preceding example the closing brace is followed by a period.)@refill You can write a clause after the cross reference, like this:@refill @example @@xref@{Tropical Storms@}, for more info. @end example @noindent which produces @example *Note Tropical Storms::, for more info. @end example @noindent and @quotation See Section 3.1 [Tropical Storms], page 24, for more info. @end quotation @noindent (Note that in the preceding example the closing brace is followed by a comma, and then by the clause, which is followed by a period.)@refill @node Two Arguments, Three Arguments, One Argument, xref @subsection @code{@@xref} with Two Arguments With two arguments, the second is used as the name of the Info cross reference, while the first is still the name of the node to which the cross reference points.@refill @need 750 @noindent The template is like this: @example @@xref@{@var{node-name}, @var{cross-reference-name}@}. @end example @need 700 @noindent For example, @example @@xref@{Electrical Effects, Lightning@}. @end example @noindent produces: @example *Note Lightning: Electrical Effects. @end example @noindent and @quotation See Section 5.2 [Electrical Effects], page 57. @end quotation @noindent (Note that in the preceding example the closing brace is followed by a period; and that the node name is printed, not the cross reference name.) You can write a clause after the cross reference, like this:@refill @example @@xref@{Electrical Effects, Lightning@}, for more info. @end example @noindent which produces @example *Note Lightning: Electrical Effects, for more info. @end example @noindent and @quotation See Section 5.2 [Electrical Effects], page 57, for more info. @end quotation @noindent (Note that in the preceding example the closing brace is followed by a comma, and then by the clause, which is followed by a period.)@refill @node Three Arguments, Four and Five Arguments, Two Arguments, xref @subsection @code{@@xref} with Three Arguments A third argument replaces the node name in the @TeX{} output. The third argument should be the name of the section in the printed output, or else state the topic discussed by that section. Often, you will want to use initial upper case letters so it will be easier to read when the reference is printed. Use a third argument when the node name is unsuitable because of syntax or meaning.@refill Remember to avoid placing a comma within the title or topic section of a cross reference, or within any other section. The formatters divide cross references into arguments according to the commas; a comma within a title or other section will divide it into two arguments. In a reference, you need to write a title such as ``Clouds, Mist, and Fog'' without the commas.@refill Also, remember to write a comma or period after the closing brace of an @code{@@xref} to terminate the cross reference. In the following examples, a clause follows a terminating comma.@refill @need 750 @noindent The template is like this: @example @group @@xref@{@var{node-name}, @var{cross-reference-name}, @var{title-or-topic}@}. @end group @end example @need 700 @noindent For example, @example @group @@xref@{Electrical Effects, Lightning, Thunder and Lightning@}, for details. @end group @end example @noindent produces @example *Note Lightning: Electrical Effects, for details. @end example @noindent and @quotation See Section 5.2 [Thunder and Lightning], page 57, for details. @end quotation If a third argument is given and the second one is empty, then the third argument serves both. (Note how two commas, side by side, mark the empty second argument.)@refill @example @group @@xref@{Electrical Effects, , Thunder and Lightning@}, for details. @end group @end example @noindent produces @example *Note Thunder and Lightning: Electrical Effects, for details. @end example @noindent and @quotation See Section 5.2 [Thunder and Lightning], page 57, for details. @end quotation As a practical matter, it is often best to write cross references with just the first argument if the node name and the section title are the same, and with the first and third arguments if the node name and title are different.@refill Here are several examples from @cite{The GNU Awk User's Guide}:@refill @smallexample @@xref@{Sample Program@}. @@xref@{Glossary@}. @@xref@{Case-sensitivity, ,Case-sensitivity in Matching@}. @@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 @subsection @code{@@xref} with Four and Five Arguments In a cross reference, a fourth argument specifies the name of another Info file, different from the file in which the reference appears, and a fifth argument specifies its title as a printed manual.@refill Remember that a comma or period must follow the closing brace of an @code{@@xref} command to terminate the cross reference. In the following examples, a clause follows a terminating comma.@refill @need 800 @noindent The template is: @example @group @@xref@{@var{node-name}, @var{cross-reference-name}, @var{title-or-topic}, @var{info-file-name}, @var{printed-manual-title}@}. @end group @end example @need 700 @noindent For example, @example @@xref@{Electrical Effects, Lightning, Thunder and Lightning, weather, An Introduction to Meteorology@}, for details. @end example @noindent produces @example *Note Lightning: (weather)Electrical Effects, for details. @end example @noindent The name of the Info file is enclosed in parentheses and precedes the name of the node. @noindent In a printed manual, the reference looks like this:@refill @quotation See section ``Thunder and Lightning'' in @i{An Introduction to Meteorology}, for details. @end quotation @noindent The title of the printed manual is typeset in italics; and the reference lacks a page number since @TeX{} cannot know to which page a reference refers when that reference is to another manual.@refill Often, you will leave out the second argument when you use the long version of @code{@@xref}. In this case, the third argument, the topic description, will be used as the cross reference name in Info.@refill @noindent The template looks like this: @example @@xref@{@var{node-name}, , @var{title-or-topic}, @var{info-file-name}, @var{printed-manual-title}@}, for details. @end example @noindent which produces @example *Note @var{title-or-topic}: (@var{info-file-name})@var{node-name}, for details. @end example @noindent and @quotation See section @var{title-or-topic} in @var{printed-manual-title}, for details. @end quotation @need 700 @noindent For example, @example @@xref@{Electrical Effects, , Thunder and Lightning, weather, An Introduction to Meteorology@}, for details. @end example @noindent produces @example @group *Note Thunder and Lightning: (weather)Electrical Effects, for details. @end group @end example @noindent and @quotation See section ``Thunder and Lightning'' in @i{An Introduction to Meteorology}, for details. @end quotation On rare occasions, you may want to refer to another Info file that is within a single printed manual---when multiple Texinfo files are incorporated into the same @TeX{} run but make separate Info files. In this case, you need to specify only the fourth argument, and not the fifth.@refill @node Top Node Naming, ref, xref, Cross References @section Naming a `Top' Node @cindex Naming a `Top' Node in references @cindex @samp{@r{Top}} node naming for references In a cross reference, you must always name a node. This means that in order to refer to a whole manual, you must identify the `Top' node by writing it as the first argument to the @code{@@xref} command. (This is different from the way you write a menu entry; see @ref{Other Info Files, , Referring to Other Info Files}.) At the same time, to provide a meaningful section topic or title in the printed cross reference (instead of the word `Top'), you must write an appropriate entry for the third argument to the @code{@@xref} command. @refill @noindent Thus, to make a cross reference to @cite{The GNU Make Manual}, write:@refill @example @@xref@{Top, , Overview, make, The GNU Make Manual@}. @end example @noindent which produces @example *Note Overview: (make)Top. @end example @noindent and @quotation See section ``Overview'' in @i{The GNU Make Manual}. @end quotation @noindent In this example, @samp{Top} is the name of the first node, and @samp{Overview} is the name of the first section of the manual.@refill @node ref, pxref, Top Node Naming, Cross References @comment node-name, next, previous, up @section @code{@@ref} @cindex Cross references using @code{@@ref} @cindex References using @code{@@ref} @findex ref @code{@@ref} is nearly the same as @code{@@xref} except that it does not generate a `See' in the printed output, just the reference itself. This makes it useful as the last part of a sentence.@refill @need 700 @noindent For example, @cindex Hurricanes @example For more information, see @@ref@{Hurricanes@}. @end example @noindent produces @example For more information, see *Note Hurricanes::. @end example @noindent and @quotation For more information, see Section 8.2 [Hurricanes], page 123. @end quotation The @code{@@ref} command sometimes leads writers to express themselves in a manner that is suitable for a printed manual but looks awkward in the Info format. Bear in mind that your audience will be using both the printed and the Info format.@refill @need 800 @noindent For example, @cindex Sea surges @example @group Sea surges are described in @@ref@{Hurricanes@}. @end group @end example @need 800 @noindent produces @quotation Sea surges are described in Section 6.7 [Hurricanes], page 72. @end quotation @need 800 @noindent in a printed document, and the following in Info: @example Sea surges are described in *Note Hurricanes::. @end example @quotation @strong{Caution:} You @emph{must} write a period, comma, or right parenthesis immediately after an @code{@@ref} command with two or more arguments. Otherwise, Info will not find the end of the cross reference entry and its attempt to follow the cross reference will fail. As a general rule, you should write a period or comma after every @code{@@ref} command. This looks best in both the printed and the Info output.@refill @end quotation @node pxref, inforef, ref, Cross References @comment node-name, next, previous, up @section @code{@@pxref} @cindex Cross references using @code{@@pxref} @cindex References using @code{@@pxref} @findex pxref The parenthetical reference command, @code{@@pxref}, is nearly the same as @code{@@xref}, but you use it @emph{only} inside parentheses and you do @emph{not} type a comma or period after the command's closing brace. The command differs from @code{@@xref} in two ways:@refill @enumerate @item @TeX{} typesets the reference for the printed manual with a lower case `see' rather than an upper case `See'.@refill @item The Info formatting commands automatically end the reference with a closing colon or period.@refill @end enumerate Because one type of formatting automatically inserts closing punctuation and the other does not, you should use @code{@@pxref} @emph{only} inside parentheses as part of another sentence. Also, you yourself should not insert punctuation after the reference, as you do with @code{@@xref}.@refill @code{@@pxref} is designed so that the output looks right and works right between parentheses both in printed output and in an Info file. In a printed manual, a closing comma or period should not follow a cross reference within parentheses; such punctuation is wrong. But in an Info file, suitable closing punctuation must follow the cross reference so Info can recognize its end. @code{@@pxref} spares you the need to use complicated methods to put a terminator into one form of the output and not the other.@refill @noindent With one argument, a parenthetical cross reference looks like this:@refill @cindex Flooding @example @dots{} storms cause flooding (@@pxref@{Hurricanes@}) @dots{} @end example @need 800 @noindent which produces @example @group @dots{} storms cause flooding (*Note Hurricanes::) @dots{} @end group @end example @noindent and @quotation @dots{} storms cause flooding (see Section 6.7 [Hurricanes], page 72) @dots{} @end quotation With two arguments, a parenthetical cross reference has this template:@refill @example @dots{} (@@pxref@{@var{node-name}, @var{cross-reference-name}@}) @dots{} @end example @noindent which produces @example @dots{} (*Note @var{cross-reference-name}: @var{node-name}.) @dots{} @end example @noindent and @need 1500 @quotation @dots{} (see Section @var{nnn} [@var{node-name}], page @var{ppp}) @dots{} @end quotation @code{@@pxref} can be used with up to five arguments just like @code{@@xref} (@pxref{xref, , @code{@@xref}}).@refill @quotation @strong{Please note:} Use @code{@@pxref} only as a parenthetical reference. Do not try to use @code{@@pxref} as a clause in a sentence. It will look bad in either the Info file, the printed output, or both.@refill Also, parenthetical cross references look best at the ends of sentences. Although you may write them in the middle of a sentence, that location breaks up the flow of text.@refill @end quotation @node inforef, uref, pxref, Cross References @section @code{@@inforef} @cindex Cross references using @code{@@inforef} @cindex References using @code{@@inforef} @findex inforef @code{@@inforef} is used for cross references to Info files for which there are no printed manuals. Even in a printed manual, @code{@@inforef} generates a reference directing the user to look in an Info file.@refill The command takes either two or three arguments, in the following order:@refill @enumerate @item The node name. @item The cross reference name (optional). @item The Info file name. @end enumerate @noindent Separate the arguments with commas, as with @code{@@xref}. Also, you must terminate the reference with a comma or period after the @samp{@}}, as you do with @code{@@xref}.@refill @noindent The template is: @example @@inforef@{@var{node-name}, @var{cross-reference-name}, @var{info-file-name}@}, @end example @need 800 @noindent Thus, @example @group @@inforef@{Expert, Advanced Info commands, info@}, for more information. @end group @end example @need 800 @noindent produces @example @group *Note Advanced Info commands: (info)Expert, for more information. @end group @end example @need 800 @noindent and @quotation See Info file @file{info}, node @samp{Expert}, for more information. @end quotation @need 800 @noindent Similarly, @example @group @@inforef@{Expert, , info@}, for more information. @end group @end example @need 800 @noindent produces @example *Note (info)Expert::, for more information. @end example @need 800 @noindent and @quotation See Info file @file{info}, node @samp{Expert}, for more information. @end quotation The converse of @code{@@inforef} is @code{@@cite}, which is used to refer to printed works for which no Info form exists. @xref{cite, , @code{@@cite}}.@refill @node uref @section @code{@@uref@{@var{url}[, @var{text}][, @var{replacement}]@}} @findex uref @cindex Uniform resource locator, referring to @cindex URL, referring to @cindex @code{href}, producing HTML @code{@@uref} produces a reference to a uniform resource locator (url). It takes one mandatory argument, the url, and two optional arguments which control the text that is displayed. In HTML output, @code{@@uref} produces a link you can follow. The second argument, if specified, is the text to display (the default is the url itself); in Info and DVI output, but not in HTML output, the url is also output. @cindex Man page, reference to The third argument, on the other hand, if specified is also the text to display, but the url is @emph{not} output in any format. This is useful when the text is already sufficiently referential, as in a man page. If the third argument is given, the second argument is ignored. The simple one argument form, where the url is both the target and the text of the link: @example The official GNU ftp site is @@uref@{ftp://ftp.gnu.org/gnu@}. @end example @noindent produces: @display The official GNU ftp site is @uref{ftp://ftp.gnu.org/gnu}. @end display An example of the two-argument form: @example -The official @@uref@{ftp://ftp.gnu.org/gnu, GNU ftp site@} holds -programs and texts. +The official @@uref@{ftp://ftp.gnu.org/gnu, GNU ftp site@} +holds programs and texts. @end example @noindent produces: @display -The official @uref{ftp://ftp.gnu.org/gnu, GNU ftp site} holds -programs and texts. +The official @uref{ftp://ftp.gnu.org/gnu, GNU ftp site} +holds programs and texts. @end display @noindent that is, the Info output is this: @example -The official GNU ftp site (ftp://ftp.gnu.org/gnu) holds -programs and texts. +The official GNU ftp site (ftp://ftp.gnu.org/gnu) +holds programs and texts. @end example @noindent and the HTML output is this: @example -The official <a href="ftp://ftp.gnu.org/gnu">GNU ftp site</a> holds -programs and texts. +The official <a href="ftp://ftp.gnu.org/gnu">GNU ftp site</a> +holds programs and texts. @end example An example of the three-argument form: @example -The @@uref@{http://example.org/man.cgi/1/ls,,ls(1)@} program @dots{} +The @@uref@{/man.cgi/1/ls,,ls(1)@} program @dots{} @end example @noindent produces: @display -The @uref{http://example.org/man.cgi/1/ls,,ls(1)} program @dots{} +The @uref{/man.cgi/1/ls,,ls(1)} program @dots{} @end display @noindent but with HTML: @example -The <a href="http://example.org/man.cgi/1/ls">ls(1)</a> program @dots{} +The <a href="/man.cgi/1/ls">ls(1)</a> program @dots{} @end example To merely indicate a url without creating a link people can follow, use @code{@@url} (@pxref{url, @code{@@url}}). - Some people prefer to display url's in the unambiguous format: @display <URL:http://@var{host}/@var{path}> @end display @noindent -@cindex <URL: convention, not used +@cindex <URL convention, not used You can use this form in the input file if you wish. We feel it's not necessary to clutter up the output with the extra @samp{<URL:} and @samp{>}, since any software that tries to detect url's in text already has to detect them without the @samp{<URL:} to be useful. @node Marking Text @chapter Marking Words and Phrases @cindex Paragraph, marking text within @cindex Marking words and phrases @cindex Words and phrases, marking them @cindex Marking text within a paragraph @cindex Text, marking up In Texinfo, you can mark words and phrases in a variety of ways. The Texinfo formatters use this information to determine how to highlight the text. You can specify, for example, whether a word or phrase is a defining occurrence, a metasyntactic variable, or a symbol used in a program. Also, you can emphasize text, in several different ways. @menu * Indicating:: How to indicate definitions, files, etc. * Emphasis:: How to emphasize text. @end menu + @node Indicating, Emphasis, Marking Text, Marking Text -@comment node-name, next, previous, up @section Indicating Definitions, Commands, etc. @cindex Highlighting text @cindex Indicating commands, definitions, etc. Texinfo has commands for indicating just what kind of object a piece of text refers to. For example, metasyntactic variables are marked by @code{@@var}, and code by @code{@@code}. Since the pieces of text are labelled by commands that tell what kind of object they are, it is easy 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, code is usually illustrated in a typewriter font; @code{@@code} tells @TeX{} to typeset this text in this font. But it would be easy to change the way @TeX{} highlights code to use another font, and this change would not affect how keystroke examples are highlighted. If straight typesetting commands were used in the body of the file and you wanted to make a change, you would need to check every single occurrence to make sure that you were changing code and not something else that should not be changed.@refill @menu * Useful Highlighting:: Highlighting provides useful information. * code:: Indicating program code. * kbd:: Showing keyboard input. * key:: Specifying keys. -* samp:: Showing a literal sequence of characters. +* samp:: A literal sequence of characters. +* verb:: A verbatim sequence of characters. * var:: Indicating metasyntactic variables. * env:: Indicating environment variables. * file:: Indicating file names. * command:: Indicating command names. * option:: Indicating option names. * dfn:: Specifying definitions. * cite:: Referring to books not in the Info system. * acronym:: Indicating acronyms. * url:: Indicating a World Wide Web reference. * email:: Indicating an electronic mail address. @end menu @node Useful Highlighting, code, Indicating, Indicating @ifinfo @subheading Highlighting Commands are Useful @end ifinfo The highlighting commands can be used to extract useful information from the file, such as lists of functions or file names. It is possible, for example, to write a program in Emacs Lisp (or a keyboard macro) to insert an index entry after every paragraph that contains words or phrases marked by a specified command. You could do this to construct an index of functions if you had not already made the entries.@refill The commands serve a variety of purposes:@refill @table @code @item @@code@{@var{sample-code}@} Indicate text that is a literal example of a piece of a program.@refill @item @@kbd@{@var{keyboard-characters}@} Indicate keyboard input.@refill @item @@key@{@var{key-name}@} Indicate the conventional name for a key on a keyboard.@refill @item @@samp@{@var{text}@} Indicate text that is a literal example of a sequence of characters.@refill @item @@var@{@var{metasyntactic-variable}@} Indicate a metasyntactic variable.@refill @item @@env@{@var{environment-variable}@} Indicate an environment variable.@refill @item @@file@{@var{file-name}@} Indicate the name of a file.@refill @item @@command@{@var{command-name}@} Indicate the name of a command.@refill @item @@option@{@var{option}@} Indicate a command-line option.@refill @item @@dfn@{@var{term}@} Indicate the introductory or defining use of a term.@refill @item @@cite@{@var{reference}@} Indicate the name of a book.@refill @item @@acronym@{@var{acronym}@} Indicate an acronym.@refill @item @@url@{@var{uniform-resource-locator}@} Indicate a uniform resource locator for the World Wide Web. @item @@email@{@var{email-address}[, @var{displayed-text}]@} Indicate an electronic mail address. @ignore @item @@ctrl@{@var{ctrl-char}@} Use for an @sc{ascii} control character.@refill @end ignore @end table @node code @subsection @code{@@code}@{@var{sample-code}@} @findex code @cindex Syntactic tokens, indicating Use the @code{@@code} command to indicate text that is a piece of a program and which consists of entire syntactic tokens. Enclose the text in braces. @cindex Expressions in a program, indicating @cindex Keywords, indicating @cindex Reserved words, indicating Thus, you should use @code{@@code} for an expression in a program, for the name of a variable or function used in a program, or for a keyword in a programming language. Use @code{@@code} for command names in languages that resemble programming languages, such as Texinfo. For example, @code{@@code} and @code{@@samp} are produced by writing @samp{@@code@{@@@@code@}} and @samp{@@code@{@@@@samp@}} in the Texinfo source, respectively. @cindex Case, not altering in @code{@@code} It is incorrect to alter the case of a word inside an @code{@@code} command when it appears at the beginning of a sentence. Most computer languages are case sensitive. In C, for example, @code{Printf} is different from the identifier @code{printf}, and most likely is a misspelling of it. Even in languages which are not case sensitive, it is confusing to a human reader to see identifiers spelled in different ways. Pick one spelling and always use that. If you do not want to start a sentence with a command name written all in lower case, you should rearrange the sentence. In the printed manual, @code{@@code} causes @TeX{} to typeset the argument in a typewriter face. In the Info file, it causes the Info formatting commands to use single quotation marks around the text. @need 700 For example, @example The function returns @@code@{nil@}. @end example @noindent produces this in the printed manual: @quotation The function returns @code{nil}. @end quotation @iftex @noindent and this in the Info file: @example The function returns `nil'. @end example @end iftex Here are some cases for which it is preferable not to use @code{@@code}: @itemize @bullet @item For shell command names such as @command{ls} (use @code{@@command}). @item For shell options such as @samp{-c} when such options stand alone (use @code{@@option}). @item Also, an entire shell command often looks better if written using @code{@@samp} rather than @code{@@code}. In this case, the rule is to choose the more pleasing format. @item For environment variable such as @env{TEXINPUTS} (use @code{@@env}). @item For a string of characters shorter than a syntactic token. For example, if you are writing about @samp{goto-ch}, which is just a part of the name for the @code{goto-char} Emacs Lisp function, you should use @code{@@samp}. @item In general, when writing about the characters used in a token; for example, do not use @code{@@code} when you are explaining what letters or printable symbols can be used in the names of functions. (Use @code{@@samp}.) Also, you should not use @code{@@code} to mark text that is considered input to programs unless the input is written in a language that is like a programming language. For example, you should not use @code{@@code} for the keystroke commands of GNU Emacs (use @code{@@kbd} instead) although you may use @code{@@code} for the names of the Emacs Lisp functions that the keystroke commands invoke. @end itemize Since @code{@@command}, @code{@@option}, and @code{@@env} were introduced relatively recently, it is acceptable to use @code{@@code} or @code{@@samp} for command names, options, and environment variables. The new commands allow you to express the markup more precisely, but there is no real harm in using the older commands, and of course the long-standing manuals do so. @node kbd @subsection @code{@@kbd}@{@var{keyboard-characters}@} @findex kbd @cindex Keyboard input Use the @code{@@kbd} command for characters of input to be typed by users. For example, to refer to the characters @kbd{M-a}, write@refill @example @@kbd@{M-a@} @end example @noindent and to refer to the characters @kbd{M-x shell}, write@refill @example @@kbd@{M-x shell@} @end example @cindex user input @cindex slanted typewriter font, for @code{@@kbd} The @code{@@kbd} command has the same effect as @code{@@code} in Info, but by default produces a different font (slanted typewriter instead of normal typewriter) in the printed manual, so users can distinguish the characters they are supposed to type from those the computer outputs. @findex kbdinputstyle Since the usage of @code{@@kbd} varies from manual to manual, you can control the font switching with the @code{@@kbdinputstyle} command. This command has no effect on Info output. Write this command at the beginning of a line with a single word as an argument, one of the following: @vindex distinct@r{, arg to @@kbdinputstyle} @vindex example@r{, arg to @@kbdinputstyle} @vindex code@r{, arg to @@kbdinputstyle} @table @samp @item code Always use the same font for @code{@@kbd} as @code{@@code}. @item example Use the distinguishing font for @code{@@kbd} only in @code{@@example} and similar environments. @item distinct (the default) Always use the distinguishing font for @code{@@kbd}. @end table You can embed another @@-command inside the braces of an @code{@@kbd} command. Here, for example, is the way to describe a command that would be described more verbosely as ``press an @samp{r} and then press the @key{RET} key'':@refill @example @@kbd@{r @@key@{RET@}@} @end example @noindent This produces: @kbd{r @key{RET}} 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, type the characters @@kbd@{l o g o u t @@key@{RET@}@}. @end example @noindent This produces: @quotation To give the @code{logout} command, type the characters @kbd{l o g o u t @key{RET}}. @end quotation (Also, this example shows that you can add spaces for clarity. If you really want to mention a space character as one of the characters of input, write @kbd{@@key@{SPC@}} for it.)@refill @node key, samp, kbd, Indicating @comment node-name, next, previous, up @subsection @code{@@key}@{@var{key-name}@} @findex key Use the @code{@@key} command for the conventional name for a key on a keyboard, as in:@refill @example @@key@{RET@} @end example You can use the @code{@@key} command within the argument of an @code{@@kbd} command when the sequence of characters to be typed includes one or more keys that are described by name.@refill @need 700 For example, to produce @kbd{C-x @key{ESC}} you would type:@refill @example @@kbd@{C-x @@key@{ESC@}@} @end example Here is a list of the recommended names for keys: @cindex Recommended names for keys @cindex Keys, recommended names @cindex Names recommended for keys @cindex Abbreviations for keys @quotation @table @t @item SPC Space @item RET Return @item LFD 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 Backspace @item ESC Escape @item DEL Delete @item SHIFT Shift @item CTRL Control @item META Meta @end table @end quotation @cindex META key There are subtleties to handling words like `meta' or `ctrl' that are names of modifier keys. When mentioning a character in which the modifier 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 modifier 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}. @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 +@node samp @subsection @code{@@samp}@{@var{text}@} @findex samp Use the @code{@@samp} command to indicate text that is a literal example or `sample' of a sequence of characters in a file, string, pattern, etc. Enclose the text in braces. The argument appears within single 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, use the regexp @@samp@{foo$@}. @end example @noindent produces @quotation To match @samp{foo} at the end of the line, use the regexp @samp{foo$}.@refill @end quotation Any time you are referring to single characters, you should use @code{@@samp} unless @code{@@kbd} or @code{@@key} is more appropriate. Also, you may use @code{@@samp} for entire statements in C and for entire shell commands---in this case, @code{@@samp} often looks better than @code{@@code}. Basically, @code{@@samp} is a catchall for whatever is not covered by @code{@@code}, @code{@@kbd}, or @code{@@key}.@refill Only include punctuation marks within braces if they are part of the string you are specifying. Write punctuation marks outside the braces if those punctuation marks are part of the English text that surrounds the string. In the following sentence, for example, the commas and 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 @@samp@{y@}. @end group @end example @noindent This produces: @quotation In English, the vowels are @samp{a}, @samp{e}, @samp{i}, @samp{o}, @samp{u}, and sometimes @samp{y}. @end quotation +@node verb +@subsection @code{@@verb}@{<char>@var{text}<char>@} +@findex verb +@cindex Verbatim in-line text + +@cindex Delimiter character, for verbatim +Use the @code{@@verb} command to print a verbatim sequence of +characters. + +Like La@TeX{}'s @code{\verb} command, the verbatim text can be quoted using +any unique delimiter character. Enclose the verbatim text, including the +delimiters, in braces. Text is printed in a fixed-width font: + +@example +How many @@verb@{|@@|@}-escapes does one need to print this +@@verb@{.@@a @@b @@c.@} string or @@verb@{+@@'e@?`@!`@{@}\+@} this? +@end example + +@noindent +produces + +@example +How many @verb{|@|}-escapes does one need to print this +@verb{.@a @b @c.} string or these @verb{+@'e?`{}!`\+} this? +@end example + +This is in contrast to @code{@@samp} (see the previous +section), whose argument is normal Texinfo text, where the characters +@code{@@@{@}} are special; with @code{@@verb}, nothing is special except +the delimiter character you choose. + + @node var @subsection @code{@@var}@{@var{metasyntactic-variable}@} @findex var Use the @code{@@var} command to indicate metasyntactic variables. A @dfn{metasyntactic variable} is something that stands for another piece of text. For example, you should use a metasyntactic variable in the documentation of a function to describe the arguments that are passed to that function.@refill Do not use @code{@@var} for the names of particular variables in programming languages. These are specific names from a program, so @code{@@code} is correct for them (@pxref{code}). For example, the Emacs Lisp variable @code{texinfo-tex-command} is not a metasyntactic variable; it is properly formatted using @code{@@code}. Do not use @code{@@var} for environment variables either; @code{@@env} is correct for them (see the next section). The effect of @code{@@var} in the Info file is to change the case of the argument to all upper case. In the printed manual and HTML output, the argument is printed in slanted type. @need 700 For example, @example To delete file @@var@{filename@}, type @@samp@{rm @@var@{filename@}@}. @end example @noindent produces @quotation To delete file @var{filename}, type @samp{rm @var{filename}}. @end quotation @noindent (Note that @code{@@var} may appear inside @code{@@code}, @code{@@samp}, @code{@@file}, etc.)@refill Write a metasyntactic variable all in lower case without spaces, and use hyphens to make it more readable. Thus, the Texinfo source for the illustration of how to begin a Texinfo manual looks like this:@refill @example @group \input texinfo @@@@setfilename @@var@{info-file-name@} @@@@settitle @@var@{name-of-manual@} @end group @end example @noindent This produces: @example @group \input texinfo @@setfilename @var{info-file-name} @@settitle @var{name-of-manual} @end group @end example In some documentation styles, metasyntactic variables are shown with angle brackets, for example:@refill @example @dots{}, type rm <filename> @end example @noindent However, that is not the style that Texinfo uses. (You can, of course, modify the sources to @file{texinfo.tex} and the Info formatting commands to output the @code{<@dots{}>} format if you wish.)@refill @node env @subsection @code{@@env}@{@var{environment-variable}@} @findex env Use the @code{@@env} command to indicate environment variables, as used by many operating systems, including GNU. Do not use it for metasyntactic variables; use @code{@@var} instead (see the previous section). @code{@@env} is equivalent to @code{@@code} in its effects. For example: @example -The @@env@{PATH@} environment variable sets the search path for commands. +The @@env@{PATH@} environment variable @dots{} @end example @noindent produces @quotation -The @env{PATH} environment variable sets the search path for commands. +The @env{PATH} environment variable @dots{} @end quotation @node file @subsection @code{@@file}@{@var{file-name}@} @findex file Use the @code{@@file} command to indicate text that is the name of a file, buffer, or directory, or is the name of a node in Info. You can also use the command for file name suffixes. Do not use @code{@@file} for symbols in a programming language; use @code{@@code}. Currently, @code{@@file} is equivalent to @code{@@samp} in its effects. For example,@refill @example The @@file@{.el@} files are in the @@file@{/usr/local/emacs/lisp@} directory. @end example @noindent produces @quotation The @file{.el} files are in the @file{/usr/local/emacs/lisp} directory. @end quotation @node command @subsection @code{@@command}@{@var{command-name}@} @findex command @cindex Command names, indicating @cindex Program names, indicating Use the @code{@@command} command to indicate command names, such as @command{ls} or @command{cc}. @code{@@command} is equivalent to @code{@@code} in its effects. For example: @example The command @@command@{ls@} lists directory contents. @end example @noindent produces @quotation The command @command{ls} lists directory contents. @end quotation You should write the name of a program in the ordinary text font, rather than using @code{@@command}, if you regard it as a new English word, such as `Emacs' or `Bison'. When writing an entire shell command invocation, as in @samp{ls -l}, you should use either @code{@@samp} or @code{@@code} at your discretion. @node option @subsection @code{@@option}@{@var{option-name}@} @findex option Use the @code{@@option} command to indicate a command-line option; for example, @option{-l} or @option{--version} or @option{--output=@var{filename}}. @code{@@option} is equivalent to @code{@@samp} in its effects. For example: @example The option @@option@{-l@} produces a long listing. @end example @noindent produces @quotation The option @option{-l} produces a long listing. @end quotation In tables, putting options inside @code{@@code} produces a more pleasing effect. @node dfn @comment node-name, next, previous, up @subsection @code{@@dfn}@{@var{term}@} @findex dfn Use the @code{@@dfn} command to identify the introductory or defining use of a technical term. Use the command only in passages whose purpose is to introduce a term which will be used again or which the reader ought to know. Mere passing mention of a term for the first time does not deserve @code{@@dfn}. The command generates italics in the printed manual, and double quotation marks in the Info file. For example:@refill @example Getting rid of a file is called @@dfn@{deleting@} it. @end example @noindent produces @quotation Getting rid of a file is called @dfn{deleting} it. @end quotation As a general rule, a sentence containing the defining occurrence of a 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 @subsection @code{@@cite}@{@var{reference}@} @findex cite Use the @code{@@cite} command for the name of a book that lacks a companion Info file. The command produces italics in the printed manual, and quotation marks in the Info file. 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}}. @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. Usually, in Texinfo, you talk what you type as keyboard entry by describing it with @code{@@kbd}: thus, @samp{@@kbd@{C-a@}} for @kbd{C-a}. Use @code{@@kbd} in this way when talking about a control character that is typed on the keyboard by the user. When talking about a control character appearing in a file or a string, do not use @code{@@kbd} since the control character is not typed. Also, do not use @samp{C-} but spell out @code{control-}, as in @samp{control-a}, to make it easier for a reader to understand.@refill @code{@@ctrl} is an idea from the beginnings of Texinfo which may not really fit in to the scheme of things. But there may be times when you want to use the command. The pattern is @code{@@ctrl@{@var{ch}@}}, where @var{ch} is an @sc{ascii} character whose control-equivalent is wanted. For example, to specify @samp{control-f}, you would enter@refill @example @@ctrl@{f@} @end example @noindent produces @quotation @ctrl{f} @end quotation In the Info file, this generates the specified control character, output literally into the file. This is done so a user can copy the specified control character (along with whatever else he or she wants) into another Emacs buffer and use it. Since the `control-h',`control-i', and `control-j' characters are formatting characters, they should not be indicated with @code{@@ctrl}.@refill In a printed manual, @code{@@ctrl} generates text to describe or identify that control character: an uparrow followed by the character @var{ch}.@refill @end ignore @node acronym @subsection @code{@@acronym}@{@var{acronym}@} @findex acronym @cindex NASA, as acronym @cindex F.B.I., as acronym @cindex Abbreviations, tagging @cindex Acronyms, tagging Use the @code{@@acronym} command for abbreviations written in all capital letters, such as `@acronym{NASA}'. The abbreviation is given as the single argument in braces, as in @samp{@@acronym@{NASA@}}. As a matter of style, or for particular abbreviations, you may prefer to use periods, as in @samp{@@acronym@{F.B.I.@}}. In @TeX{} and HTML, the argument is printed in a slightly smaller font size. In Info or plain text output, this command changes nothing. @node url @subsection @code{@@url}@{@var{uniform-resource-locator}@} @findex url @cindex Uniform resource locator, indicating @cindex URL, indicating Use the @code{@@url} command to indicate a uniform resource locator on the World Wide Web. This is analogous to @code{@@file}, @code{@@var}, etc., and is purely for markup purposes. It does not produce a link you can follow in HTML output (use the @code{@@uref} command for that, @pxref{uref,, @code{@@uref}}). It is useful for url's which do not actually exist. For example: @c Two lines because one is too long for smallbook format. @example For example, the url might be @@url@{http://example.org/path@}. @end example @noindent which produces: @display For example, the url might be @url{http://example.org/path}. @end display @node email @subsection @code{@@email}@{@var{email-address}[, @var{displayed-text}]@} @findex email Use the @code{@@email} command to indicate an electronic mail address. It takes one mandatory argument, the address, and one optional argument, the text to display (the default is the address itself). @cindex mailto link In Info and @TeX{}, the address is shown in angle brackets, preceded by the text to display if any. In HTML output, @code{@@email} produces a @samp{mailto} link that usually brings up a mail composition window. For example: @example -Send bug reports to @@email@{bug-texinfo@@@@gnu.org@}. -Send suggestions to the @@email@{bug-texinfo@@@@gnu.org, same place@}. +Send bug reports to @@email@{bug-texinfo@@@@gnu.org@}, +suggestions to the @@email@{bug-texinfo@@@@gnu.org, same place@}. @end example @noindent produces @display -Send bug reports to @email{bug-texinfo@@gnu.org}. -Send suggestions to the @email{bug-texinfo@@gnu.org, same place}. +Send bug reports to @email{bug-texinfo@@gnu.org}, +suggestions to the @email{bug-texinfo@@gnu.org, same place}. @end display -@node Emphasis, , Indicating, Marking Text +@node Emphasis @comment node-name, next, previous, up @section Emphasizing Text @cindex Emphasizing text Usually, Texinfo changes the font to mark words in the text according to what category the words belong to; an example is the @code{@@code} command. Most often, this is the best way to mark words. However, sometimes you will want to emphasize text without indicating a category. Texinfo has two commands to do this. Also, Texinfo has several commands that specify the font in which @TeX{} will typeset text. These commands have no effect on Info and only one of them, the @code{@@r} command, has any regular use.@refill @menu * emph & strong:: How to emphasize text in Texinfo. * Smallcaps:: How to use the small caps font. * Fonts:: Various font commands for printed output. @end menu @node emph & strong @subsection @code{@@emph}@{@var{text}@} and @code{@@strong}@{@var{text}@} @cindex Emphasizing text, font for @findex emph @findex strong The @code{@@emph} and @code{@@strong} commands are for emphasis; @code{@@strong} is stronger. In printed output, @code{@@emph} produces @emph{italics} and @code{@@strong} produces @strong{bold}. @need 800 For example, @example @group @@quotation @@strong@{Caution:@} @@samp@{rm * .[^.]*@} removes @@emph@{all@} files in the directory. @@end quotation @end group @end example @iftex @noindent produces the following in printed output: @quotation @strong{Caution}: @samp{rm * .[^.]*} removes @emph{all} files in the directory. @end quotation @noindent and the following in Info: @end iftex @ifinfo @noindent produces: @end ifinfo @example *Caution*: `rm * .[^.]*' removes _all_ files in the directory. @end example The @code{@@strong} command is seldom used except to mark what is, in effect, a typographical element, such as the word `Caution' in the preceding example. In the Info output, @code{@@emph} surrounds the text with underscores (@samp{_}), and @code{@@strong} puts asterisks around the text. @quotation @strong{Caution:} Do not use @code{@@strong} with the word @samp{Note}; Info will mistake the combination for a cross reference. Use a phrase such as @strong{Please note} or @strong{Caution} instead. @end quotation @node Smallcaps @subsection @code{@@sc}@{@var{text}@}: The Small Caps Font @cindex Small caps font @findex sc @r{(small caps font)} Use the @samp{@@sc} command to set text in the printed and the HTML output in @sc{a small caps font} and set text in the Info file in upper case letters. Write the text you want to be in small caps (where possible) between braces in lower case, like this: @example The @@sc@{acm@} and @@sc@{ieee@} are technical societies. @end example @noindent This produces: @display The @sc{acm} and @sc{ieee} are technical societies. @end display @TeX{} typesets the small caps font in a manner that prevents the letters from `jumping out at you on the page'. This makes small caps text easier to read than text in all upper case---but it's usually better to use regular mixed case anyway. The Info formatting commands set all small caps text in upper case. In HTML, the text is upper-cased and a smaller font is used to render it. If the text between the braces of an @code{@@sc} command is uppercase, @TeX{} typesets in FULL-SIZE CAPITALS. Use full-size capitals sparingly, if ever, and since it's redundant to mark all-uppercase text with @code{@@sc}, @command{makeinfo} warns about such usage. You may also use the small caps font for a jargon word such as @sc{ato} (a @sc{nasa} word meaning `abort to orbit'). There are subtleties to using the small caps font with a jargon word such as @sc{cdr}, a word used in Lisp programming. In this case, you should use the small caps font when the word refers to the second and subsequent elements of a list (the @sc{cdr} of the list), but you should use @samp{@@code} when the word refers to the Lisp function of the same spelling. @node Fonts @subsection Fonts for Printing, Not Info @cindex Fonts for printing, not for Info @findex i @r{(italic font)} @findex b @r{(bold font)} @findex t @r{(typewriter font)} @findex r @r{(Roman font)} Texinfo provides four font commands that specify font changes in the printed manual but have no effect in the Info file. @code{@@i} requests @i{italic} font (in some versions of @TeX{}, a slanted font is used), @code{@@b} requests @b{bold} face, @code{@@t} requests the @t{fixed-width}, typewriter-style font used by @code{@@code}, and @code{@@r} requests a @r{roman} font, which is the usual font in which text is printed. All four commands apply to an argument that follows, surrounded by braces.@refill Only the @code{@@r} command has much use: in example programs, you can use the @code{@@r} command to convert code comments from the fixed-width font to a roman font. This looks better in printed output.@refill @need 700 For example, @example @group @@lisp (+ 2 2) ; @@r@{Add two plus two.@} @@end lisp @end group @end example @noindent produces @lisp (+ 2 2) ; @r{Add two plus two.} @end lisp 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 +language. + @node Quotations and Examples @chapter Quotations and Examples Quotations and examples are blocks of text consisting of one or more whole paragraphs that are set off from the bulk of the text and treated differently. They are usually indented.@refill In Texinfo, you always begin a quotation or example by writing an @@-command at the beginning of a line by itself, and end it by writing an @code{@@end} command that is also at the beginning of a line by itself. For instance, you begin an example by writing @code{@@example} by itself at the beginning of a line and end the example by writing @code{@@end example} on a line by itself, at the beginning of that -line.@refill +line. @findex end @menu -* 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. -* noindent:: How to prevent paragraph indentation. -* lisp:: How to illustrate Lisp code. +* Block Enclosing Commands:: Different constructs for different purposes. +* quotation:: Writing a quotation. +* example:: Writing an example in a fixed-width font. +* verbatim:: Writing a verbatim example. +* verbatiminclude:: Including a file verbatim. +* lisp:: Illustrating Lisp code. * small:: Forms for @code{@@smallbook}. -* display:: How to write an example in the current font. -* format:: How to write an example that does not narrow - the margins. -* exdent:: How to undo the indentation of a line. -* flushleft & flushright:: How to push text flushleft or flushright. -* cartouche:: How to draw cartouches around examples. +* display:: Writing an example in the current font. +* format:: Writing an example without narrowed margins. +* exdent:: Undo indentation on a line. +* flushleft & flushright:: Pushing text flush left or flush right. +* noindent:: Preventing paragraph indentation. +* cartouche:: Drawing rounded rectangles around examples. @end menu + @node Block Enclosing Commands @section Block Enclosing Commands Here are commands for quotations and examples, explained further in the following sections: @table @code @item @@quotation Indicate text that is quoted. The text is filled, indented, and -printed in a roman font by default.@refill +printed in a roman font by default. @item @@example Illustrate code, commands, and the like. The text is printed -in a fixed-width font, and indented but not filled.@refill +in a fixed-width font, and indented but not filled. + +@item @@verbatim +Mark a piece of text that is to be printed verbatim; no character +substitutions are made and all commands are ignored, until the next +@code{@@end verbatim}. The text is printed in a fixed-width font, +and not indented or filled. Extra spaces and blank lines are +significant, and tabs are expanded. @item @@smallexample Same as @code{@@example}, except that in @TeX{} this command typesets -text in a smaller font for the @code{@@smallbook} format than for the -default 8.5 by 11 inch format. +text in a smaller font. @item @@lisp Like @code{@@example}, but specifically for illustrating Lisp code. The text is printed in a fixed-width font, and indented but not filled. @item @@smalllisp Is to @code{@@lisp} as @code{@@smallexample} is to @code{@@example}. @item @@display Display illustrative text. The text is indented but not filled, and no font is selected (so, by default, the font is roman).@refill @item @@smalldisplay Is to @code{@@display} as @code{@@smallexample} is to @code{@@example}. @item @@format Like @code{@@display} (the text is not filled and no font is selected), but the text is not indented. @item @@smallformat Is to @code{@@format} as @code{@@smallexample} is to @code{@@example}. @end table The @code{@@exdent} command is used within the above constructs to 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 The @code{@@noindent} command may be used after one of the above constructs to prevent the following text from being indented as a new -paragraph.@refill +paragraph. You can use the @code{@@cartouche} command within one of the above constructs to highlight the example or quotation by drawing a box with rounded corners around it. @xref{cartouche, , Drawing Cartouches Around Examples}. @node quotation @section @code{@@quotation} @cindex Quotations @findex quotation The text of a quotation is processed normally except that: @itemize @bullet @item the margins are closer to the center of the page, so the whole of the quotation is indented;@refill @item the first lines of paragraphs are indented no more than other lines;@refill @item in the printed output, interparagraph spacing is reduced.@refill @end itemize @quotation This is an example of text written between an @code{@@quotation} command and an @code{@@end quotation} command. An @code{@@quotation} command is most often used to indicate text that is excerpted from another (real or hypothetical) printed work.@refill @end quotation Write an @code{@@quotation} command as text on a line by itself. This line will disappear from the output. Mark the end of the quotation with a line beginning with and containing only @code{@@end quotation}. The @code{@@end quotation} line will likewise disappear from the output. Thus, the following,@refill @example @@quotation This is a foo. @@end quotation @end example @noindent produces @quotation This is a foo. @end quotation @node example -@section @code{@@example} +@section @code{@@example}: Example Text @cindex Examples, formatting them @cindex Formatting examples @findex example The @code{@@example} command is used to indicate an example that is -not part of the running text, such as computer input or output.@refill +not part of the running text, such as computer input or output. @example @group This is an example of text written between an @code{@@example} command and an @code{@@end example} command. The text is indented but not filled. @end group @group In the printed manual, the text is typeset in a fixed-width font, and extra spaces and blank lines are significant. In the Info file, an analogous result is obtained by indenting each line with five spaces. @end group @end example Write an @code{@@example} command at the beginning of a line by itself. Mark the end of the example with an @code{@@end example} command, also written at the beginning of a line by itself.@refill @need 700 For example, @example @@example mv foo bar @@end example @end example @noindent produces @example mv foo bar @end example The lines containing @code{@@example} and @code{@@end example} will disappear from the output. To make the output look good, you should put a blank line before the @code{@@example} and another blank line after the @code{@@end example}. Note that blank lines inside the beginning @code{@@example} and the ending @code{@@end example} will appear in the output.@refill @quotation -@strong{Caution:} Do not use tabs in the lines of an example (or anywhere -else in Texinfo, for that matter)! @TeX{} treats tabs as single -spaces, and that is not what they look like. This is a problem with -@TeX{}. (If necessary, in Emacs, you can use @kbd{M-x untabify} to -convert tabs in a region to multiple spaces.)@refill +@strong{Caution:} Do not use tabs in the lines of an example or anywhere +else in Texinfo (except in verbatim environments)! The @TeX{} +implementation of Texinfo treats tabs as single spaces, and that is not +what they look like. (If necessary, in Emacs, you can use @kbd{M-x +untabify} to convert tabs in a region to multiple spaces.)@refill @end quotation Examples are often, logically speaking, ``in the middle'' of a paragraph, and the text that continues after an example should not be indented. The @code{@@noindent} command prevents a piece of text from being indented as if it were a new paragraph. @ifinfo (@xref{noindent}.) @end ifinfo (The @code{@@code} command is used for examples of code that are embedded within sentences, not set off from preceding and following text. @xref{code, , @code{@@code}}.) -@node noindent -@section @code{@@noindent} -@findex noindent +@node verbatim +@section @code{@@verbatim}: Literal Text +@findex verbatim +@cindex Verbatim environment -An example or other inclusion can break a paragraph into segments. -Ordinarily, the formatters indent text that follows an example as a new -paragraph. However, you can prevent this by writing @code{@@noindent} -at the beginning of a line by itself preceding the continuation -text.@refill +Use the @code{@@verbatim} environment for printing of text that may +contain special characters or commands that should not be interpreted, +such as computer input or output (@code{@@example} interprets its text +as regular Texinfo commands). This is especially useful for including +automatically generated output in a Texinfo manual. Here is an example; +the output you see is just the same as the input, with a line +@code{@@verbatim} before and a line @code{@@end verbatim} after. + +@verbatim +This is an example of text written in a @verbatim +block. No character substitutions are made all commands +are ignored, until the next 'end verbatim' command. + +In the printed manual, the text is typeset in a +fixed-width font, and not indented or filled. All +spaces and blank lines are significant, including tabs. +@end verbatim + +Write a @code{@@verbatim} command at the beginning of a line by itself. +This line will disappear from the output. Mark the end of the verbatim +block with a @code{@@end verbatim} command, also written at the +beginning of a line by itself. The @code{@@end verbatim} will also +disappear from the output. -@need 1500 For example: +@c urg: got to trick this a bit: can't use @end verbatim inside @verbatim @example -@group -@@example -This is an example -@@end example - -@@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 -@@code@{@@@@display@} and @@code@{@@@@end display@}.) -@end group +@exdent @@verbatim +@exdent @{ +@exdent <tab>@@command with strange characters: @@'e +@exdent expand<tab>me +@exdent @} +@exdent @@end verbatim @end example @noindent produces -@display -@example -This is an example -@end example -@tex -% Remove extra vskip; this is a kludge to counter the effect of display -\vskip-3.5\baselineskip -@end tex +@verbatim +{ + @command with strange characters: @'e +expand me +} +@end verbatim -@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 -@code{@@display} and @code{@@end display}.) -@end display +Since the lines containing @code{@@verbatim} and @code{@@end verbatim} +will disappear, tyically you should put a blank line before the +@code{@@verbatim} and another blank line after the @code{@@end +verbatim}. Blank lines between the beginning @code{@@verbatim} and the +ending @code{@@end verbatim} will appear in the output.) -To adjust the number of blank lines properly in the Info file output, -remember that the line containing @code{@@noindent} does not generate a -blank line, and neither does the @code{@@end example} line.@refill -In the Texinfo source file for this manual, each line that says -`produces' is preceded by a line containing @code{@@noindent}.@refill +@node verbatiminclude +@section @code{@@verbatiminclude} @var{file}: Include a File Verbatim +@cindex Verbatim, include file +@cindex Including a file verbatim +@findex verbatiminclude -Do not put braces after an @code{@@noindent} command; they are not -necessary, since @code{@@noindent} is a command used outside of -paragraphs (@pxref{Command Syntax}).@refill +You can include the exact contents of a file in the document with the +@code{@@verbatiminclude} command: + +@example +@@verbatiminclude @var{filename} +@end example + +The contents of @var{filename} is printed in a verbatim environment +(@pxref{verbatim,,@code{@@verbatim}}). Generally, the file is printed +exactly as it is, with all special characters and white space retained. @node lisp -@section @code{@@lisp} +@section @code{@@lisp}: Marking a Lisp Example @findex lisp @cindex Lisp example The @code{@@lisp} command is used for Lisp code. It is synonymous with the @code{@@example} command. @lisp This is an example of text written between an @code{@@lisp} command and an @code{@@end lisp} command. @end lisp Use @code{@@lisp} instead of @code{@@example} to preserve information regarding the nature of the example. This is useful, for example, if you write a function that evaluates only and all the Lisp code in a Texinfo file. Then you can use the Texinfo file as a Lisp library.@footnote{It would be straightforward to extend Texinfo to work in a similar fashion for C, Fortran, or other languages.} Mark the end of @code{@@lisp} with @code{@@end lisp} on a line by itself.@refill @node small @section @code{@@small@dots{}} Block Commands -@cindex Small book example -@cindex Example for a small book -@cindex Lisp example for a small book +@cindex Small examples +@cindex Examples in smaller fonts +@cindex Lisp examples in smaller fonts @findex smalldisplay @findex smallexample @findex smallformat @findex smalllisp In addition to the regular @code{@@example} and @code{@@lisp} commands, Texinfo has ``small'' example-style commands. These are @code{@@smalldisplay}, @code{@@smallexample}, @code{@@smallformat}, and -@code{@@smalllisp}. All of these commands are designed for use with the -@code{@@smallbook} command (which causes @TeX{} to format a printed book for -a 7 by 9.25 inch trim size rather than the default 8.5 by 11 inch size). +@code{@@smalllisp}. In @TeX{}, the @code{@@small@dots{}} commands typeset text in a smaller -font for the smaller @code{@@smallbook} format than for the 8.5 by 11 -inch format. Consequently, many examples containing long lines fit in a -narrower, @code{@@smallbook} page without needing to be shortened. Both -commands typeset in the normal font size when you format for the 8.5 by -11 inch size. Indeed, in this situation, the @code{@@small@dots{}} -commands are equivalent to their non-small versions. - -In Info, the @code{@@small@dots{}} commands are also equivalent to their +font than the non-small example commands. Consequently, many examples +containing long lines fit on a page without needing to be shortened. + +In Info, the @code{@@small@dots{}} commands are equivalent to their non-small companion commands. Mark the end of an @code{@@small@dots{}} block with a corresponding @code{@@end small@dots{}}. For example, pair @code{@@smallexample} with @code{@@end smallexample}. @iftex Here is an example written in the small font used by the @code{@@smallexample} and @code{@@smalllisp} commands: @ifclear smallbook @display @tex % Remove extra vskip; this is a kludge to counter the effect of display \vskip-3\baselineskip {\smalltt \dots{} to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source 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 @end ifclear @end iftex @ifset smallbook @iftex @smallexample This is an example of text written between @code{@@smallexample} and -@code{@@end smallexample}. In Info and in an 8.5 by 11 inch manual, -this text appears in its normal size; but in a 7 by 9.25 inch manual, -this text appears in a smaller font. +@code{@@end smallexample}. In Info this text appears in its normal size; +but in printed manuals, this text appears in a smaller font. @end smallexample @end iftex @end ifset @ifinfo @smallexample This is an example of text written between @code{@@smallexample} and -@code{@@end smallexample}. In Info and in an 8.5 by 11 inch manual, -this text appears in its normal size; but in a 7 by 9.25 inch manual, -this text appears in a smaller font. +@code{@@end smallexample}. In Info this text appears in its normal size; +but in a 7 by 9.25 inch manual, this text appears in a smaller font. @end smallexample @end ifinfo -The @code{@@small@dots{}} commands make it easier to prepare smaller -format manuals without forcing you to edit examples by hand to fit them -onto narrower pages.@refill +The @code{@@small@dots{}} commands make it easier to prepare manuals +without forcing you to edit examples by hand to fit them onto narrower +pages. As a general rule, a printed document looks better if you use only one of (for example) @code{@@example} or in @code{@@smallexample} consistently within a chapter. Only occasionally should you mix the two formats. @xref{smallbook, , Printing ``Small'' Books}, for more information -about the @code{@@smallbook} command.@refill +about the @code{@@smallbook} command. @node display @section @code{@@display} and @code{@@smalldisplay} @cindex Display formatting @findex display The @code{@@display} command begins a kind of example. It is like the @code{@@example} command except that, in a printed manual, @code{@@display} does not select the fixed-width font. In fact, it does not specify the font at all, so that the text appears in the same font it would have appeared in without the @code{@@display} command.@refill @display This is an example of text written between an @code{@@display} command and an @code{@@end display} command. The @code{@@display} command indents the text, but does not fill it. @end display @findex smalldisplay Texinfo also provides a command @code{@@smalldisplay}, which is like @code{@@display} but uses a smaller font in @code{@@smallbook} format. @xref{small}. @node format @section @code{@@format} and @code{@@smallformat} @findex format The @code{@@format} command is similar to @code{@@example} except that, in the printed manual, @code{@@format} does not select the 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, the @code{@@format} command does not fill the text. @end format @findex smallformat Texinfo also provides a command @code{@@smallformat}, which is like @code{@@format} but uses a smaller font in @code{@@smallbook} format. @xref{small}. @node exdent @section @code{@@exdent}: Undoing a Line's Indentation @cindex Indentation undoing @findex exdent The @code{@@exdent} command removes any indentation a line might have. The command is written at the beginning of a line and applies only to the text that follows the command that is on the same line. Do not use braces around the text. In a printed manual, the text on an @code{@@exdent} line is printed in the roman font.@refill @code{@@exdent} is usually used within examples. Thus,@refill @example @group @@example This line follows an @@@@example command. @@exdent This line is exdented. This line follows the exdented line. The @@@@end example comes on the next line. @@end group @end group @end example @noindent produces @example @group This line follows an @@example command. @exdent This line is exdented. This line follows the exdented line. The @@end example comes on the next line. @end group @end example In practice, the @code{@@exdent} command is rarely used. Usually, you un-indent text by ending the example and returning the page to its normal width.@refill -@node flushleft & flushright, cartouche, exdent, Quotations and Examples + +@node flushleft & flushright @section @code{@@flushleft} and @code{@@flushright} @findex flushleft @findex flushright +@cindex ragged right +@cindex ragged left The @code{@@flushleft} and @code{@@flushright} commands line up the ends of lines on the left and right margins of a page, but do not fill the text. The commands are written on lines of their own, without braces. The @code{@@flushleft} and @code{@@flushright} commands are ended by @code{@@end flushleft} and @code{@@end flushright} commands on lines of their own.@refill @need 1500 For example, @example @group @@flushleft This text is written flushleft. @@end flushleft @end group @end example @noindent produces @quotation @flushleft This text is written flushleft. @end flushleft @end quotation @code{@@flushright} produces the type of indentation often used in the return address of letters. For example, @example @group @@flushright Here is an example of text written flushright. The @@code@{@@flushright@} command right justifies every line but leaves the left end ragged. @@end flushright @end group @end example @noindent produces @flushright Here is an example of text written flushright. The @code{@@flushright} command right justifies every line but leaves the left end ragged. @end flushright -@node cartouche, , flushleft & flushright, Quotations and Examples -@section Drawing Cartouches Around Examples + +@node noindent +@section @code{@@noindent}: Omitting Indentation +@findex noindent + +An example or other inclusion can break a paragraph into segments. +Ordinarily, the formatters indent text that follows an example as a new +paragraph. However, you can prevent this by writing @code{@@noindent} +at the beginning of a line by itself preceding the continuation +text.@refill + +@need 1500 +For example: + +@example +@group +@@example +This is an example +@@end example + +@@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 +@@code@{@@@@display@} and @@code@{@@@@end display@}.) +@end group +@end example + +@noindent +produces + +@display +@example +This is an example +@end example +@tex +% Remove extra vskip; this is a kludge to counter the effect of display +\vskip-3.5\baselineskip +@end tex + +@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 +@code{@@display} and @code{@@end display}.) +@end display + +To adjust the number of blank lines properly in the Info file output, +remember that the line containing @code{@@noindent} does not generate a +blank line, and neither does the @code{@@end example} line.@refill + +In the Texinfo source file for this manual, each line that says +`produces' is preceded by a line containing @code{@@noindent}.@refill + +Do not put braces after an @code{@@noindent} command; they are not +necessary, since @code{@@noindent} is a command used outside of +paragraphs (@pxref{Command Syntax}).@refill + + +@node cartouche +@section @code{@@cartouche}: Rounded Rectangles Around Examples @findex cartouche @cindex Box with rounded corners +@cindex Rounded rectangles, around examples In a printed manual, the @code{@@cartouche} command draws a box with rounded corners around its contents. You can use this command to further highlight an example or quotation. For instance, you could write a manual in which one type of example is surrounded by a cartouche -for emphasis.@refill +for emphasis. @code{@@cartouche} affects only the printed manual; it has no effect in other output files. @need 1500 For example, @example @group @@example @@cartouche % pwd /usr/local/share/emacs @@end cartouche @@end example @end group @end example @noindent surrounds the two-line example with a box with rounded corners, in the printed manual. @iftex In a printed manual, the example looks like this:@refill @example @group @cartouche % pwd /usr/local/lib/emacs/info @end cartouche @end group @end example @end iftex -@node Lists and Tables, Indices, Quotations and Examples, Top +@node Lists and Tables @chapter Lists and Tables @cindex Making lists and tables @cindex Lists and tables, making @cindex Tables and lists, making Texinfo has several ways of making lists and tables. Lists can be bulleted or numbered; two-column tables can highlight the items in the first column; multi-column tables are also supported. @menu * Introducing Lists:: Texinfo formats lists for you. * 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 @node Introducing Lists, itemize, Lists and Tables, Lists and Tables @ifinfo @heading Introducing Lists @end ifinfo Texinfo automatically indents the text in lists or tables, and numbers an enumerated list. This last feature is useful if you modify the list, since you do not need to renumber it yourself.@refill Numbered lists and tables begin with the appropriate @@-command at the beginning of a line, and end with the corresponding @code{@@end} command on a line by itself. The table and itemized-list commands also require that you write formatting information on the same line as the beginning @@-command.@refill Begin an enumerated list, for example, with an @code{@@enumerate} command and end the list with an @code{@@end enumerate} command. Begin an itemized list with an @code{@@itemize} command, followed on the same line by a formatting command such as @code{@@bullet}, and end the list with an @code{@@end itemize} command.@refill @findex end Precede each element of a list with an @code{@@item} or @code{@@itemx} command.@refill @sp 1 @noindent Here is an itemized list of the different kinds of table and lists:@refill @itemize @bullet @item Itemized lists with and without bullets. @item Enumerated lists, using numbers or letters. @item Two-column tables with highlighting. @end itemize @sp 1 @noindent Here is an enumerated list with the same items:@refill @enumerate @item Itemized lists with and without bullets. @item Enumerated lists, using numbers or letters. @item Two-column tables with highlighting. @end enumerate @sp 1 @noindent And here is a two-column table with the same items and their @w{@@-commands}:@refill @table @code @item @@itemize Itemized lists with and without bullets. @item @@enumerate Enumerated lists, using numbers or letters. @item @@table @itemx @@ftable @itemx @@vtable Two-column tables, optionally with indexing. @end table @node itemize @section @code{@@itemize}: Making an Itemized List @cindex Itemization @findex itemize The @code{@@itemize} command produces sequences of indented paragraphs, with a bullet or other mark inside the left margin at the beginning of each paragraph for which such a mark is desired.@refill @cindex @code{@@w}, for blank items Begin an itemized list by writing @code{@@itemize} at the beginning of a line. Follow the command, on the same line, with a character or a Texinfo command that generates a mark. Usually, you will write @code{@@bullet} after @code{@@itemize}, but you can use @code{@@minus}, or any command or character that results in a single character in the Info file. If you don't want any mark at all, use @code{@@w}. (When you write the mark command such as @code{@@bullet} after an @code{@@itemize} command, you may omit the @samp{@{@}}.) If you don't specify a mark command, the default is @code{@@bullet}. Write the text of the indented paragraphs themselves after the @code{@@itemize}, up to another line that says @code{@@end itemize}.@refill @findex item Before each paragraph for which a mark in the margin is desired, write a line that says just @code{@@item}. It is ok to have text following the @code{@@item}. Usually, you should put a blank line before an @code{@@item}. This puts a blank line in the Info file. (@TeX{} inserts the proper interline whitespace in either case.) Except when the entries are very brief, these blank lines make the list look better.@refill Here is an example of the use of @code{@@itemize}, followed by the output it produces. @code{@@bullet} produces an @samp{*} in Info and a round dot in @TeX{}. @example @group @@itemize @@bullet @@item Some text for foo. @@item Some text for bar. @@end itemize @end group @end example @noindent This produces: @quotation @itemize @bullet @item Some text for foo. @item Some text for bar. @end itemize @end quotation Itemized lists may be embedded within other itemized lists. Here is a list marked with dashes embedded in a list marked with bullets:@refill @example @group @@itemize @@bullet @@item First item. @@itemize @@minus @@item Inner item. @@item Second inner item. @@end itemize @@item Second outer item. @@end itemize @end group @end example @noindent This produces: @quotation @itemize @bullet @item First item. @itemize @minus @item Inner item. @item Second inner item. @end itemize @item Second outer item. @end itemize @end quotation @node enumerate @section @code{@@enumerate}: Making a Numbered or Lettered List @cindex Enumeration @findex enumerate @code{@@enumerate} is like @code{@@itemize} (@pxref{itemize,, @code{@@itemize}}), except that the labels on the items are successive integers or letters instead of bullets. 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 with the number @samp{1}. With a numeric argument, such as @samp{3}, the command starts the list with that number. With an upper or lower case letter, such as @samp{a} or @samp{A}, the command starts the list with that letter. Write the text of the enumerated list in the same way you write an itemized list: put @code{@@item} on a line of its own before the start of each paragraph that you want enumerated. Do not write any other text on the line beginning with @code{@@item}. You should put a blank line between entries in the list. This generally makes it easier to read the Info file. @need 1500 Here is an example of @code{@@enumerate} without an argument: @example @group @@enumerate @@item Underlying causes. @@item Proximate causes. @@end enumerate @end group @end example @noindent This produces: @enumerate @item Underlying causes. @item Proximate causes. @end enumerate @sp 1 Here is an example with an argument of @kbd{3}:@refill @sp 1 @example @group @@enumerate 3 @@item Predisposing causes. @@item Precipitating causes. @@item Perpetuating causes. @@end enumerate @end group @end example @noindent This produces: @enumerate 3 @item Predisposing causes. @item Precipitating causes. @item Perpetuating causes. @end enumerate @sp 1 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 @code{@@enumerate} Without an argument, produce a numbered list, starting with the number 1.@refill @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 @code{@@enumerate @var{upper-case-letter}} 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 @code{@@enumerate @var{lower-case-letter}} 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, Multi-column Tables, enumerate, Lists and Tables @section Making a Two-column Table @cindex Tables, making two-column @findex table @code{@@table} is similar to @code{@@itemize} (@pxref{itemize,, @code{@@itemize}}), but allows you to specify a name or heading line for each item. The @code{@@table} command is used to produce two-column tables, and is especially useful for glossaries, explanatory exhibits, and command-line option summaries. @menu * table:: How to construct a two-column table. * ftable vtable:: Automatic indexing for two-column tables. * itemx:: How to put more entries in the first column. @end menu @node table, ftable vtable, Two-column Tables, Two-column Tables @ifinfo @subheading Using the @code{@@table} Command Use the @code{@@table} command to produce two-column tables.@refill @end ifinfo 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 ``indicating'' command such as @code{@@code}, @code{@@samp}, @code{@@var}, or @code{@@kbd} (@pxref{Indicating}). 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 to the text that goes into the first column of each item and determines how it will be highlighted. For example, @code{@@code} will cause the text in the first column to be highlighted with an @code{@@code} command. (We recommend @code{@@code} for @code{@@table}'s of command-line options.) @findex asis You may also choose to use the @code{@@asis} command as an argument to @code{@@table}. @code{@@asis} is a command that does nothing; if you use this command after @code{@@table}, @TeX{} and the Info formatting commands output the first column entries without added highlighting (``as is'').@refill (The @code{@@table} command may work with other commands besides those listed here. However, you can only use commands that normally take arguments in braces.)@refill @findex item Begin each table entry with an @code{@@item} command at the beginning of a line. Write the first column text on the same line as the @code{@@item} command. Write the second column text on the line following the @code{@@item} line and on subsequent lines. (You do not need to type anything for an empty second column entry.) You may write as many lines of supporting text as you wish, even several paragraphs. But only text on the same line as the @code{@@item} will be placed in the first column, including any footnote. Normally, you should put a blank line before an @code{@@item} line. This puts a blank like in the Info file. Except when the entries are very brief, a blank line looks better.@refill @need 1500 The following table, for example, highlights the text in the first column with an @code{@@samp} command:@refill @example @group @@table @@samp @@item foo This is the text for @@samp@{foo@}. @@item bar Text for @@samp@{bar@}. @@end table @end group @end example @noindent This produces: @table @samp @item foo This is the text for @samp{foo}. @item bar Text for @samp{bar}. @end table If you want to list two or more named items with a single block of text, use the @code{@@itemx} command. (@xref{itemx, , @code{@@itemx}}.)@refill @node ftable vtable @subsection @code{@@ftable} and @code{@@vtable} @cindex Tables with indexes @cindex Indexing table entries automatically @findex ftable @findex vtable The @code{@@ftable} and @code{@@vtable} commands are the same as the @code{@@table} command except that @code{@@ftable} automatically enters each of the items in the first column of the table into the index of functions and @code{@@vtable} automatically enters each of the items in the first column of the table into the index of variables. This simplifies the task of creating indices. Only the items on the same line as the @code{@@item} commands are indexed, and they are indexed in exactly the form that they appear on that line. @xref{Indices}, for more information about indices.@refill Begin a two-column table using @code{@@ftable} or @code{@@vtable} by writing the @@-command at the beginning of a line, followed on the same line by an argument that is a Texinfo command such as @code{@@code}, 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. See the example for @code{@@table} in the previous section. @node itemx @subsection @code{@@itemx} @cindex Two named items for @code{@@table} @findex itemx Use the @code{@@itemx} command inside a table when you have two or more first column entries for the same item, each of which should appear on a line of its own. Use @code{@@itemx} for all but the first entry; @code{@@itemx} should always follow an @code{@@item} command. The @code{@@itemx} command works exactly like @code{@@item} except that it does not generate extra vertical space above the first column text. For example, @example @group @@table @@code @@item upcase @@itemx downcase These two functions accept a character or a string as argument, and return the corresponding upper case (lower case) character or string. @@end table @end group @end example @noindent This produces: @table @code @item upcase @itemx downcase These two functions accept a character or a string as argument, and return the corresponding upper case (lower case) character or string.@refill @end table @noindent (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 @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. You can use a leading zero if you wish. @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 @findex tab After the @code{@@multitable} command defining the column widths (see the previous section), you begin each row in the body of a multitable with @code{@@item}, and separate the column entries with @code{@@tab}. 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 @cite{The GNU Emacs Manual}, @pxref{Split Window,, Splitting Windows, emacs, 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 Indices @cindex Indices Using Texinfo, you can generate indices without having to sort and collate entries manually. In an index, the entries are listed in alphabetical order, together with information on how to find the discussion of each entry. In a printed manual, this information consists of page numbers. In an Info file, this information is a menu entry leading to the first node referenced.@refill Texinfo provides several predefined kinds of index: an index for functions, an index for variables, an index for concepts, and so on. You can combine indices or use them for other than their canonical purpose. If you wish, you can define your own indices.@refill @menu * Index Entries:: Choose different words for index entries. * Predefined Indices:: Use different indices for different kinds of entry. * Indexing Commands:: How to make an index entry. * Combining Indices:: How to combine indices. * New Indices:: How to define your own indices. @end menu @node Index Entries, Predefined Indices, Indices, Indices @comment node-name, next, previous, up @section Making Index Entries @cindex Index entries, making @cindex Entries, making index When you are making index entries, it is good practice to think of the different ways people may look for something. Different people @emph{do not} think of the same words when they look something up. A helpful index will have items indexed under all the different words that people may use. For example, one reader may think it obvious that the two-letter names for indices should be listed under ``Indices, two-letter names'', since the word ``Index'' is the general concept. But another reader may remember the specific concept of two-letter names and search for the entry listed as ``Two letter names for indices''. A good index will have both entries and will help both readers.@refill Like typesetting, the construction of an index is a highly skilled, professional art, the subtleties of which are not appreciated until you need to do it yourself.@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 Predefined Indices, Indexing Commands, Index Entries, Indices @comment node-name, next, previous, up @section Predefined Indices Texinfo provides six predefined indices:@refill @itemize @bullet @item A @dfn{concept index} listing concepts that are discussed.@refill @item A @dfn{function index} listing functions (such as entry points of libraries).@refill @item A @dfn{variables index} listing variables (such as global variables of libraries).@refill @item A @dfn{keystroke index} listing keyboard commands.@refill @item A @dfn{program index} listing names of programs.@refill @item A @dfn{data type index} listing data types (such as structures defined in header files).@refill @end itemize @noindent Not every manual needs all of these, and most manuals use two or three of them. This manual has two indices: a concept index and an @@-command index (that is actually the function index but is called a command index in the chapter heading). Two or more indices can be combined into one using the @code{@@synindex} or @code{@@syncodeindex} commands. @xref{Combining Indices}.@refill @node Indexing Commands, Combining Indices, Predefined Indices, Indices @comment node-name, next, previous, up @section Defining the Entries of an Index @cindex Defining indexing entries @cindex Index entries @cindex Entries for an index @cindex Specifying index entries @cindex Creating index entries The data to make an index come from many individual indexing commands scattered throughout the Texinfo source file. Each command says to add one entry to a particular index; after formatting, the index will give the current page number or node name as the reference.@refill An index entry consists of an indexing command at the beginning of a line followed, on the rest of the line, by the entry.@refill For example, this section begins with the following five entries for the concept index:@refill @example @@cindex Defining indexing entries @@cindex Index entries @@cindex Entries for an index @@cindex Specifying index entries @@cindex Creating index entries @end example Each predefined index has its own indexing command---@code{@@cindex} for the concept index, @code{@@findex} for the function index, and so on.@refill @cindex Writing index entries @cindex Index entry writing Concept index entries consist of text. The best way to write an index is to choose entries that are terse yet clear. If you can do this, the index often looks better if the entries are not capitalized, but written just as they would appear in the middle of a sentence. (Capitalize proper names and acronyms that always call for upper case letters.) This is the case convention we use in most GNU manuals' indices. If you don't see how to make an entry terse yet clear, make it longer and clear---not terse and confusing. If many of the entries are several words long, the index may look better if you use a different convention: to capitalize the first word of each entry. But do not capitalize a case-sensitive name such as a C or Lisp function name or a shell command; that would be a spelling error. Whichever case convention you use, please use it consistently! Entries in indices other than the concept index are symbol names in programming languages, or program names; these names are usually case-sensitive, so use upper and lower case as required for them. By default, entries for a concept index are printed in a small roman font and entries for the other indices are printed in a small @code{@@code} font. You may change the way part of an entry is printed with the usual Texinfo commands, such as @code{@@file} for file names and @code{@@emph} for emphasis (@pxref{Marking Text}).@refill @cindex Index font types @cindex Predefined indexing commands @cindex Indexing commands, predefined The six indexing commands for predefined indices are: @table @code @item @@cindex @var{concept} @findex cindex Make an entry in the concept index for @var{concept}.@refill @item @@findex @var{function} @findex findex Make an entry in the function index for @var{function}.@refill @item @@vindex @var{variable} @findex vindex Make an entry in the variable index for @var{variable}.@refill @item @@kindex @var{keystroke} @findex kindex Make an entry in the key index for @var{keystroke}.@refill @item @@pindex @var{program} @findex pindex Make an entry in the program index for @var{program}.@refill @item @@tindex @var{data type} @findex tindex Make an entry in the data type index for @var{data type}.@refill @end table @quotation @strong{Caution:} Do not use a colon in an index entry. In Info, a colon separates the menu entry name from the node name, so a colon in the entry itself confuses Info. @xref{Menu Parts, , The Parts of a Menu}, for more information about the structure of a menu entry. @end quotation You are not actually required to use the predefined indices for their canonical purposes. For example, suppose you wish to index some C preprocessor macros. You could put them in the function index along with actual functions, just by writing @code{@@findex} commands for them; then, when you print the ``Function Index'' as an unnumbered chapter, you could give it the title `Function and Macro Index' and all will be consistent for the reader. Or you could put the macros in with the data types by writing @code{@@tindex} commands for them, and give that index a suitable title so the reader will understand. (@xref{Printing Indices & Menus}.)@refill @node Combining Indices, New Indices, Indexing Commands, Indices @comment node-name, next, previous, up @section Combining Indices @cindex Combining indices @cindex Indices, combining them Sometimes you will want to combine two disparate indices such as functions and concepts, perhaps because you have few enough of one of them that a separate index for them would look silly.@refill You could put functions into the concept index by writing @code{@@cindex} commands for them instead of @code{@@findex} commands, and produce a consistent manual by printing the concept index with the title `Function and Concept Index' and not printing the `Function Index' at all; but this is not a robust procedure. It works only if your document is never included as part of another document that is designed to have a separate function index; if your document were to be included with such a document, the functions from your document and those from the other would not end up together. Also, to make your function names appear in the right font in the concept index, you would need to enclose every one of them between the braces of @code{@@code}.@refill @menu * syncodeindex:: How to merge two indices, using @code{@@code} font for the merged-from index. * synindex:: How to merge two indices, using the default font of the merged-to index. @end menu @node syncodeindex, synindex, Combining Indices, Combining Indices @subsection @code{@@syncodeindex} @findex syncodeindex When you want to combine functions and concepts into one index, you should index the functions with @code{@@findex} and index the concepts with @code{@@cindex}, and use the @code{@@syncodeindex} command to redirect the function index entries into the concept index.@refill @findex syncodeindex The @code{@@syncodeindex} command takes two arguments; they are the name of the index to redirect, and the name of the index to redirect it to. The template looks like this:@refill @example @@syncodeindex @var{from} @var{to} @end example @cindex Predefined names for indices @cindex Two letter names for indices @cindex Indices, two letter names @cindex Names for indices For this purpose, the indices are given two-letter names:@refill @table @samp @item cp concept index @item fn function index @item vr variable index @item ky key index @item pg program index @item tp data type index @end table Write an @code{@@syncodeindex} command before or shortly after the end-of-header line at the beginning of a Texinfo file. For example, to merge a function index with a concept index, write the following:@refill @example @@syncodeindex fn cp @end example @noindent This will cause all entries designated for the function index to merge in with the concept index instead.@refill To merge both a variables index and a function index into a concept index, write the following:@refill @example @group @@syncodeindex vr cp @@syncodeindex fn cp @end group @end example @cindex Fonts for indices The @code{@@syncodeindex} command puts all the entries from the `from' index (the redirected index) into the @code{@@code} font, overriding whatever default font is used by the index to which the entries are 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 @subsection @code{@@synindex} @findex synindex The @code{@@synindex} command is nearly the same as the @code{@@syncodeindex} command, except that it does not put the `from' index entries into the @code{@@code} font; rather it puts them in the roman font. Thus, you use @code{@@synindex} when you 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 @cindex New index defining @findex defindex @findex defcodeindex In addition to the predefined indices, you may use the @code{@@defindex} and @code{@@defcodeindex} commands to define new indices. These commands create new indexing @@-commands with which you mark index entries. The @code{@@defindex }command is used like this:@refill @example @@defindex @var{name} @end example The name of an index should be a two letter word, such as @samp{au}. For example:@refill @example @@defindex au @end example This defines a new index, called the @samp{au} index. At the same time, it creates a new indexing command, @code{@@auindex}, that you can use to make index entries. Use the new indexing command just as you would use a predefined indexing command.@refill For example, here is a section heading followed by a concept index entry and two @samp{au} index entries.@refill @example @@section Cognitive Semantics @@cindex kinesthetic image schemas @@auindex Johnson, Mark @@auindex Lakoff, George @end example @noindent (Evidently, @samp{au} serves here as an abbreviation for ``author''.) Texinfo constructs the new indexing command by concatenating the name of the index with @samp{index}; thus, defining an @samp{au} index leads to the automatic creation of an @code{@@auindex} command.@refill Use the @code{@@printindex} command to print the index, as you do with the predefined indices. For example:@refill @example @group @@node Author Index, Subject Index, , Top @@unnumbered Author Index @@printindex au @end group @end example The @code{@@defcodeindex} is like the @code{@@defindex} command, except that, in the printed output, it prints entries in an @code{@@code} font instead of a roman font. Thus, it parallels the @code{@@findex} command rather than the @code{@@cindex} command.@refill You should define new indices within or right after the end-of-header line of a Texinfo file, before any @code{@@synindex} or @code{@@syncodeindex} commands (@pxref{Header}).@refill @node Insertions @chapter Special Insertions @cindex Inserting special characters and symbols @cindex Special insertions Texinfo provides several commands for inserting characters that have special meaning in Texinfo, such as braces, and for other graphic elements that do not correspond to simple characters you can type. @iftex These are: @itemize @bullet @item Braces and @samp{@@}. @item Whitespace within and around a sentence. @item Accents. @item Dots and bullets. @item The @TeX{} logo and the copyright symbol. @item The pounds currency symbol. @item The minus sign. @item Mathematical expressions. @item Glyphs for evaluation, macros, errors, etc. @item Footnotes. @item Images. @end itemize @end iftex @menu * 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 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. * Glyphs:: How to indicate results of evaluation, expansion of macros, errors, etc. * Footnotes:: How to include footnotes. * Images:: How to include graphics. @end menu @node Braces Atsigns, Inserting Space, Insertions, Insertions @section Inserting @@ and Braces @cindex Inserting @@, braces @cindex Braces, inserting @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. Do not put braces after any of these commands; they are not necessary. @menu * 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, Braces Atsigns @subsection Inserting @samp{@@} with @@@@ @findex @@ @r{(single @samp{@@})} @code{@@@@} stands for a single @samp{@@} in either printed or Info output. Do not put braces after an @code{@@@@} command. @node Inserting Braces @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. @code{@@@}} stands for a single @samp{@}} in either printed or Info output. Do not put braces after either an @code{@@@{} or an @code{@@@}} command. @node Inserting Space @section Inserting Space @cindex Inserting space @cindex Spacing, 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 @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 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)} +@findex <colon> @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. For example, @example The s.o.p.@@: has three parts @dots{} The s.o.p. has three parts @dots{} @end example @noindent @ifinfo produces @end ifinfo @iftex produces the following. If you look carefully at this printed output, you will see a little more whitespace after @samp{s.o.p.} in the second line.@refill @end iftex @quotation The s.o.p.@: has three parts @dots{}@* The s.o.p. has three parts @dots{} @end quotation @noindent (Incidentally, @samp{s.o.p.} is an abbreviation for ``Standard Operating Procedure''.) @code{@@:} has no effect on the Info output. Do not put braces after @code{@@:}. @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@@. Give it to M.I.B. and to M.E.W. Also, give it to R.J.C. @end example @noindent @ifinfo produces @end ifinfo @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. @end iftex @quotation Give it to M.I.B. and to M.E.W@. Also, give it to R.J.C@.@* 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{.}; 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, The GNU Emacs Manual}). Do not put braces after any of these commands. @node Multiple Spaces, dmn, Ending a Sentence, Inserting Space @subsection Multiple Spaces @cindex Multiple spaces @cindex Whitespace, inserting @cindex Space, inserting horizontal @findex (space) @findex (tab) @findex (newline) 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{@@@kbd{SPACE}}, @code{@@@kbd{TAB}}, and @code{@@@kbd{NL}}, all of which insert a single space into the output. (Here, @code{@@@kbd{SPACE}} represents an @samp{@@} character followed by a space, i.e., @samp{@@ }, and @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{@@@kbd{SPACE}} have been subsumed by @code{@@multitable} (@pxref{Multi-column Tables}). Do not follow any of these commands with braces. +To produce a non-breakable space, see @ref{w, non-breakable space}. + @node dmn @subsection @code{@@dmn}@{@var{dimension}@}: Format a Dimension @cindex Thin space between number, dimension @cindex Dimension formatting @cindex Format a dimension @findex dmn At times, you may want to write @samp{12@dmn{pt}} or @samp{8.5@dmn{in}} with little or no space between the number and the abbreviation for the dimension. You can use the @code{@@dmn} command to do this. On seeing the command, @TeX{} inserts just enough space for proper typesetting; the Info formatting commands insert no space at all, since the Info file does not require it. To use the @code{@@dmn} command, write the number and then follow it immediately, with no intervening space, by @code{@@dmn}, and then by the dimension within braces. For example, @example A4 paper is 8.27@@dmn@{in@} wide. @end example @noindent produces @quotation A4 paper is 8.27@dmn{in} wide. @end quotation Not everyone uses this style. Some people prefer @w{@samp{8.27 in.@@:}} or @w{@samp{8.27 inches}} to @samp{8.27@@dmn@{in@}} in the Texinfo file. In these cases, however, the formatters may insert a line break between the number and the dimension, so use @code{@@w} (@pxref{w}). Also, if you write a period after an abbreviation within a sentence, you should write @samp{@@:} after the period to prevent @TeX{} from inserting extra whitespace, as shown here. @xref{Not Ending a Sentence}. @node Inserting Accents @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 Hungarian 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 {x@@questiondown@{@} } {oe,OE} {es-zet or sharp S} +@multitable {x@@questiondown@{@}} {oe,OE} {es-zet or sharp S} @item @t{@@exclamdown@{@}} @tab @exclamdown{} @tab upside-down ! @item @t{@@questiondown@{@}} @tab @questiondown{} @tab upside-down ? @item @t{@@aa@{@},@@AA@{@}} @tab @aa{},@AA{} @tab a,A with circle @item @t{@@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 @section Inserting Ellipsis and Bullets @cindex Dots, inserting @cindex Bullets, inserting @cindex Ellipsis, inserting @cindex Inserting ellipsis @cindex Inserting dots @cindex Special typesetting commands @cindex Typesetting commands for dots, etc. An @dfn{ellipsis} (a line of dots) is not typeset as a string of periods, so a special command is used for ellipsis in Texinfo. The @code{@@bullet} command is special, too. Each of these commands is followed by a pair of braces, @samp{@{@}}, without any whitespace between the name of the command and the braces. (You need to use braces with these commands because you can use them next to other text; without the braces, the formatters would be confused. @xref{Command Syntax, , @@-Command Syntax}, for further information.)@refill @menu * dots:: How to insert dots @dots{} * bullet:: How to insert a bullet. @end menu @node dots @subsection @code{@@dots}@{@} (@dots{}) and @code{@@enddots}@{@} (@enddots{}) @findex dots @findex enddots @cindex Inserting dots @cindex Dots, inserting 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. 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 @subsection @code{@@bullet}@{@} (@bullet{}) @findex bullet Use the @code{@@bullet@{@}} command to generate a large round dot, or 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. (@xref{itemize, , @code{@@itemize}}.)@refill @node TeX and copyright, pounds, Dots Bullets, Insertions @section Inserting @TeX{} and the Copyright Symbol The logo `@TeX{}' is typeset in a special fashion and it needs an @@-command. The copyright symbol, `@copyright{}', is also special. Each of these commands is followed by a pair of braces, @samp{@{@}}, without any whitespace between the name of the command and the braces.@refill @menu * tex:: How to insert the @TeX{} logo. * copyright symbol:: How to use @code{@@copyright}@{@}. @end menu @node tex @subsection @code{@@TeX}@{@} (@TeX{}) @findex tex (command) 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 @samp{T} and the @samp{X} are in upper case.@refill @node copyright symbol @subsection @code{@@copyright}@{@} (@copyright{}) @findex copyright 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 pounds, minus, TeX and copyright, Insertions @section @code{@@pounds}@{@} (@pounds{}): Pounds Sterling @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}@{@} (@minus{}): Inserting a Minus Sign @findex minus +@cindex em-dash +@cindex hyphen Use the @code{@@minus@{@}} command to generate a minus sign. In a fixed-width font, this is a single hyphen, but in a proportional font, the symbol is the customary length for a minus sign---a little longer than a hyphen, shorter than an em-dash: @display @samp{@minus{}} is a minus sign generated with @samp{@@minus@{@}}, `-' is a hyphen generated with the character @samp{-}, `---' is an em-dash for text. @end display @noindent In the fixed-width font used by Info, @code{@@minus@{@}} is the same as a hyphen. You should not use @code{@@minus@{@}} inside @code{@@code} or @code{@@example} because the width distinction is not made in the fixed-width font they use. 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}}.) -@node math, Glyphs, minus, Insertions +@node math @section @code{@@math}: Inserting Mathematical Expressions @findex math @cindex Mathematical expressions +@cindex Formulas, mathematical You can write a short mathematical expression with the @code{@@math} command. Write the mathematical expression between braces, like this: @example @@math@{(a + b)(a + b) = a^2 + 2ab + b^2@} @end example @iftex -@need 1000 -@noindent -This produces the following in @TeX{}: +@noindent This produces the following in @TeX{}: @display @math{(a + b)(a + b) = a^2 + 2ab + b^2} @end display -@noindent -and the following in Info: +@noindent and the following in Info: @end iftex @ifinfo -@noindent -This produces the following in Info: +@noindent This produces the following in Info: @end ifinfo @example (a + b)(a + b) = a^2 + 2ab + b^2 @end example Thus, the @code{@@math} command has no effect on the Info output. -For complex mathematical expressions, you can also use @TeX{} directly -(@pxref{Raw Formatter Commands}). When you use @TeX{} directly, -remember to write the mathematical expression between one or two -@samp{$} (dollar-signs) as appropriate. +@code{@@math} implies @code{@@tex}. This not only makes it possible to +write superscripts and subscripts (as in the above example), but also +allows you to use any of the plain @TeX{} math control sequences. It's +simplest to use @samp{\} instead of @samp{@@} for these commands. As +in: +@example +@@math@{\sin 2\pi \equiv \cos 3\pi@} +@end example + +@iftex +@noindent which looks like this in @TeX{}: +@display +@math{\sin 2\pi \equiv \cos 3\pi} +@end display + +@noindent and +@end iftex +@noindent which looks like the input in Info and HTML: +@example +\sin 2\pi \equiv \cos 3\pi +@end example + +@cindex Displayed equations +@cindex Equations, displayed +For displayed equations, you must at present use @TeX{} directly +(@pxref{Raw Formatter Commands}). @node Glyphs @section Glyphs for Examples @cindex Glyphs +@cindex Examples, glyphs for 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 to indicate printed output, error messages, equivalence of expressions, and the location of point.@refill The glyph-insertion commands do not need to be used within an example, but most often they are. Every glyph-insertion command is followed by a pair of left- and right-hand braces.@refill @menu * Glyphs Summary:: * result:: How to show the result of expression. * expansion:: How to indicate an expansion. * Print Glyph:: How to indicate printed output. * Error Glyph:: How to indicate an error message. * Equivalence:: How to indicate equivalence. * Point Glyph:: How to indicate the location of point. @end menu -@node Glyphs Summary, result, Glyphs, Glyphs -@ifinfo -@subheading Glyphs Summary + +@node Glyphs Summary +@subsection Glyphs Summary Here are the different glyph commands:@refill -@end ifinfo @table @asis @item @result{} @code{@@result@{@}} points to the result of an expression.@refill @item @expansion{} @code{@@expansion@{@}} shows the results of a macro expansion.@refill @item @print{} @code{@@print@{@}} indicates printed output.@refill @item @error{} @code{@@error@{@}} indicates that the following text is an error message.@refill @item @equiv{} @code{@@equiv@{@}} indicates the exact equivalence of two forms.@refill @item @point{} @code{@@point@{@}} shows the location of point.@refill @end table - @menu * result:: * expansion:: * Print Glyph:: * Error Glyph:: * Equivalence:: * Point Glyph:: @end menu -@node result, expansion, Glyphs Summary, Glyphs + +@node result @subsection @code{@@result@{@}} (@result{}): Indicating Evaluation @cindex Result of an expression @cindex Indicating evaluation @cindex Evaluation glyph @cindex Value of an expression, indicating @findex result Use the @code{@@result@{@}} command to indicate the result of evaluating an expression.@refill @iftex The @code{@@result@{@}} command is displayed as @samp{=>} in Info and as @samp{@result{}} in the printed output. @end iftex @ifinfo The @code{@@result@{@}} command is displayed as @samp{@result{}} in Info and as a double stemmed arrow in the printed output.@refill @end ifinfo Thus, the following, @lisp (cdr '(1 2 3)) @result{} (2 3) @end lisp @noindent may be read as ``@code{(cdr '(1 2 3))} evaluates to @code{(2 3)}''. @node expansion, Print Glyph, result, Glyphs @subsection @code{@@expansion@{@}} (@expansion{}): Indicating an Expansion @cindex Expansion, indicating it @findex expansion When an expression is a macro call, it expands into a new expression. You can indicate the result of the expansion with the @code{@@expansion@{@}} command.@refill @iftex The @code{@@expansion@{@}} command is displayed as @samp{==>} in Info and as @samp{@expansion{}} in the printed output. @end iftex @ifinfo The @code{@@expansion@{@}} command is displayed as @samp{@expansion{}} in Info and as a long arrow with a flat base in the printed output.@refill @end ifinfo @need 700 For example, the following @example @group @@lisp (third '(a b c)) @@expansion@{@} (car (cdr (cdr '(a b c)))) @@result@{@} c @@end lisp @end group @end example @noindent produces @lisp @group (third '(a b c)) @expansion{} (car (cdr (cdr '(a b c)))) @result{} c @end group @end lisp @noindent which may be read as: @quotation @code{(third '(a b c))} expands to @code{(car (cdr (cdr '(a b c))))}; the result of evaluating the expression is @code{c}. @end quotation @noindent Often, as in this case, an example looks better if the @code{@@expansion@{@}} and @code{@@result@{@}} commands are indented five spaces.@refill @node Print Glyph, Error Glyph, expansion, Glyphs @subsection @code{@@print@{@}} (@print{}): Indicating Printed Output @cindex Printed output, indicating it @findex print Sometimes an expression will print output during its execution. You can indicate the printed output with the @code{@@print@{@}} command.@refill @iftex The @code{@@print@{@}} command is displayed as @samp{-|} in Info and as @samp{@print{}} in the printed output. @end iftex @ifinfo The @code{@@print@{@}} command is displayed as @samp{@print{}} in Info and similarly, as a horizontal dash butting against a vertical bar, in the printed output.@refill @end ifinfo In the following example, the printed text is indicated with @samp{@print{}}, and the value of the expression follows on the last line.@refill @lisp @group (progn (print 'foo) (print 'bar)) @print{} foo @print{} bar @result{} bar @end group @end lisp @noindent In a Texinfo source file, this example is written as follows: @lisp @group @@lisp (progn (print 'foo) (print 'bar)) @@print@{@} foo @@print@{@} bar @@result@{@} bar @@end lisp @end group @end lisp @node Error Glyph, Equivalence, Print Glyph, Glyphs @subsection @code{@@error@{@}} (@error{}): Indicating an Error Message @cindex Error message, indicating it @findex error A piece of code may cause an error when you evaluate it. You can designate the error message with the @code{@@error@{@}} command.@refill @iftex The @code{@@error@{@}} command is displayed as @samp{error-->} in Info and as @samp{@error{}} in the printed output. @end iftex @ifinfo The @code{@@error@{@}} command is displayed as @samp{@error{}} in Info and as the word `error' in a box in the printed output.@refill @end ifinfo @need 700 Thus, @example @@lisp (+ 23 'x) @@error@{@} Wrong type argument: integer-or-marker-p, x @@end lisp @end example @noindent produces @lisp (+ 23 'x) @error{} Wrong type argument: integer-or-marker-p, x @end lisp @noindent This indicates that the following error message is printed when you evaluate the expression: @lisp Wrong type argument: integer-or-marker-p, x @end lisp @samp{@error{}} itself is not part of the error message. @node Equivalence, Point Glyph, Error Glyph, Glyphs @subsection @code{@@equiv@{@}} (@equiv{}): Indicating Equivalence @cindex Equivalence, indicating it @findex equiv Sometimes two expressions produce identical results. You can indicate the exact equivalence of two forms with the @code{@@equiv@{@}} command.@refill @iftex The @code{@@equiv@{@}} command is displayed as @samp{==} in Info and as @samp{@equiv{}} in the printed output. @end iftex @ifinfo The @code{@@equiv@{@}} command is displayed as @samp{@equiv{}} in Info and as a three parallel horizontal lines in the printed output.@refill @end ifinfo Thus, @example @@lisp (make-sparse-keymap) @@equiv@{@} (list 'keymap) @@end lisp @end example @noindent produces @lisp (make-sparse-keymap) @equiv{} (list 'keymap) @end lisp @noindent This indicates that evaluating @code{(make-sparse-keymap)} produces identical results to evaluating @code{(list 'keymap)}. @node Point Glyph @subsection @code{@@point@{@}} (@point{}): Indicating Point in a Buffer @cindex Point, indicating in a buffer @findex point Sometimes you need to show an example of text in an Emacs buffer. In such examples, the convention is to include the entire contents of the buffer in question between two lines of dashes containing the buffer name.@refill You can use the @samp{@@point@{@}} command to show the location of point in the text in the buffer. (The symbol for point, of course, is not part of the text in the buffer; it indicates the place @emph{between} two characters where point is located.)@refill @iftex The @code{@@point@{@}} command is displayed as @samp{-!-} in Info and as @samp{@point{}} in the printed output. @end iftex @ifinfo The @code{@@point@{@}} command is displayed as @samp{@point{}} in Info and as a small five pointed star in the printed output.@refill @end ifinfo The following example shows the contents of buffer @file{foo} before and after evaluating a Lisp command to insert the word @code{changed}.@refill @example @group ---------- Buffer: foo ---------- This is the @point{}contents of foo. ---------- Buffer: foo ---------- @end group @end example @example @group (insert "changed ") @result{} nil ---------- Buffer: foo ---------- This is the changed @point{}contents of foo. ---------- Buffer: foo ---------- @end group @end example In a Texinfo source file, the example is written like this:@refill @example @@example ---------- Buffer: foo ---------- This is the @@point@{@}contents of foo. ---------- Buffer: foo ---------- (insert "changed ") @@result@{@} nil ---------- Buffer: foo ---------- This is the changed @@point@{@}contents of foo. ---------- Buffer: foo ---------- @@end example @end example @node Footnotes @section Footnotes @cindex Footnotes @findex footnote A @dfn{footnote} is for a reference that documents or elucidates the primary text.@footnote{A footnote should complement or expand upon the primary text, but a reader should not need to read a footnote to understand the primary text. For a thorough discussion of footnotes, see @cite{The Chicago Manual of Style}, which is published by the -University of Chicago Press.}@refill +University of Chicago Press.} @menu * Footnote Commands:: How to write a footnote in Texinfo. * Footnote Styles:: Controlling how footnotes appear in Info. @end menu + @node Footnote Commands @subsection Footnote Commands In Texinfo, footnotes are created with the @code{@@footnote} command. This command is followed immediately by a left brace, then by the text of the footnote, and then by a terminating right brace. Footnotes may be of any length (they will be broken across pages if necessary), but are usually short. The template is: @example ordinary text@@footnote@{@var{text of footnote}@} @end example As shown here, the @code{@@footnote} command should come right after the text being footnoted, with no intervening space; otherwise, the footnote marker might end up starting a line. For example, this clause is followed by a sample footnote@footnote{Here is the sample footnote.}; in the Texinfo source, it looks like -this:@refill +this: @example @dots{}a sample footnote@@footnote@{Here is the sample footnote.@}; in the Texinfo source@dots{} @end example +As you can see, the source includes two punctuation marks next to each +other; in this case, @samp{.@};} is the sequence. This is normal (the +first ends the footnote and the second belongs to the sentence being +footnoted), so don't worry that it looks odd. + In a printed manual or book, the reference mark for a footnote is a small, superscripted number; the text of the footnote appears at the -bottom of the page, below a horizontal line.@refill +bottom of the page, below a horizontal line. In Info, the reference mark for a footnote is a pair of parentheses with the footnote number between them, like this: @samp{(1)}. The reference mark is followed by a cross-reference link to the footnote's text. In the HTML output, footnote references are marked with a small, superscripted number which is rendered as a hypertext link to the footnote text. By the way, footnotes in the argument of an @code{@@item} command for a @code{@@table} must be on the same line as the @code{@@item} (as usual). @xref{Two-column Tables}. @node Footnote Styles @subsection Footnote Styles Info has two footnote styles, which determine where the text of the footnote is located:@refill @itemize @bullet @cindex @samp{@r{End}} node footnote style @item In the `End' node style, all the footnotes for a single node are placed at the end of that node. The footnotes are separated from the rest of the node by a line of dashes with the word @samp{Footnotes} within it. Each footnote begins with an @samp{(@var{n})} reference mark.@refill @need 700 @noindent Here is an example of a single footnote in the end of node style:@refill @example @group --------- Footnotes --------- (1) Here is a sample footnote. @end group @end example @cindex @samp{@r{Separate}} footnote style @item In the `Separate' node style, all the footnotes for a single node are placed in an automatically constructed node of their own. In this style, a ``footnote reference'' follows each @samp{(@var{n})} reference mark in the body of the node. The footnote reference is actually a cross reference which you use to reach the footnote node.@refill The name of the node with the footnotes is constructed by appending @w{@samp{-Footnotes}} to the name of the node that contains the footnotes. (Consequently, the footnotes' node for the @file{Footnotes} node is @w{@file{Footnotes-Footnotes}}!) The footnotes' node has an `Up' node pointer that leads back to its parent node.@refill @noindent Here is how the first footnote in this manual looks after being formatted for Info in the separate node style:@refill @smallexample @group File: texinfo.info Node: Overview-Footnotes, Up: Overview (1) The first syllable of "Texinfo" is pronounced like "speck", not "hex". @dots{} @end group @end smallexample @end itemize A Texinfo file may be formatted into an Info file with either footnote style.@refill @findex footnotestyle Use the @code{@@footnotestyle} command to specify an Info file's footnote style. Write this command at the beginning of a line followed by an argument, either @samp{end} for the end node style or @samp{separate} for the separate node style. @need 700 For example, @example @@footnotestyle end @end example @noindent or @example @@footnotestyle separate @end example Write an @code{@@footnotestyle} command before or shortly after the end-of-header line at the beginning of a Texinfo file. (If you include the @code{@@footnotestyle} command between the start-of-header and end-of-header lines, the region formatting commands will format footnotes as specified.)@refill If you do not specify a footnote style, the formatting commands use their default style. Currently, @code{texinfo-format-buffer} and @code{texinfo-format-region} use the `separate' style and @code{makeinfo} uses the `end' style.@refill @c !!! note: makeinfo's --footnote-style option overrides footnotestyle @ignore If you use @code{makeinfo} to create the Info file, the @samp{--footnote-style} option determines which style is used, @samp{end} for the end of node style or @samp{separate} for the separate node style. Thus, to format the Texinfo manual in the separate node style, you would use the following shell command:@refill @example makeinfo --footnote-style=separate texinfo.texi @end example @noindent To format the Texinfo manual in the end of node style, you would type:@refill @example makeinfo --footnote-style=end texinfo.texi @end example @end ignore @ignore If you use @code{texinfo-format-buffer} or @code{texinfo-format-region} to create the Info file, the value of the @code{texinfo-footnote-style} variable controls the footnote style. It can be either @samp{"separate"} for the separate node style or @samp{"end"} for the end of node style. (You can change the value of this variable with the @kbd{M-x edit-options} command (@pxref{Edit Options, , Editing Variable Values, emacs, The GNU Emacs Manual}), or with the @kbd{M-x set-variable} command (@pxref{Examining, , Examining and Setting Variables, emacs, The GNU Emacs Manual}).@refill The @code{texinfo-footnote-style} variable also controls the style if you use the @kbd{M-x makeinfo-region} or @kbd{M-x makeinfo-buffer} command in Emacs.@refill @end ignore @ifinfo This chapter contains two footnotes.@refill @end ifinfo @c this should be described with figures when we have them @c perhaps in the quotation/example chapter. @node Images @section Inserting Images @cindex Images, inserting @cindex Pictures, inserting @findex image You can insert an image given in an external file with the @code{@@image} command: @example -@@image@{@var{filename}, @r{[}@var{width}@r{]}, @r{[}@var{height}@r{]}@} +@@image@{@var{filename}, @r{[}@var{width}@r{]}, @r{[}@var{height}@r{]}, @r{[}@var{alttext}@r{]}, @r{[}@var{extension}@r{]}@} @end example @cindex Formats for images @cindex Image formats The @var{filename} argument is mandatory, and must not have an extension, because the different processors support different formats: @itemize @bullet @item @TeX{} reads the file @file{@var{filename}.eps} (Encapsulated PostScript format). @item @pindex pdftex@r{, and images} PDF@TeX{} reads @file{@var{filename}.pdf} (Adobe's Portable Document Format). @item @code{makeinfo} uses @file{@var{filename}.txt} verbatim for Info output (more or less as if it was an @code{@@example}). @item +@code{makeinfo} +uses the optional fifth argument to @code{@@image} for the extension if +you supply it. For example: + +@pindex XPM image format +@example +@@image@{foo,,,,xpm@} +@end example + +@noindent +will cause @samp{makeinfo --html} to try @file{foo.xpm}. + @cindex GIF, unsupported due to patents @cindex PNG image format -@cindex JPEG image format -@code{makeinfo} producing HTML output tries @file{@var{filename}.png}; -if that does not exist, it tries @file{@var{filename}.jpg}. If that -does not exist either, it complains. (We cannot support GIF format due -to patents.) +@cindex JPG image format +If you do not supply the optional fifth argument, @samp{makeinfo +---html} first tries @file{@var{filename}.png}; if that does not exist, +it tries @file{@var{filename}.jpg}. If that does not exist either, it +complains. (We cannot support GIF format directly due to software +patents.) @end itemize @cindex Width of images @cindex Height of images @cindex Aspect ratio of images @cindex Distorting images The optional @var{width} and @var{height} arguments specify the size to scale the image to (they are ignored for Info output). If neither is specified, the image is presented in its natural size (given in the file); if only one is specified, the other is scaled proportionately; and if both are specified, both are respected, thus possibly distorting the original image by changing its aspect ratio. @cindex Dimensions and image sizes The @var{width} and @var{height} may be specified using any valid @TeX{} dimension, namely: @table @asis @item pt @cindex Points (dimension) point (72.27pt = 1in) @item pc @cindex Picas pica (1pc = 12pt) @item bp @cindex Big points big point (72bp = 1in) @item in @cindex Inches inch @item cm @cindex Centimeters centimeter (2.54cm = 1in) @item mm @cindex Millimeters millimeter (10mm = 1cm) @item dd @cindex Did@^ot points did@^ot point (1157dd = 1238pt) @item cc @cindex Ciceros cicero (1cc = 12dd) @item sp @cindex Scaled points scaled point (65536sp = 1pt) @end table @pindex ridt.eps For example, the following will scale a file @file{ridt.eps} to one inch vertically, with the width scaled proportionately: @example @@image@{ridt,,1in@} @end example @pindex epsf.tex For @code{@@image} to work with @TeX{}, the file @file{epsf.tex} must be installed somewhere that @TeX{} can find it. (The standard location is @file{@var{texmf}/tex/generic/dvips/epsf.tex}, where @var{texmf} is a root of your @TeX{} directory tree.) This file is included in the -Texinfo distribution and is available from -@uref{ftp://tug.org/tex/epsf.tex}. +Texinfo distribution and is also available from +@uref{ftp://tug.org/tex/epsf.tex}, among other places. @code{@@image} can be used within a line as well as for displayed figures. Therefore, if you intend it to be displayed, be sure to leave a blank line before the command, or the output will run into the preceding text. +@cindex alt attribute for images +@cindex alternate text for images +When producing html, @code{makeinfo} sets the @dfn{alt attribute} for +inline images to the optional fourth argument to @code{@@image}, if +supplied. If not supplied, @code{makeinfo} uses the full file name of +the image being displayed. + @node Breaks @chapter Making and Preventing Breaks @cindex Making line and page breaks @cindex Preventing line and page breaks +@cindex Line breaks Usually, a Texinfo file is processed both by @TeX{} and by one of the Info formatting commands. Line, paragraph, or page breaks sometimes occur in the `wrong' place in one or other form of output. You must ensure that text looks right both in the printed manual and in the -Info file.@refill +Info file. +@cindex White space, excessive +@cindex Page breaks For example, in a printed manual, page breaks may occur awkwardly in the middle of an example; to prevent this, you can hold text together using a grouping command that keeps the text from being split across two pages. Conversely, you may want to force a page break where none would occur normally. Fortunately, problems like these do not often arise. When they do, use the break, break prevention, or pagination -commands.@refill +commands. @menu * Break Commands:: Cause and prevent splits. * Line Breaks:: How to force a single line to use two lines. -* - and hyphenation:: How to tell TeX about hyphenation points. +* - 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. * need:: Another way to prevent unwanted page breaks. @end menu + @node Break Commands, Line Breaks, Breaks, Breaks @ifinfo @heading Break Commands @end ifinfo The break commands create or allow line and paragraph breaks:@refill @table @code @item @@* 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 The line-break-prevention command holds text together all on one line:@refill @table @code @item @@w@{@var{text}@} Prevent @var{text} from being split and hyphenated across two lines.@refill @end table @iftex @sp 1 @end iftex The pagination commands apply only to printed output, since Info files do not have pages.@refill @table @code @item @@page Start a new page in the printed manual.@refill @item @@group Hold text together that must appear on one printed page.@refill @item @@need @var{mils} Start a new printed page if not enough space on this one.@refill @end table -@node Line Breaks, - and hyphenation, Break Commands, Breaks -@comment node-name, next, previous, up +@node Line Breaks @section @code{@@*}: Generate Line Breaks @findex * @r{(force line break)} @cindex Line breaks @cindex Breaks in a line The @code{@@*} command forces a line break in both the printed manual and in Info.@refill @need 700 For example, @example This line @@* is broken @@*in two places. @end example @noindent produces @example @group This line is broken in two places. @end group @end example @noindent (Note that the space after the first @code{@@*} command is faithfully carried down to the next line.)@refill @need 800 The @code{@@*} command is often used in a file's copyright page:@refill @example @group This is edition 2.0 of the Texinfo documentation,@@* and is for @dots{} @end group @end example @noindent In this case, the @code{@@*} command keeps @TeX{} from stretching the line across the whole page in an ugly manner.@refill @quotation @strong{Please note:} Do not write braces after an @code{@@*} command; they are not needed.@refill Do not write an @code{@@refill} command at the end of a paragraph containing an @code{@@*} command; it will cause the paragraph to be refilled after the line break occurs, negating the effect of the line break.@refill @end quotation -@node - and hyphenation, w, Line Breaks, Breaks + +@node - and hyphenation @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 @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 You can use the @code{@@w} command to prevent @TeX{} from automatically hyphenating a long name or phrase that happens to fall near the end of a line. For example: @example You can copy GNU software from @@w@{@@samp@{ftp.gnu.org@}@}. @end example @noindent produces @quotation You can copy GNU software from @w{@samp{ftp.gnu.org}}. @end quotation @cindex Non-breakable space @cindex Unbreakable space @cindex Tied space You can also use @code{@@w} to produce a non-breakable space: @example None of the formatters will break at this@@w@{ @}space. @end example @node sp @section @code{@@sp} @var{n}: Insert Blank Lines @findex sp @r{(line spacing)} @cindex Space, inserting vertical @cindex Blank lines @cindex Line spacing A line beginning with and containing only @code{@@sp @var{n}} generates @var{n} blank lines of space in both the printed manual and the Info file. @code{@@sp} also forces a paragraph break. For example, @example @@sp 2 @end example @noindent generates two blank lines. The @code{@@sp} command is most often used in the title page.@refill @ignore @c node br, page, sp, Breaks @comment node-name, next, previous, up @c section @code{@@br}: Generate Paragraph Breaks @findex br @r{(paragraph breaks)} @cindex Paragraph breaks @cindex Breaks in a paragraph The @code{@@br} command forces a paragraph break. It inserts a blank line. You can use the command within or at the end of a line. If used within a line, the @code{@@br@{@}} command must be followed by left and right braces (as shown here) to mark the end of the command.@refill @need 700 For example, @example @group This line @@br@{@}contains and is ended by paragraph breaks@@br and is followed by another line. @end group @end example @noindent produces @example @group This line contains and is ended by paragraph breaks and is followed by another line. @end group @end example The @code{@@br} command is seldom used. @end ignore -@node page, group, sp, Breaks -@comment node-name, next, previous, up + +@node page @section @code{@@page}: Start a New Page @cindex Page breaks @findex page A line containing only @code{@@page} starts a new page in a printed manual. The command has no effect on Info files since they are not paginated. An @code{@@page} command is often used in the @code{@@titlepage} -section of a Texinfo file to start the copyright page.@refill +section of a Texinfo file to start the copyright page. + @node group, need, page, Breaks @comment node-name, next, previous, up @section @code{@@group}: Prevent Page Breaks @cindex Group (hold text together vertically) @cindex Holding text together vertically @cindex Vertically holding text together @findex group The @code{@@group} command (on a line by itself) is used inside an @code{@@example} or similar construct to begin an unsplittable vertical group, which will appear entirely on one page in the printed output. The group is terminated by a line containing only @code{@@end group}. These two lines produce no output of their own, and in the Info file output they have no effect at all.@refill @c Once said that these environments @c turn off vertical spacing between ``paragraphs''. @c Also, quotation used to work, but doesn't in texinfo-2.72 Although @code{@@group} would make sense conceptually in a wide variety of contexts, its current implementation works reliably only within @code{@@example} and variants, and within @code{@@display}, @code{@@format}, @code{@@flushleft} and @code{@@flushright}. @xref{Quotations and Examples}. (What all these commands have in common is that each line of input produces a line of output.) In other contexts, @code{@@group} can cause anomalous vertical spacing.@refill @need 750 This formatting requirement means that you should write: @example @group @@example @@group @dots{} @@end group @@end example @end group @end example @noindent with the @code{@@group} and @code{@@end group} commands inside the @code{@@example} and @code{@@end example} commands. The @code{@@group} command is most often used to hold an example together on one page. In this Texinfo manual, more than 100 examples contain text that is enclosed between @code{@@group} and @code{@@end group}. If you forget to end a group, you may get strange and unfathomable error messages when you run @TeX{}. This is because @TeX{} keeps trying to put the rest of the Texinfo file onto the one page and does not start to generate error messages until it has processed 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 @comment node-name, next, previous, up @section @code{@@need @var{mils}}: Prevent Page Breaks @cindex Need space at page bottom @findex need A line containing only @code{@@need @var{n}} starts a new page in a printed manual if fewer than @var{n} mils (thousandths of an inch) remain on the current page. Do not use braces around the argument @var{n}. The @code{@@need} command has no effect on Info files since they are not paginated.@refill @need 800 This paragraph is preceded by an @code{@@need} command that tells @TeX{} to start a new page if fewer than 800 mils (eight-tenths inch) remain on the page. It looks like this:@refill @example @group @@need 800 This paragraph is preceded by @dots{} @end group @end example The @code{@@need} command is useful for preventing orphans (single lines at the bottoms of printed pages).@refill @node Definition Commands @chapter Definition Commands @cindex Definition commands The @code{@@deffn} command and the other @dfn{definition commands} enable you to describe functions, variables, macros, commands, user options, special forms and other such artifacts in a uniform format.@refill In the Info file, a definition causes the entity category---`Function', `Variable', or whatever---to appear at the beginning of the first line of the definition, followed by the entity's name and arguments. In the printed manual, the command causes @TeX{} to print the entity's name and its arguments on the left margin and print the category next to the right margin. In both output formats, the body of the definition is indented. Also, the name of the entity is entered into the appropriate index: @code{@@deffn} enters the name into the index of functions, @code{@@defvr} enters it into the index of variables, and so on.@refill A manual need not and should not contain more than one definition for a given name. An appendix containing a summary should use @code{@@table} rather than the definition commands.@refill @menu * Def Cmd Template:: How to structure a description using a definition command. * Optional Arguments:: How to handle optional and repeated arguments. * deffnx:: How to group two or more `first' lines. * Def Cmds in Detail:: All the definition commands. * Def Cmd Conventions:: Conventions for writing definitions. * Sample Function Definition:: @end menu @node Def Cmd Template, Optional Arguments, Definition Commands, Definition Commands @section The Template for a Definition @cindex Definition template @cindex Template for a definition The @code{@@deffn} command is used for definitions of entities that resemble functions. To write a definition using the @code{@@deffn} command, write the @code{@@deffn} command at the beginning of a line and follow it on the same line by the category of the entity, the name of the entity itself, and its arguments (if any). Then write the body of the definition on succeeding lines. (You may embed examples in the body.) Finally, end the definition with an @code{@@end deffn} command written on a line of its own. (The other definition commands follow the same format.)@refill The template for a definition looks like this: @example @group @@deffn @var{category} @var{name} @var{arguments}@dots{} @var{body-of-definition} @@end deffn @end group @end example @need 700 @noindent For example, @example @group @@deffn Command forward-word count This command moves point forward @@var@{count@} words (or backward if @@var@{count@} is negative). @dots{} @@end deffn @end group @end example @noindent produces @quotation @deffn Command forward-word count This function moves point forward @var{count} words (or backward if @var{count} is negative). @dots{} @end deffn @end quotation Capitalize the category name like a title. If the name of the category contains spaces, as in the phrase `Interactive Command', write braces around it. For example:@refill @example @group @@deffn @{Interactive Command@} isearch-forward @dots{} @@end deffn @end group @end example @noindent Otherwise, the second word will be mistaken for the name of the entity.@refill Some of the definition commands are more general than others. The @code{@@deffn} command, for example, is the general definition command for functions and the like---for entities that may take arguments. When you use this command, you specify the category to which the entity belongs. The @code{@@deffn} command possesses three predefined, specialized variations, @code{@@defun}, @code{@@defmac}, and @code{@@defspec}, that specify the category for you: ``Function'', ``Macro'', and ``Special Form'' respectively. (In Lisp, a special form is an entity much like a function.) The @code{@@defvr} command also is accompanied by several predefined, specialized variations for describing particular kinds of variables.@refill The template for a specialized definition, such as @code{@@defun}, is similar to the template for a generalized definition, except that you do not need to specify the category:@refill @example @group @@defun @var{name} @var{arguments}@dots{} @var{body-of-definition} @@end defun @end group @end example @noindent Thus, @example @group @@defun buffer-end flag This function returns @@code@{(point-min)@} if @@var@{flag@} is less than 1, @@code@{(point-max)@} otherwise. @dots{} @@end defun @end group @end example @noindent produces @quotation @defun buffer-end flag This function returns @code{(point-min)} if @var{flag} is less than 1, @code{(point-max)} otherwise. @dots{} @end defun @end quotation @noindent @xref{Sample Function Definition, Sample Function Definition, A Sample Function Definition}, for a more detailed example of a function definition, including the use of @code{@@example} inside the definition.@refill The other specialized commands work like @code{@@defun}.@refill +@cindex Macros in definition commands +Note that, due to implementation difficulties, macros are not expanded +in @code{@@deffn} and all the other definition commands. + @node Optional Arguments, deffnx, Def Cmd Template, Definition Commands @section Optional and Repeated Arguments @cindex Optional and repeated arguments @cindex Repeated and optional arguments @cindex Arguments, repeated and optional @cindex Syntax, optional & repeated arguments @cindex Meta-syntactic chars for arguments Some entities take optional or repeated arguments, which may be specified by a distinctive glyph that uses square brackets and ellipses. For @w{example}, a special form often breaks its argument list into separate arguments in more complicated ways than a straightforward function.@refill @iftex 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. 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, @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. @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. @c This is consistent with Emacs Lisp Reference manual 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 Here is the @code{@@defspec} line of an example of an imaginary special form:@refill @quotation @defspec foobar (@var{var} [@var{from} @var{to} [@var{inc}]]) @var{body}@dots{} @end defspec @tex \vskip \parskip @end tex @end quotation @noindent In this example, the arguments @var{from} and @var{to} are optional, but must both be present or both absent. If they are present, @var{inc} may optionally be specified as well. These arguments are grouped with the argument @var{var} into a list, to distinguish them from @var{body}, which includes all remaining elements of the form.@refill In a Texinfo source file, this @code{@@defspec} line is written like this (except it would not be split over two lines, as it is in this example).@refill @example @group @@defspec foobar (@@var@{var@} [@@var@{from@} @@var@{to@} [@@var@{inc@}]]) @@var@{body@}@@dots@{@} @end group @end example @noindent The function is listed in the Command and Variable Index under @samp{foobar}.@refill @node deffnx, Def Cmds in Detail, Optional Arguments, Definition Commands @section Two or More `First' Lines @cindex Two `First' Lines for @code{@@deffn} @cindex Grouping two definitions together @cindex Definitions grouped together @findex deffnx To create two or more `first' or header lines for a definition, follow the first @code{@@deffn} line by a line beginning with @code{@@deffnx}. The @code{@@deffnx} command works exactly like @code{@@deffn} except that it does not generate extra vertical white space between it and the preceding line.@refill @need 1000 For example, @example @group @@deffn @{Interactive Command@} isearch-forward @@deffnx @{Interactive Command@} isearch-backward These two search commands are similar except @dots{} @@end deffn @end group @end example @noindent produces @deffn {Interactive Command} isearch-forward @deffnx {Interactive Command} isearch-backward These two search commands are similar except @dots{} @end deffn Each definition command has an `x' form: @code{@@defunx}, @code{@@defvrx}, @code{@@deftypefunx}, etc. The `x' forms work just like @code{@@itemx}; see @ref{itemx, , @code{@@itemx}}. @node Def Cmds in Detail, Def Cmd Conventions, deffnx, Definition Commands @section The Definition Commands Texinfo provides more than a dozen definition commands, all of which are described in this section.@refill The definition commands automatically enter the name of the entity in the appropriate index: for example, @code{@@deffn}, @code{@@defun}, and @code{@@defmac} enter function names in the index of functions; @code{@@defvr} and @code{@@defvar} enter variable names in the index of variables.@refill Although the examples that follow mostly illustrate Lisp, the commands can be used for other programming languages.@refill @menu * Functions Commands:: Commands for functions and similar entities. * Variables Commands:: Commands for variables and similar entities. * Typed Functions:: Commands for functions in typed languages. * Typed Variables:: Commands for variables in typed languages. * Abstract Objects:: Commands for object-oriented programming. * Data Types:: The definition command for data types. @end menu @node Functions Commands, Variables Commands, Def Cmds in Detail, Def Cmds in Detail @subsection Functions and Similar Entities This section describes the commands for describing functions and similar entities:@refill @table @code @findex deffn @item @@deffn @var{category} @var{name} @var{arguments}@dots{} The @code{@@deffn} command is the general definition command for functions, interactive commands, and similar entities that may take arguments. You must choose a term to describe the category of entity being defined; for example, ``Function'' could be used if the entity is a function. The @code{@@deffn} command is written at the beginning of a line and is followed on the same line by the category of entity being described, the name of this particular entity, and its arguments, if any. Terminate the definition with @code{@@end deffn} on a line of its own.@refill @need 750 For example, here is a definition: @example @group @@deffn Command forward-char nchars Move point forward @@var@{nchars@} characters. @@end deffn @end group @end example @noindent This shows a rather terse definition for a ``command'' named @code{forward-char} with one argument, @var{nchars}. @code{@@deffn} prints argument names such as @var{nchars} in italics or upper case, as if @code{@@var} had been used, because we think of these names as metasyntactic variables---they stand for the actual argument values. Within the text of the description, write an argument name explicitly with @code{@@var} to refer to the value of the argument. In the example above, we used @samp{@@var@{nchars@}} in this way. The template for @code{@@deffn} is: @example @group @@deffn @var{category} @var{name} @var{arguments}@dots{} @var{body-of-definition} @@end deffn @end group @end example @findex defun @item @@defun @var{name} @var{arguments}@dots{} The @code{@@defun} command is the definition command for functions. @code{@@defun} is equivalent to @samp{@@deffn Function @dots{}}.@refill @need 800 @noindent For example, @example @group @@defun set symbol new-value Change the value of the symbol @@var@{symbol@} to @@var@{new-value@}. @@end defun @end group @end example @noindent shows a rather terse definition for a function @code{set} whose arguments are @var{symbol} and @var{new-value}. The argument names on the @code{@@defun} line automatically appear in italics or upper case as if they were enclosed in @code{@@var}. Terminate the definition with @code{@@end defun} on a line of its own.@refill The template is: @example @group @@defun @var{function-name} @var{arguments}@dots{} @var{body-of-definition} @@end defun @end group @end example @code{@@defun} creates an entry in the index of functions. @findex defmac @item @@defmac @var{name} @var{arguments}@dots{} The @code{@@defmac} command is the definition command for macros. @code{@@defmac} is equivalent to @samp{@@deffn Macro @dots{}} and works like @code{@@defun}.@refill @findex defspec @item @@defspec @var{name} @var{arguments}@dots{} The @code{@@defspec} command is the definition command for special forms. (In Lisp, a special form is an entity much like a function, @pxref{Special Forms,,, elisp, GNU Emacs Lisp Reference Manual}.) @code{@@defspec} is equivalent to @samp{@@deffn @{Special Form@} @dots{}} and works like @code{@@defun}.@refill @end table @node Variables Commands, Typed Functions, Functions Commands, Def Cmds in Detail @subsection Variables and Similar Entities Here are the commands for defining variables and similar entities:@refill @table @code @findex defvr @item @@defvr @var{category} @var{name} The @code{@@defvr} command is a general definition command for something like a variable---an entity that records a value. You must choose a term to describe the category of entity being defined; for example, ``Variable'' could be used if the entity is a variable. Write the @code{@@defvr} command at the beginning of a line and follow it on the same line by the category of the entity and the name of the entity. Capitalize the category name like a title. If the name of the category contains spaces, as in the name ``User Option'', enclose it in braces. Otherwise, the second word will be mistaken for the name of the entity. For example, @example @group @@defvr @{User Option@} fill-column This buffer-local variable specifies the maximum width of filled lines. @dots{} @@end defvr @end group @end example Terminate the definition with @code{@@end defvr} on a line of its own.@refill The template is: @example @group @@defvr @var{category} @var{name} @var{body-of-definition} @@end defvr @end group @end example @code{@@defvr} creates an entry in the index of variables for @var{name}. @findex defvar @item @@defvar @var{name} The @code{@@defvar} command is the definition command for variables. @code{@@defvar} is equivalent to @samp{@@defvr Variable @dots{}}.@refill @need 750 For example: @example @group @@defvar kill-ring @dots{} @@end defvar @end group @end example The template is: @example @group @@defvar @var{name} @var{body-of-definition} @@end defvar @end group @end example @code{@@defvar} creates an entry in the index of variables for @var{name}.@refill @findex defopt @item @@defopt @var{name} @cindex User options, marking The @code{@@defopt} command is the definition command for @dfn{user options}, i.e., variables intended for users to change according to taste; Emacs has many such (@pxref{Variables,,, emacs, The GNU Emacs Manual}). @code{@@defopt} is equivalent to @samp{@@defvr @{User Option@} @dots{}} and works like @code{@@defvar}.@refill @end table @node Typed Functions, Typed Variables, Variables Commands, Def Cmds in Detail @subsection Functions in Typed Languages The @code{@@deftypefn} command and its variations are for describing functions in languages in which you must declare types of variables and functions, such as C and C++. @table @code @findex deftypefn @item @@deftypefn @var{category} @var{data-type} @var{name} @var{arguments}@dots{} The @code{@@deftypefn} command is the general definition command for functions and similar entities that may take arguments and that are typed. The @code{@@deftypefn} command is written at the beginning of a line and is followed on the same line by the category of entity being described, the type of the returned value, the name of this particular entity, and its arguments, if any.@refill @need 800 @noindent For example, @example @group @@deftypefn @{Library Function@} int foobar (int @@var@{foo@}, float @@var@{bar@}) @dots{} @@end deftypefn @end group @end example @need 1000 @noindent (where the text before the ``@dots{}'', shown above as two lines, would actually be a single line in a real Texinfo file) produces the following in Info: @smallexample @group -- Library Function: int foobar (int FOO, float BAR) @dots{} @end group @end smallexample @iftex In a printed manual, it produces: @quotation @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) @dots{} @end deftypefn @end quotation @end iftex This means that @code{foobar} is a ``library function'' that returns an @code{int}, and its arguments are @var{foo} (an @code{int}) and @var{bar} (a @code{float}).@refill The argument names that you write in @code{@@deftypefn} are not subject to an implicit @code{@@var}---since the actual names of the arguments in @code{@@deftypefn} are typically scattered among data type names and keywords, Texinfo cannot find them without help. Instead, you must write @code{@@var} explicitly around the argument names. In the example above, the argument names are @samp{foo} and @samp{bar}.@refill The template for @code{@@deftypefn} is:@refill @example @group @@deftypefn @var{category} @var{data-type} @var{name} @var{arguments} @dots{} @var{body-of-description} @@end deftypefn @end group @end example @noindent Note that if the @var{category} or @var{data type} is more than one word then it must be enclosed in braces to make it a single argument.@refill If you are describing a procedure in a language that has packages, such as Ada, you might consider using @code{@@deftypefn} in a manner somewhat contrary to the convention described in the preceding paragraphs.@refill @need 800 @noindent For example: @example @group @@deftypefn stacks private push (@@var@{s@}:in out stack; @@var@{n@}:in integer) @dots{} @@end deftypefn @end group @end example @noindent (The @code{@@deftypefn} arguments are shown split into three lines, but would be a single line in a real Texinfo file.) In this instance, the procedure is classified as belonging to the package @code{stacks} rather than classified as a `procedure' and its data type is described as @code{private}. (The name of the procedure is @code{push}, and its arguments are @var{s} and @var{n}.)@refill @code{@@deftypefn} creates an entry in the index of functions for @var{name}.@refill @item @@deftypefun @var{data-type} @var{name} @var{arguments}@dots{} @findex deftypefun The @code{@@deftypefun} command is the specialized definition command for functions in typed languages. The command is equivalent to @samp{@@deftypefn Function @dots{}}.@refill @need 800 @noindent Thus, @smallexample @group @@deftypefun int foobar (int @@var@{foo@}, float @@var@{bar@}) @dots{} @@end deftypefun @end group @end smallexample @noindent produces the following in Info: @example @group -- Function: int foobar (int FOO, float BAR) @dots{} @end group @end example @iftex @need 800 @noindent and the following in a printed manual: @quotation @deftypefun int foobar (int @var{foo}, float @var{bar}) @dots{} @end deftypefun @end quotation @end iftex @need 800 The template is: @example @group @@deftypefun @var{type} @var{name} @var{arguments}@dots{} @var{body-of-description} @@end deftypefun @end group @end example @code{@@deftypefun} creates an entry in the index of functions for @var{name}.@refill @end table @node Typed Variables, Abstract Objects, Typed Functions, Def Cmds in Detail @subsection Variables in Typed Languages Variables in typed languages are handled in a manner similar to functions in typed languages. @xref{Typed Functions}. The general definition command @code{@@deftypevr} corresponds to @code{@@deftypefn} and the specialized definition command @code{@@deftypevar} corresponds to @code{@@deftypefun}.@refill @table @code @findex deftypevr @item @@deftypevr @var{category} @var{data-type} @var{name} The @code{@@deftypevr} command is the general definition command for something like a variable in a typed language---an entity that records a value. You must choose a term to describe the category of the entity being defined; for example, ``Variable'' could be used if the entity is a variable.@refill The @code{@@deftypevr} command is written at the beginning of a line and is followed on the same line by the category of the entity being described, the data type, and the name of this particular entity.@refill @need 800 @noindent For example: @example @group @@deftypevr @{Global Flag@} int enable @dots{} @@end deftypevr @end group @end example @noindent produces the following in Info: @example @group -- Global Flag: int enable @dots{} @end group @end example @iftex @noindent and the following in a printed manual: @quotation @deftypevr {Global Flag} int enable @dots{} @end deftypevr @end quotation @end iftex @need 800 The template is: @example @@deftypevr @var{category} @var{data-type} @var{name} @var{body-of-description} @@end deftypevr @end example @code{@@deftypevr} creates an entry in the index of variables for @var{name}.@refill @findex deftypevar @item @@deftypevar @var{data-type} @var{name} The @code{@@deftypevar} command is the specialized definition command for variables in typed languages. @code{@@deftypevar} is equivalent to @samp{@@deftypevr Variable @dots{}}.@refill @need 800 @noindent For example: @example @group @@deftypevar int fubar @dots{} @@end deftypevar @end group @end example @noindent produces the following in Info: @example @group -- Variable: int fubar @dots{} @end group @end example @iftex @need 800 @noindent and the following in a printed manual: @quotation @deftypevar int fubar @dots{} @end deftypevar @end quotation @end iftex @need 800 @noindent The template is: @example @group @@deftypevar @var{data-type} @var{name} @var{body-of-description} @@end deftypevar @end group @end example @code{@@deftypevar} creates an entry in the index of variables for @var{name}.@refill @end table @node Abstract Objects @subsection Object-Oriented Programming Here are the commands for formatting descriptions about abstract objects, such as are used in object-oriented programming. A class is a defined type of abstract object. An instance of a class is a particular object that has the type of the class. An instance variable is a variable that belongs to the class but for which each instance has its own value.@refill In a definition, if the name of a class is truly a name defined in the programming system for a class, then you should write an @code{@@code} around it. Otherwise, it is printed in the usual text font.@refill @table @code @findex defcv @item @@defcv @var{category} @var{class} @var{name} The @code{@@defcv} command is the general definition command for variables associated with classes in object-oriented programming. The @code{@@defcv} command is followed by three arguments: the category of thing being defined, the class to which it belongs, and its name. Thus,@refill @example @group @@defcv @{Class Option@} Window border-pattern @dots{} @@end defcv @end group @end example @noindent illustrates how you would write the first line of a definition of the @code{border-pattern} class option of the class @code{Window}.@refill The template is: @example @group @@defcv @var{category} @var{class} @var{name} @dots{} @@end defcv @end group @end example @code{@@defcv} creates an entry in the index of variables. @findex defivar @item @@defivar @var{class} @var{name} The @code{@@defivar} command is the definition command for instance variables in object-oriented programming. @code{@@defivar} is equivalent to @samp{@@defcv @{Instance Variable@} @dots{}}@refill The template is: @example @group @@defivar @var{class} @var{instance-variable-name} @var{body-of-definition} @@end defivar @end group @end example @code{@@defivar} creates an entry in the index of variables. @findex deftypeivar @item @@deftypeivar @var{class} @var{data-type} @var{name} The @code{@@deftypeivar} command is the definition command for typed instance variables in object-oriented programming. It is similar to @code{@@defivar} with the addition of the @var{data-type} parameter to specify the type of the instance variable. @code{@@deftypeivar} creates an entry in the index of variables. @findex defop @item @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{} The @code{@@defop} command is the general definition command for entities that may resemble methods in object-oriented programming. These entities take arguments, as functions do, but are associated with particular classes of objects.@refill For example, some systems have constructs called @dfn{wrappers} that are associated with classes as methods are, but that act more like macros than like functions. You could use @code{@@defop Wrapper} to describe one of these.@refill Sometimes it is useful to distinguish methods and @dfn{operations}. You can think of an operation as the specification for a method. Thus, a window system might specify that all window classes have a method named @code{expose}; we would say that this window system defines an @code{expose} operation on windows in general. Typically, the operation has a name and also specifies the pattern of arguments; all methods that implement the operation must accept the same arguments, since applications that use the operation do so without knowing which method will implement it.@refill Often it makes more sense to document operations than methods. For example, window application developers need to know about the @code{expose} operation, but need not be concerned with whether a given class of windows has its own method to implement this operation. To describe this operation, you would write:@refill @example @@defop Operation windows expose @end example The @code{@@defop} command is written at the beginning of a line and is followed on the same line by the overall name of the category of operation, the name of the class of the operation, the name of the operation, and its arguments, if any.@refill The template is: @example @group @@defop @var{category} @var{class} @var{name} @var{arguments}@dots{} @var{body-of-definition} @@end defop @end group @end example @code{@@defop} creates an entry, such as `@code{expose} on @code{windows}', in the index of functions.@refill @findex deftypeop @item @@deftypeop @var{category} @var{class} @var{data-type} @var{name} @var{arguments}@dots{} The @code{@@deftypeop} command is the definition command for typed operations in object-oriented programming. It is similar to @code{@@defop} with the addition of the @var{data-type} parameter to specify the return type of the method. @code{@@deftypeop} creates an entry in the index of functions. @item @@defmethod @var{class} @var{name} @var{arguments}@dots{} @findex defmethod The @code{@@defmethod} command is the definition command for methods in object-oriented programming. A method is a kind of function that implements an operation for a particular class of objects and its subclasses. @ignore @c ADR: Who cares?!? @c KB: Oh, I don't know, I think this info is crucial! In the Lisp Machine, methods actually were functions, but they were usually defined with @code{defmethod}. @end ignore @code{@@defmethod} is equivalent to @samp{@@defop Method @dots{}}. The command is written at the beginning of a line and is followed by the name of the class of the method, the name of the method, and its arguments, if any.@refill @noindent For example: @example @group @@defmethod @code{bar-class} bar-method argument @dots{} @@end defmethod @end group @end example @noindent illustrates the definition for a method called @code{bar-method} of the class @code{bar-class}. The method takes an argument.@refill The template is: @example @group @@defmethod @var{class} @var{method-name} @var{arguments}@dots{} @var{body-of-definition} @@end defmethod @end group @end example @code{@@defmethod} creates an entry, such as `@code{bar-method} on @code{bar-class}', in the index of functions.@refill @item @@deftypemethod @var{class} @var{data-type} @var{name} @var{arguments}@dots{} @findex defmethod The @code{@@deftypemethod} command is the definition command for methods in object-oriented typed languages, such as C++ and Java. It is similar to the @code{@@defmethod} command with the addition of the @var{data-type} parameter to specify the return type of the method. @end table @node Data Types @subsection Data Types Here is the command for data types:@refill @table @code @findex deftp @item @@deftp @var{category} @var{name} @var{attributes}@dots{} The @code{@@deftp} command is the generic definition command for data types. The command is written at the beginning of a line and is followed on the same line by the category, by the name of the type (which is a word like @code{int} or @code{float}), and then by names of attributes of objects of that type. Thus, you could use this command for describing @code{int} or @code{float}, in which case you could use @code{data type} as the category. (A data type is a category of certain objects for purposes of deciding which operations can be performed on them.)@refill In Lisp, for example, @dfn{pair} names a particular data type, and an object of that type has two slots called the @sc{car} and the @sc{cdr}. Here is how you would write the first line of a definition of @code{pair}.@refill @example @group @@deftp @{Data type@} pair car cdr @dots{} @@end deftp @end group @end example @need 950 The template is: @example @group @@deftp @var{category} @var{name-of-type} @var{attributes}@dots{} @var{body-of-definition} @@end deftp @end group @end example @code{@@deftp} creates an entry in the index of data types. @end table @node Def Cmd Conventions, Sample Function Definition, Def Cmds in Detail, Definition Commands @section Conventions for Writing Definitions @cindex Definition conventions @cindex Conventions for writing definitions When you write a definition using @code{@@deffn}, @code{@@defun}, or one of the other definition commands, please take care to use arguments that indicate the meaning, as with the @var{count} argument 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 @section A Sample Function Definition @cindex Function definitions @cindex Command definitions @cindex Macro definitions @cindex Sample function definition A function definition uses the @code{@@defun} and @code{@@end defun} commands. The name of the function follows immediately after the @code{@@defun} command and it is followed, on the same line, by the parameter list.@refill Here is a definition from @ref{Calling Functions,,, elisp, The GNU Emacs Lisp Reference Manual}. @quotation @defun apply function &rest arguments @code{apply} calls @var{function} with @var{arguments}, just like @code{funcall} but with one difference: the last of @var{arguments} is a list of arguments to give to @var{function}, rather than a single argument. We also say that this list is @dfn{appended} to the other arguments. @code{apply} returns the result of calling @var{function}. As with @code{funcall}, @var{function} must either be a Lisp function or a primitive function; special forms and macros do not make sense in @code{apply}. @example (setq f 'list) @result{} list (apply f 'x 'y 'z) @error{} Wrong type argument: listp, z (apply '+ 1 2 '(3 4)) @result{} 10 (apply '+ '(1 2 3 4)) @result{} 10 (apply 'append '((a b c) nil (x y z) nil)) @result{} (a b c x y z) @end example An interesting example of using @code{apply} is found in the description of @code{mapcar}.@refill @end defun @end quotation @need 1200 In the Texinfo source file, this example looks like this: @example @group @@defun apply function &rest arguments @@code@{apply@} calls @@var@{function@} with @@var@{arguments@}, just like @@code@{funcall@} but with one difference: the last of @@var@{arguments@} is a list of arguments to give to @@var@{function@}, rather than a single argument. We also say that this list is @@dfn@{appended@} to the other arguments. @end group @group @@code@{apply@} returns the result of calling @@var@{function@}. As with @@code@{funcall@}, @@var@{function@} must either be a Lisp function or a primitive function; special forms and macros do not make sense in @@code@{apply@}. @end group @group @@example (setq f 'list) @@result@{@} list (apply f 'x 'y 'z) @@error@{@} Wrong type argument: listp, z (apply '+ 1 2 '(3 4)) @@result@{@} 10 (apply '+ '(1 2 3 4)) @@result@{@} 10 (apply 'append '((a b c) nil (x y z) nil)) @@result@{@} (a b c x y z) @@end example @end group @group An interesting example of using @@code@{apply@} is found in the description of @@code@{mapcar@}. @@end defun @end group @end example @noindent In this manual, this function is listed in the Command and Variable Index under @code{apply}.@refill Ordinary variables and user options are described using a format like that for functions except that variables do not take arguments. @node Conditionals @chapter Conditionally Visible Text @cindex Conditionally visible text @cindex Text, conditionally visible @cindex Visibility of conditional text @cindex If text conditionally visible Sometimes it is good to use different text for different output formats. For example, you can use the @dfn{conditional commands} to specify different text for the printed manual and the Info output. Conditional commands may not be nested. The conditional commands comprise the following categories. @itemize @bullet @item Commands for HTML, Info, or @TeX{}. @item Commands for not HTML, Info, or @TeX{}. @item Raw @TeX{} or HTML commands. @item Substituting text for all formats, and testing if a flag is set or clear. @end itemize @menu * Conditional Commands:: Specifying text for HTML, Info, or @TeX{}. * Conditional Not Commands:: Specifying text for not HTML, Info, or @TeX{}. * Raw Formatter Commands:: Using raw @TeX{} or HTML commands. * set clear value:: Designating which text to format (for all output formats); and how to set a flag to a string that you can insert. @end menu @node Conditional Commands @section Conditional Commands @findex ifinfo @code{@@ifinfo} begins segments of text that should be ignored by @TeX{} when it typesets the printed manual. The segment of text appears only in the Info file. The @code{@@ifinfo} command should appear on a line by itself; end the Info-only text with a line containing @code{@@end ifinfo} by itself. At the beginning of a Texinfo file, the Info permissions are contained within a region marked by @code{@@ifinfo} and @code{@@end ifinfo}. (@xref{Info Summary and Permissions}.) @findex iftex @findex ifhtml 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. Likewise for @code{@@ifhtml} and @code{@@end ifhtml}, which specify text to appear only in HTML output.@refill For example, @example @@iftex This text will appear only in the printed manual. @@end iftex @@ifinfo However, this text will appear only in Info. @@end ifinfo @@ifhtml And this text will only appear in HTML. @@end ifhtml @end example @noindent The preceding example produces the following line: @iftex This text will appear only in the printed manual. @end iftex @ifinfo However, this text will appear only in Info. @end ifinfo @ifhtml And this text will only appear in HTML. @end ifhtml @noindent Notice that you only see one of the input lines, depending on which version of the manual you are reading. @node Conditional Not Commands @section Conditional Not Commands @findex ifnothtml @findex ifnotinfo @findex ifnottex You can specify text to be included in any output format @emph{other} than some given one with the @code{@@ifnot@dots{}} commands: @example @@ifnothtml @dots{} @@end ifnothtml @@ifnotinfo @dots{} @@end ifnotinfo @@ifnottex @dots{} @@end ifnottex @end example @noindent (The @code{@@ifnot@dots{}} command and the @code{@@end} command must actually appear on lines by themselves.) If the output file is not being made for the given format, the region is included. Otherwise, it is ignored. The regions delimited by these commands are ordinary Texinfo source as with @code{@@iftex}, not raw formatter source as with @code{@@tex} (@pxref{Raw Formatter Commands}). -@node Raw Formatter Commands, set clear value, Conditional Not Commands, Conditionals +@node Raw Formatter Commands @section Raw Formatter Commands @cindex @TeX{} commands, using ordinary @cindex HTML commands, using ordinary @cindex Raw formatter commands @cindex Ordinary @TeX{} commands, using @cindex Ordinary HTML commands, using @cindex Commands using raw @TeX{} @cindex Commands using raw HTML @cindex plain @TeX{} Inside a region delineated by @code{@@iftex} and @code{@@end iftex}, you can embed some raw @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 by @TeX{} with an @samp{@@}. For example, in the @code{@@titlepage} section of a Texinfo file, you can use the @TeX{} command @code{@@vskip} to format the copyright page. (The @code{@@titlepage} command causes Info to ignore the region automatically, as it does with the @code{@@iftex} command.) However, many features of plain @TeX{} will not work, as they are overridden by Texinfo features. @findex 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} command.) The sole exception is that the @code{@@} character still introduces a command, so that @code{@@end tex} can be recognized properly. @cindex Mathematical expressions For example, here is a mathematical expression written in plain @TeX{}: @example @@tex $$ \chi^2 = \sum_@{i=1@}^N \left (y_i - (a + b x_i) \over \sigma_i\right)^2 $$ @@end tex @end example @noindent The output of this example will appear only in a printed manual. If you are reading this in Info, you will not see the equation that appears in the printed manual. @iftex In a printed manual, the above expression looks like this: @end iftex @tex $$ \chi^2 = \sum_{i=1}^N \left(y_i - (a + b x_i) \over \sigma_i\right)^2 $$ @end tex @findex ifhtml @findex html Analogously, you can use @code{@@ifhtml @dots{} @@end ifhtml} to delimit a region to be included in HTML output only, and @code{@@html @dots{} @@end html} for a region of raw HTML (again, except that @code{@@} is still the escape character, so the @code{@@end} command can be recognized.) @node set clear value @section @code{@@set}, @code{@@clear}, and @code{@@value} You can direct the Texinfo formatting commands to format or ignore parts of a Texinfo file with the @code{@@set}, @code{@@clear}, @code{@@ifset}, and @code{@@ifclear} commands.@refill -In addition, you can use the @code{@@set @var{flag}} command to set the -value of @var{flag} to a string of characters; and use -@code{@@value@{@var{flag}@}} to insert that string. You can use -@code{@@set}, for example, to set a date and use @code{@@value} to -insert the date in several places in the Texinfo file.@refill +Brief descriptions: -@menu -* ifset ifclear:: Format a region if a flag is set. -* set value:: Expand a flag variable to a string. -* value Example:: An easy way to update edition information. -@end menu +@table @code +@item @@set @var{flag} [@var{value}] +Set the variable @var{flag}, to the optional @var{value} if specifed. - -@node ifset ifclear -@subsection @code{@@ifset} and @code{@@ifclear} - -@findex ifset -When a @var{flag} is set, the Texinfo formatting commands format text -between subsequent pairs of @code{@@ifset @var{flag}} and @code{@@end -ifset} commands. When the @var{flag} is cleared, the Texinfo formatting -commands do @emph{not} format the text. - -Use the @code{@@set @var{flag}} command to turn on, or @dfn{set}, a -@var{flag}; a @dfn{flag} name can be any single word, containing -letters, numerals, hyphens, or underscores. - -The format for the command looks like this:@refill -@findex set - -@example -@@set @var{flag} -@end example - -Write the conditionally formatted text between @code{@@ifset @var{flag}} -and @code{@@end ifset} commands, like this:@refill - -@example -@group -@@ifset @var{flag} -@var{conditional-text} -@@end ifset -@end group -@end example - -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 -without hurting them. - -@@set large - -@@ifset large -It can also dig up fully grown trees. -@@end ifset - -Remember to replant promptly @dots{} -@end example - -@noindent -In the example, the formatting commands will format the text between -@code{@@ifset large} and @code{@@end ifset} because the @code{large} -flag is set.@refill - -@findex clear -Use the @code{@@clear @var{flag}} command to turn off, or @dfn{clear}, -a flag. Clearing a flag is the opposite of setting a flag. The -command looks like this:@refill - -@example -@@clear @var{flag} -@end example - -@noindent -Write the command on a line of its own. - -When @var{flag} is cleared, the Texinfo formatting commands do -@emph{not} format the text between @code{@@ifset @var{flag}} and -@code{@@end ifset}; that text is ignored and does not appear in either -printed or Info output.@refill - -For example, if you clear the flag of the preceding example by writing -an @code{@@clear large} command after the @code{@@set large} command -(but before the conditional text), then the Texinfo formatting commands -ignore the text between the @code{@@ifset large} and @code{@@end ifset} -commands. In the formatted output, that text does not appear; in both -printed and Info output, you see only the lines that say, ``You can use -this machine to dig up shrubs without hurting them. Remember to replant -promptly @dots{}''. - -@findex ifclear -If a flag is cleared with an @code{@@clear @var{flag}} command, then -the formatting commands format text between subsequent pairs of -@code{@@ifclear} and @code{@@end ifclear} commands. But if the flag -is set with @code{@@set @var{flag}}, then the formatting commands do -@emph{not} format text between an @code{@@ifclear} and an @code{@@end -ifclear} command; rather, they ignore that text. An @code{@@ifclear} -command looks like this:@refill - -@example -@@ifclear @var{flag} -@end example - -@need 700 -In brief, the commands are:@refill - -@table @code -@item @@set @var{flag} -Tell the Texinfo formatting commands that @var{flag} is set.@refill - -@item @@clear @var{flag} -Tell the Texinfo formatting commands that @var{flag} is cleared.@refill +@item @@clear @var{flag} +Undefine the variable @var{flag}, whether or not it was previously defined. @item @@ifset @var{flag} -If @var{flag} is set, tell the Texinfo formatting commands to format -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 +If @var{flag} is set, text through the next @code{@@end ifset} command +is formatted. If @var{flag} is clear, text through the following +@code{@@end ifset} command is ignored. @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 - -If @var{flag} is cleared, tell the Texinfo formatting commands to -format the text up to the following @code{@@end ifclear} -command.@refill +If @var{flag} is set, text through the next @code{@@end ifclear} command +is ignored. If @var{flag} is clear, text through the following +@code{@@end ifclear} command is formatted. @end table +@menu +* set value:: Expand a flag variable to a string. +* ifset ifclear:: Format a region if a flag is set. +* value Example:: An easy way to update edition information. +@end menu + @node set value @subsection @code{@@set} and @code{@@value} @findex value -You can use the @code{@@set} command to specify a value for a flag, -which is expanded by the @code{@@value} command. A flag is an -identifier; for best results, use only letters and numerals in a flag -name, not @samp{-} or @samp{_}---they will work in some contexts, but -not all, due to limitations in @TeX{}. The value is just a string of -characters, the remainder of the input line. +You use the @code{@@set} command to specify a value for a flag, which is +later expanded by the @code{@@value} command. + +A @dfn{flag} is an identifier. In general, it is best to use only +letters and numerals in a flag name, not @samp{-} or @samp{_}---they +will work in some contexts, but not all, due to limitations in @TeX{}. + +The value is the remainder of the input line, and can contain anything. Write the @code{@@set} command like this: @example @@set foo This is a string. @end example @noindent This sets the value of the flag @code{foo} to ``This is a string.''. The Texinfo formatters then replace an @code{@@value@{@var{flag}@}} command with the string to which @var{flag} is set. Thus, when -@code{foo} is set as shown above, the Texinfo formatters convert +@code{foo} is set as shown above, the Texinfo formatters convert this: @example @group @@value@{foo@} -@exdent @r{to} +@exdent @r{to this:} This is a string. @end group @end example You can write an @code{@@value} command within a paragraph; but you must write an @code{@@set} command on a line of its own. If you write the @code{@@set} command like this: @example @@set foo @end example @noindent -without specifying a string, the value of @code{foo} is an empty string. +without specifying a string, the value of @code{foo} is the empty string. If you clear a previously set flag with @code{@@clear @var{flag}}, a -subsequent @code{@@value@{flag@}} command is invalid and the string is -replaced with an error message that says @samp{@{No value for -"@var{flag}"@}}. +subsequent @code{@@value@{flag@}} command will report an error. For example, if you set @code{foo} as follows:@refill @example @@set how-much very, very, very @end example @noindent then the formatters transform @example @group It is a @@value@{how-much@} wet day. @exdent @r{into} It is a very, very, very wet day. @end group @end example If you write @example @@clear how-much @end example @noindent then the formatters transform @example @group It is a @@value@{how-much@} wet day. @exdent @r{into} It is a @{No value for "how-much"@} wet day. @end group @end example +@node ifset ifclear +@subsection @code{@@ifset} and @code{@@ifclear} + +@findex ifset +When a @var{flag} is set, the Texinfo formatting commands format text +between subsequent pairs of @code{@@ifset @var{flag}} and @code{@@end +ifset} commands. When the @var{flag} is cleared, the Texinfo formatting +commands do @emph{not} format the text. @code{@@ifclear} operates +analogously. + +Write the conditionally formatted text between @code{@@ifset @var{flag}} +and @code{@@end ifset} commands, like this: + +@example +@group +@@ifset @var{flag} +@var{conditional-text} +@@end ifset +@end group +@end example + +For example, you can create one document that has two variants, such as +a manual for a `large' and `small' model: + +@cindex shrubbery +@example +You can use this machine to dig up shrubs +without hurting them. + +@@set large + +@@ifset large +It can also dig up fully grown trees. +@@end ifset + +Remember to replant promptly @dots{} +@end example + +@noindent +In the example, the formatting commands will format the text between +@code{@@ifset large} and @code{@@end ifset} because the @code{large} +flag is set. + +When @var{flag} is cleared, the Texinfo formatting commands do +@emph{not} format the text between @code{@@ifset @var{flag}} and +@code{@@end ifset}; that text is ignored and does not appear in either +printed or Info output. + +For example, if you clear the flag of the preceding example by writing +an @code{@@clear large} command after the @code{@@set large} command +(but before the conditional text), then the Texinfo formatting commands +ignore the text between the @code{@@ifset large} and @code{@@end ifset} +commands. In the formatted output, that text does not appear; in both +printed and Info output, you see only the lines that say, ``You can use +this machine to dig up shrubs without hurting them. Remember to replant +promptly @dots{}''. + +@findex ifclear +If a flag is cleared with an @code{@@clear @var{flag}} command, then +the formatting commands format text between subsequent pairs of +@code{@@ifclear} and @code{@@end ifclear} commands. But if the flag +is set with @code{@@set @var{flag}}, then the formatting commands do +@emph{not} format text between an @code{@@ifclear} and an @code{@@end +ifclear} command; rather, they ignore that text. An @code{@@ifclear} +command looks like this: + +@example +@@ifclear @var{flag} +@end example + + @node value Example @subsection @code{@@value} Example -You can use the @code{@@value} command to limit the number of places you -need to change when you record an update to a manual. Here is how it is -done in @cite{The GNU Make Manual}: +You can use the @code{@@value} command to minimize the number of places +you need to change when you record an update to a manual. Here is how +it is done in @cite{The GNU Make Manual}: @enumerate @item Set the flags: @example @group @@set EDITION 0.35 Beta @@set VERSION 3.63 Beta @@set UPDATED 14 August 1992 @@set UPDATE-MONTH August 1992 @end group @end example @item Write text for the first @code{@@ifinfo} section, for people reading the Texinfo file: @example @group This is Edition @@value@{EDITION@}, last updated @@value@{UPDATED@}, of @@cite@{The GNU Make Manual@}, for @@code@{make@}, version @@value@{VERSION@}. @end group @end example @item Write text for the title page, for people reading the printed manual: @c List only the month and the year since that looks less fussy on a @c printed cover than a date that lists the day as well. @example @group @@title GNU Make @@subtitle A Program for Directing Recompilation @@subtitle Edition @@value@{EDITION@}, @dots{} @@subtitle @@value@{UPDATE-MONTH@} @end group @end example @noindent (On a printed cover, a date listing the month and the year looks less fussy than a date listing the day as well as the month and year.) @item Write text for the Top node, for people reading the Info file: @example @group This is Edition @@value@{EDITION@} of the @@cite@{GNU Make Manual@}, last updated @@value@{UPDATED@} for @@code@{make@} Version @@value@{VERSION@}. @end group @end example After you format the manual, the text in the first @code{@@ifinfo} section looks like this: @example @group This is Edition 0.35 Beta, last updated 14 August 1992, of `The GNU Make Manual', for `make', Version 3.63 Beta. @end group @end example @end enumerate When you update the manual, change only the values of the flags; you do not need to edit the three sections. @node Internationalization @chapter Internationalization @cindex Internationalization Texinfo has some support for writing in languages other than English, although this area still needs considerable work. For a list of the various accented and special characters Texinfo supports, see @ref{Inserting Accents}. @menu * documentlanguage:: Declaring the current language. * documentencoding:: Declaring the input encoding. @end menu @node documentlanguage @section @code{@@documentlanguage @var{cc}}: Set the Document Language @findex documentlanguage @cindex Language, declaring @cindex Document language, declaring The @code{@@documentlanguage} command declares the current document language. Write it on a line by itself, with a two-letter ISO-639 language code following (list is included below). If you have a multilingual document, the intent is to be able to use this command multiple times, to declare each language change. If the command is not used at all, the default is @code{en} for English. @cindex @file{txi-@var{cc}.tex} At present, this command is ignored in Info and HTML output. For @TeX{}, it causes the file @file{txi-@var{cc}.tex} to be read (if it exists). Such a file appropriately redefines the various English words used in @TeX{} output, such as `Chapter', `See', and so on. @cindex Hyphenation patterns, language-dependent It would be good if this command also changed @TeX{}'s ideas of the current hyphenation patterns (via the @TeX{} primitive @code{\language}), but this is unfortunately not currently implemented. @cindex ISO 639 codes @cindex Language codes -@cindex African languages -Here is the list of valid language codes. This list comes from -@uref{http://www.iro.umontreal.ca/contrib/po/iso-639, the free -translation project}. In the future we may wish to allow the 3-letter -POV codes described at @uref{http://www.sil.org/ethnologue/#contents}. -This will be necessary to support African languages. - -@multitable @columnfractions .06 .27 .06 .27 .06 .27 +Hereare the valid language codes, from ISO-639. + +@multitable @columnfractions .07 .26 .07 .26 .07 .26 @item @code{aa} @tab Afar @tab @code{ab} @tab Abkhazian @tab @code{af} @tab Afrikaans @item @code{am} @tab Amharic @tab @code{ar} @tab Arabic @tab @code{as} @tab Assamese @item @code{ay} @tab Aymara @tab @code{az} @tab Azerbaijani @tab @code{ba} @tab Bashkir @item @code{be} @tab Byelorussian @tab @code{bg} @tab Bulgarian @tab @code{bh} @tab Bihari @item @code{bi} @tab Bislama @tab @code{bn} @tab Bengali; Bangla @tab @code{bo} @tab Tibetan @item @code{br} @tab Breton @tab @code{ca} @tab Catalan @tab @code{co} @tab Corsican @item @code{cs} @tab Czech @tab @code{cy} @tab Welsh @tab @code{da} @tab Danish @item @code{de} @tab German @tab @code{dz} @tab Bhutani @tab @code{el} @tab Greek @item @code{en} @tab English @tab @code{eo} @tab Esperanto @tab @code{es} @tab Spanish @item @code{et} @tab Estonian @tab @code{eu} @tab Basque @tab @code{fa} @tab Persian @item @code{fi} @tab Finnish @tab @code{fj} @tab Fiji @tab @code{fo} @tab Faroese @item @code{fr} @tab French @tab @code{fy} @tab Frisian @tab @code{ga} @tab Irish @item @code{gd} @tab Scots Gaelic @tab @code{gl} @tab Galician @tab @code{gn} @tab Guarani @item @code{gu} @tab Gujarati @tab @code{ha} @tab Hausa @tab @code{he} @tab Hebrew @item @code{hi} @tab Hindi @tab @code{hr} @tab Croatian @tab @code{hu} @tab Hungarian @item @code{hy} @tab Armenian @tab @code{ia} @tab Interlingua @tab @code{id} @tab Indonesian @item @code{ie} @tab Interlingue @tab @code{ik} @tab Inupiak @tab @code{is} @tab Icelandic @item @code{it} @tab Italian @tab @code{iu} @tab Inuktitut @tab @code{ja} @tab Japanese @item @code{jw} @tab Javanese @tab @code{ka} @tab Georgian @tab @code{kk} @tab Kazakh @item @code{kl} @tab Greenlandic @tab @code{km} @tab Cambodian @tab @code{kn} @tab Kannada @item @code{ks} @tab Kashmiri @tab @code{ko} @tab Korean @tab @code{ku} @tab Kurdish @item @code{ky} @tab Kirghiz @tab @code{la} @tab Latin @tab @code{ln} @tab Lingala @item @code{lt} @tab Lithuanian @tab @code{lo} @tab Laothian @tab @code{lv} @tab Latvian, Lettish @item @code{mg} @tab Malagasy @tab @code{mi} @tab Maori @tab @code{mk} @tab Macedonian @item @code{ml} @tab Malayalam @tab @code{mn} @tab Mongolian @tab @code{mo} @tab Moldavian @item @code{mr} @tab Marathi @tab @code{ms} @tab Malay @tab @code{mt} @tab Maltese @item @code{my} @tab Burmese @tab @code{na} @tab Nauru @tab @code{ne} @tab Nepali @item @code{nl} @tab Dutch @tab @code{no} @tab Norwegian @tab @code{oc} @tab Occitan @item @code{om} @tab (Afan) Oromo @tab @code{or} @tab Oriya @tab @code{pa} @tab Punjabi @item @code{pl} @tab Polish @tab @code{ps} @tab Pashto, Pushto @tab @code{pt} @tab Portuguese @item @code{qu} @tab Quechua @tab @code{rm} @tab Rhaeto-Romance @tab @code{rn} @tab Kirundi @item @code{ro} @tab Romanian @tab @code{ru} @tab Russian @tab @code{rw} @tab Kinyarwanda @item @code{sa} @tab Sanskrit @tab @code{sd} @tab Sindhi @tab @code{sg} @tab Sangro @item @code{sh} @tab Serbo-Croatian @tab @code{si} @tab Sinhalese @tab @code{sk} @tab Slovak @item @code{sl} @tab Slovenian @tab @code{sm} @tab Samoan @tab @code{sn} @tab Shona @item @code{so} @tab Somali @tab @code{sq} @tab Albanian @tab @code{sr} @tab Serbian @item @code{ss} @tab Siswati @tab @code{st} @tab Sesotho @tab @code{su} @tab Sundanese @item @code{sv} @tab Swedish @tab @code{sw} @tab Swahili @tab @code{ta} @tab Tamil @item @code{te} @tab Telugu @tab @code{tg} @tab Tajik @tab @code{th} @tab Thai @item @code{ti} @tab Tigrinya @tab @code{tk} @tab Turkmen @tab @code{tl} @tab Tagalog @item @code{tn} @tab Setswana @tab @code{to} @tab Tonga @tab @code{tr} @tab Turkish @item @code{ts} @tab Tsonga @tab @code{tt} @tab Tatar @tab @code{tw} @tab Twi @item @code{ug} @tab Uighur @tab @code{uk} @tab Ukrainian @tab @code{ur} @tab Urdu @item @code{uz} @tab Uzbek @tab @code{vi} @tab Vietnamese @tab @code{vo} @tab Volapuk @item @code{wo} @tab Wolof @tab @code{xh} @tab Xhosa @tab @code{yi} @tab Yiddish @item @code{yo} @tab Yoruba @tab @code{za} @tab Zhuang @tab @code{zh} @tab Chinese @item @code{zu} @tab Zulu @end multitable @node documentencoding @section @code{@@documentencoding @var{enc}}: Set Input Encoding @findex documentencoding @cindex Encoding, declaring @cindex Input encoding, declaring @cindex Document input encoding The @code{@@documentencoding} command declares the input document encoding. Write it on a line by itself, with a valid encoding specification following, such as @samp{ISO-8859-1}. @cindex http-equiv, and charset @cindex meta HTML tag, and charset At present, this is used only in HTML output from @code{makeinfo}. If a -document encoding @var{enc} is specified, it is used in the -@samp{<meta>} tag is included in the @samp{<head>} of the output: +document encoding @var{enc} is specified, it is used in a +@samp{<meta>} tag included in the @samp{<head>} of the output: @example -<meta http-equiv="Content-Type" content="text/html; charset=@var{enc}"> +<meta http-equiv="Content-Type" content="text/html; + charset=@var{enc}"> @end example @node Defining New Texinfo Commands @chapter Defining New Texinfo Commands @cindex Macros @cindex Defining new Texinfo commands @cindex New Texinfo commands, defining @cindex Texinfo commands, defining new @cindex User-defined Texinfo commands Texinfo provides several ways to define new commands: @itemize @bullet @item A Texinfo @dfn{macro} allows you to define a new Texinfo command as any sequence of text and/or existing commands (including other macros). The macro can have any number of @dfn{parameters}---text you supply each time you use the macro. Incidentally, these macros have nothing to do with the @code{@@defmac} command, which is for documenting macros in the subject of the manual (@pxref{Def Cmd Template}). @item @samp{@@alias} is a convenient way to define a new name for an existing command. @item @samp{@@definfoenclose} allows you to define new commands with customized output in the Info file. @end itemize @menu * Defining Macros:: Defining and undefining new commands. * Invoking Macros:: Using a macro, once you've defined it. * Macro Details:: Beyond basic macro usage. * alias:: Command aliases. * definfoenclose:: Customized highlighting. @end menu @node Defining Macros @section Defining Macros @cindex Defining macros @cindex Macro definitions -@cindex Definitions, a.k.a.@: macros @findex macro You use the Texinfo @code{@@macro} command to define a macro, like this: @example @@macro @var{macroname}@{@var{param1}, @var{param2}, @dots{}@} @var{text} @dots{} \@var{param1}\ @dots{} @@end macro @end example The @dfn{parameters} @var{param1}, @var{param2}, @dots{} correspond to arguments supplied when the macro is subsequently used in the document (described in the next section). For a macro to work with @TeX{}, @var{macroname} must consist entirely of letters: no digits, hyphens, underscores, or other special characters. If a macro needs no parameters, you can define it either with an empty list (@samp{@@macro foo @{@}}) or with no braces at all (@samp{@@macro foo}). @cindex Body of a macro @cindex Mutually recursive macros @cindex Recursion, mutual The definition or @dfn{body} of the macro can contain most Texinfo commands, including previously-defined macros. Not-yet-defined macro invocations are not allowed; thus, it is not possible to have mutually recursive Texinfo macros. Also, a macro definition that defines another macro does not work in @TeX{} due to limitations in the design of @code{@@macro}. @cindex Parameters to macros In the macro body, instances of a parameter name surrounded by backslashes, as in @samp{\@var{param1}\} in the example above, are replaced by the corresponding argument from the macro invocation. You can use parameter names any number of times in the body, including zero. @cindex Backslash in macros To get a single @samp{\} in the macro expansion, use @samp{\\}. Any other use of @samp{\} in the body yields a warning. @cindex Spaces in macros @cindex Whitespace in macros The newlines after the @code{@@macro} line and before the @code{@@end macro} line are ignored, that is, not included in the macro body. All other whitespace is treated according to the usual Texinfo rules. @cindex Recursive macro invocations @findex rmacro To allow a macro to be used recursively, that is, in an argument to a call to itself, you must define it with @samp{@@rmacro}, like this: @example -@@rmacro rmac +@@rmacro rmac @{arg@} a\arg\b @@end rmacro @dots{} @@rmac@{1@@rmac@{text@}2@} @end example This produces the output `a1atextb2b'. With @samp{@@macro} instead of @samp{@@rmacro}, an error message is given. @findex unmacro @cindex Macros, undefining @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 @section Invoking Macros @cindex Invoking macros @cindex Expanding macros @cindex Running macros @cindex Macro invocation After a macro is defined (see the previous section), you can use (@dfn{invoke}) it in your document like this: @example @@@var{macroname} @{@var{arg1}, @var{arg2}, @dots{}@} @end example @noindent and the result will be just as if you typed the body of @var{macroname} 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. The braces are required in the invocation (but not the definition), even when the macro takes no arguments, consistent with all other Texinfo commands. For example: @example @@macro argless @{@} No arguments here. @@end macro @@argless@{@} @end example @noindent produces: @display No arguments here. @end display +@cindex Comma, in macro arguments +@cindex Braces, in macro arguments To insert a comma, brace, or backslash in an argument, prepend a backslash, as in @example @@@var{macname} @{\\\@{\@}\,@} @end example @noindent which will pass the (almost certainly error-producing) argument -@samp{\@{@},} to @var{macname}. +@samp{\@{@},} to @var{macname}. However, commas in parameters, even +if escaped by a backslash, might cause trouble in @TeX{}. 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: @c Sorry for cheating, but let's not require macros to process the manual. @display Twice: aah & aah. @end display If the macro is defined to take a single argument, and is invoked with braces, the braced text is passed as the argument, regardless of commas. For example: @example @@macro bar @{p@} Twice: \p\ & \p\. @@end macro @@bar@{a,b@} @end example @noindent produces: @display Twice: a,b & a,b. @end display @node Macro Details @section Macro Details @cindex Macro details @cindex Details of macro usage Due to unavoidable disparities in the @TeX{} and @command{makeinfo} implementations, Texinfo macros have the following limitations. @itemize @bullet @item All macros are expanded inside at least one @TeX{} group. This means -that @set and other such commands will have no effect inside a macro. +that @code{@@set} and other such commands will have no effect inside a +macro. @item Macros containing a command which must be on a line by itself, such as a conditional, cannot be invoked in the middle of a line. +@item +Commas in macro arguments, even if escaped by a backslash, don't +always work. + @item The @TeX{} implementation cannot construct macros that define macros in the natural way. To do this, you must use conditionals and raw @TeX{}. For example: @example @@ifinfo @@macro ctor @{name, arg@} @@macro \name\ something involving \arg\ somehow @@end macro @@end macro @@end ifinfo @@tex \gdef\ctor#1@{\ctorx#1,@} \gdef\ctorx#1,#2,@{\def#1@{something involving #2 somehow@}@} @@end tex @end example @item It is best to avoid comments inside macro definitions. @end itemize +If some macro feature causes errors when producing the printed version +of a manual, try expanding the macros with @command{makeinfo} by +invoking @command{texi2dvi} with the @samp{-e} option; see @ref{Format +with texi2dvi}. @node alias @section @samp{@@alias @var{new}=@var{existing}} @cindex Aliases, command @cindex Command aliases @findex alias The @samp{@@alias} command defines a new command to be just like an existing one. This is useful for defining additional markup names, thus preserving semantic information in the input even though the output result may be the same. Write the @samp{@@alias} command on a line by itself, followed by the new command name, an equals sign, and the existing command name. Whitespace around the equals sign is ignored. Thus: @example @@alias @var{new} = @var{existing} @end example For example, if your document contains citations for both books and some other media (movies, for example), you might like to define a macro @code{@@moviecite@{@}} that does the same thing as an ordinary @code{@@cite@{@}} but conveys the extra semantic information as well. You'd do this as follows: @example @@alias moviecite = cite @end example Macros do not always have the same effect due to vagaries of argument parsing. Also, aliases are much simpler to define than macros. So the command is not redundant. (It was also heavily used in the Jargon File!) Aliases must not be recursive, directly or indirectly. @node definfoenclose @section @samp{definfoenclose}: Customized Highlighting @cindex Highlighting, customized @cindex Customized highlighting @findex definfoenclose A @code{@@definfoenclose} command may be used to define a highlighting -command for Info, but not for TeX. A command defined using +command for Info, but not for @TeX{}. A command defined using @code{@@definfoenclose} marks text by enclosing it in strings that precede and follow the text. You can use this to get closer control of your Info output. Presumably, if you define a command with @code{@@definfoenclose} for Info, you will create a corresponding command for @TeX{}, either in @file{texinfo.tex}, @file{texinfo.cnf}, or within an @samp{@@iftex} in your document. Write a @code{@@definfoenclose} command on a line and follow it with three arguments separated by commas. The first argument to @code{@@definfoenclose} is the @@-command name (without the @code{@@}); the second argument is the Info start delimiter string; and the third argument is the Info end delimiter string. The latter two arguments enclose the highlighted text in the Info file. A delimiter string may contain spaces. Neither the start nor end delimiter is required. If you do not want a start delimiter but do want an end delimiter, you must follow the command name with two commas in a row; otherwise, the Info formatting commands will naturally misinterpret the end delimiter string you intended as the start delimiter string. If you do a @code{@@definfoenclose} on the name of a pre-defined macro (such as @code{@@emph}, @code{@@strong}, @code{@@t}, or @code{@@i}), the enclosure definition will override the built-in definition. An enclosure command defined this way takes one argument in braces; this is intended for new markup commands (@pxref{Marking Text}). @findex phoo For example, you can write: @example @@definfoenclose phoo,//,\\ @end example @noindent near the beginning of a Texinfo file to define @code{@@phoo} as an Info formatting command that inserts `//' before and `\\' after the argument to @code{@@phoo}. You can then write @code{@@phoo@{bar@}} wherever you want `//bar\\' highlighted in Info. -Also, for TeX formatting, you could write +Also, for @TeX{} formatting, you could write @example @@iftex @@global@@let@@phoo=@@i @@end iftex @end example @noindent -to define @code{@@phoo} as a command that causes TeX to typeset the +to define @code{@@phoo} as a command that causes @TeX{} to typeset the argument to @code{@@phoo} in italics. -Note that each definition applies to its own formatter: one for TeX, -the other for @code{texinfo-format-buffer} or -@code{texinfo-format-region}. The @code{@@definfoenclose} command need -not be within @samp{@@ifinfo}, but the raw @TeX{} commands do need to be -in @samp{@@iftex}. +Each definition applies to its own formatter: one for @TeX{}, the other +for @code{texinfo-format-buffer} or @code{texinfo-format-region}. The +@code{@@definfoenclose} command need not be within @samp{@@ifinfo}, but +the raw @TeX{} commands do need to be in @samp{@@iftex}. @findex headword Here is another example: write @example @@definfoenclose headword, , : @end example @noindent near the beginning of the file, to define @code{@@headword} as an Info formatting command that inserts nothing before and a colon after the argument to @code{@@headword}. @samp{@@definfoenclose} definitions must not be recursive, directly or indirectly. @node Hardcopy @chapter Formatting and Printing Hardcopy @cindex Format and print hardcopy @cindex Printing hardcopy @cindex Hardcopy, printing it @cindex Making a printed manual @cindex Sorting indices @cindex Indices, sorting @cindex @TeX{} index sorting @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 printed, a second for sorting indices, and a third for printing the formatted document. When you use the shell commands, you can either work directly in the operating system shell or work within a shell inside GNU Emacs. If you are using GNU Emacs, you can use commands provided by Texinfo mode instead of shell commands. In addition to the three commands to format a file, sort the indices, and print the result, Texinfo mode offers key bindings for commands to recenter the output buffer, show the print queue, and delete a job from the print queue. @menu * Use TeX:: Use @TeX{} to format for hardcopy. * Format with tex/texindex:: How to format with explicit shell commands. * Format with texi2dvi:: A simpler way to format. * Print with lpr:: How to print. * Within Emacs:: How to format and print from an Emacs shell. * Texinfo Mode Printing:: How to format and print in Texinfo mode. * Compile-Command:: How to print using Emacs's compile command. * Requirements Summary:: @TeX{} formatting requirements summary. * Preparing for TeX:: What to do before you use @TeX{}. * Overfull hboxes:: What are and what to do with overfull hboxes. * smallbook:: How to print small format books and manuals. -* A4 Paper:: How to print on European A4 paper. +* A4 Paper:: How to print on A4 or A5 paper. * pagesizes:: How to print with customized page sizes. * Cropmarks and Magnification:: How to print marks to indicate the size of pages and how to print scaled up output. * PDF Output:: Portable Document Format output. @end menu @node Use TeX @section Use @TeX{} The typesetting program called @TeX{} is used for formatting a Texinfo file. @TeX{} is a very powerful typesetting program and, if used correctly, does an exceptionally good job. (@xref{Obtaining TeX, , How to Obtain @TeX{}}, for information on how to obtain @TeX{}.) -The @code{makeinfo}, @code{texinfo-format-region}, and -@code{texinfo-format-buffer} commands read the very same @@-commands -in the Texinfo file as does @TeX{}, but process them differently to -make an Info file (@pxref{Creating an Info File}). +The standalone @code{makeinfo} program and Emacs functions +@code{texinfo-format-region} and @code{texinfo-format-buffer} commands +read the very same @@-commands in the Texinfo file as does @TeX{}, but +process them differently to make an Info file (@pxref{Creating an Info +File}). @node Format with tex/texindex @section Format with @code{tex} and @code{texindex} @cindex Shell formatting with @code{tex} and @code{texindex} @cindex Formatting with @code{tex} and @code{texindex} @cindex DVI file Format the Texinfo file with the shell command @code{tex} followed by the name of the Texinfo file. For example: @example tex foo.texi @end example @noindent @TeX{} will produce a @dfn{DVI file} as well as several auxiliary files containing information for indices, cross references, etc. The DVI file (for @dfn{DeVice Independent} file) can be printed on virtually any device (see the following sections). @pindex texindex The @code{tex} formatting command itself does not sort the indices; it writes an output file of unsorted index data. (The @code{texi2dvi} command automatically generates indices; @pxref{Format with texi2dvi,, Format with @code{texi2dvi}}.) To generate a printed index after running the @code{tex} command, you first need a sorted index to work from. The @code{texindex} command sorts indices. (The source file @file{texindex.c} comes as part of the standard Texinfo distribution, among other places.)@refill @cindex Names of index files @cindex Index file names The @code{tex} formatting command outputs unsorted index files under names that obey a standard convention: the name of your main input file with any @samp{.tex} (or similar, @pxref{tex invocation,,, web2c, Web2c}) extension removed, followed by the two letter names of indices. For example, the raw index output files for the input file @file{foo.texinfo} would be @file{foo.cp}, @file{foo.vr}, @file{foo.fn}, @file{foo.tp}, @file{foo.pg} and @file{foo.ky}. Those are exactly the arguments to give to @code{texindex}. @need 1000 @cindex Wildcards @cindex Globbing Instead of specifying all the unsorted index file names explicitly, you can use @samp{??} as shell wildcards and give the command in this form: @example texindex foo.?? @end example @noindent This command will run @code{texindex} on all the unsorted index files, including any that you have defined yourself using @code{@@defindex} or @code{@@defcodeindex}. (You may execute @samp{texindex foo.??} even if there are similarly named files with two letter extensions that are not index files, such as @samp{foo.el}. The @code{texindex} command reports but otherwise ignores such files.) For each file specified, @code{texindex} generates a sorted index file whose name is made by appending @samp{s} to the input file name. The @code{@@printindex} command looks for a file with that name (@pxref{Printing Indices & Menus}). @code{texindex} does not alter the raw index output file. After you have sorted the indices, you need to rerun the @code{tex} formatting command on the Texinfo file. This regenerates the DVI file, this time with up-to-date index entries. Finally, you may need to run @code{tex} one more time, to get the page numbers in the cross-references correct. To summarize, this is a five step process: @enumerate @item Run @code{tex} on your Texinfo file. This generates a DVI file (with undefined cross-references and no indices), and the raw index files (with two letter extensions). @item Run @code{texindex} on the raw index files. This creates the corresponding sorted index files (with three letter extensions). @item Run @code{tex} again on your Texinfo file. This regenerates the DVI file, this time with indices and defined cross-references, but with page numbers for the cross-references from last time, generally incorrect. @item Sort the indices again, with @code{texindex}. @item Run @code{tex} one last time. This time the correct page numbers are written for the cross-references. @end enumerate @pindex texi2dvi Alternatively, it's a one-step process: run @code{texi2dvi} (@pxref{Format with texi2dvi}). You need not run @code{texindex} each time after you run @code{tex}. If you do not, on the next run, the @code{tex} formatting command will use whatever sorted index files happen to exist from the previous use of @code{texindex}. This is usually ok while you are debugging. @cindex Auxiliary files, avoiding @findex novalidate @cindex Pointer validation, suppressing @cindex Chapters, formatting one at a time Sometimes you may wish to print a document while you know it is incomplete, or to print just one chapter of a document. In that case, the usual auxiliary files that @TeX{} creates and warnings @TeX{} gives when cross-references are not satisfied are just nuisances. You can avoid them with the @code{@@novalidate} command, which you must give @emph{before} the @code{@@setfilename} command (@pxref{setfilename,,@code{@@setfilename}}). Thus, the beginning of your file would look approximately like this: @example \input texinfo @@novalidate @@setfilename myfile.info @dots{} @end example @noindent @code{@@novalidate} also turns off validation in @code{makeinfo}, just like its @code{--no-validate} option (@pxref{Pointer Validation}). @node Format with texi2dvi @section Format with @code{texi2dvi} @pindex texi2dvi @r{(shell script)} The @code{texi2dvi} command automatically runs both @code{tex} and @code{texindex} as many times as necessary to produce a DVI file with sorted indices and all cross-references resolved. It simplifies the @code{tex}---@code{texindex}---@code{tex}---@code{tex} sequence described in the previous section. To run @code{texi2dvi} on an input file @file{foo.texi}, do this (where @samp{prompt$ } is your shell prompt): @example prompt$ @kbd{texi2dvi foo.texi} @end example As shown in this example, the input filenames to @code{texi2dvi} must include any extension (@samp{.texi}, @samp{.texinfo}, etc.). Under MS-DOS and perhaps in other circumstances, you may need to run @samp{sh texi2dvi foo.texi} instead of relying on the operating system to invoke the shell on the @samp{texi2dvi} script. Perhaps the most useful option to @code{texi2dvi} is @samp{--texinfo=@var{cmd}}. This inserts @var{cmd} on a line by itself after the @code{@@setfilename} in a temporary copy of the input file before running @TeX{}. With this, you can specify different printing formats, such as @code{@@smallbook} (@pxref{smallbook}), -@code{@@afourpaper} (@pxref{A4 Paper}), or @code{@@pageparams} +@code{@@afourpaper} (@pxref{A4 Paper}), or @code{@@pagesizes} (@pxref{pagesizes}), without actually changing the document source. (You can also do this on a site-wide basis with @file{texinfo.cnf}; @pxref{Preparing for TeX,,Preparing for @TeX{}}). For a list of other options, run @samp{texi2dvi --help}. -@node Print with lpr, Within Emacs, Format with texi2dvi, Hardcopy +@node Print with lpr @section Shell Print Using @code{lpr -d} @pindex lpr @r{(DVI print command)} The precise command to print a DVI file depends on your system -installation, but @samp{lpr -d} is common. The command may require the -DVI file name without any extension or with a @samp{.dvi} -extension. (If it is @samp{lpr}, you must include the @samp{.dvi}.) +installation. Two common ones are @samp{dvips foo.dvi -o} and @samp{lpr +-d foo.dvi}. -For example, the following commands, will (perhaps) suffice to sort the +For example, the following commands will (perhaps) suffice to sort the indices, format, and print the @cite{Bison Manual}: @example @group tex bison.texinfo texindex bison.?? tex bison.texinfo lpr -d bison.dvi @end group @end example @noindent (Remember that the shell commands may be different at your site; but -these are commonly used versions.)@refill +these are commonly used versions.) -@need 1000 -Using the @code{texi2dvi} shell script, you simply need type:@refill +Using the @code{texi2dvi} shell script (see the previous section): @example @group texi2dvi bison.texinfo lpr -d bison.dvi +# or perhaps dvips bison.dvi -o @end group @end example @cindex Shell printing, on MS-DOS/MS-Windows @cindex Printing DVI files, on MS-DOS/MS-Windows @pindex lpr@r{-d, replacements on MS-DOS/MS-Windows} @code{lpr} is a standard program on Unix systems, but it is usually absent on MS-DOS/MS-Windows. Some network packages come with a program named @code{lpr}, but these are usually limited to sending files to a print server over the network, and generally don't support the @samp{-d} option. If you are unfortunate enough to work on one of these systems, you have several alternative ways of printing DVI files: @itemize @bullet{} @item Find and install a Unix-like @code{lpr} program, or its clone. If you can do that, you will be able to print DVI files just like described above. @item Send the DVI files to a network printer queue for DVI files. Some network printers have special queues for printing DVI files. You should be able to set up your network software to send files to that queue. In some cases, the version of @code{lpr} which comes with your network software will have a special option to send a file to specific queues, like this: @example lpr -Qdvi -hprint.server.domain bison.dvi @end example @item Convert the DVI file to a Postscript or PCL file and send it to your local printer. @xref{dvips invocation,,, dvips, Dvips}, and the man pages for @code{dvilj}, for detailed description of these tools. Once the DVI file is converted to the format your local printer understands directly, just send it to the appropriate port, usually @samp{PRN}. @end itemize @node Within Emacs @section From an Emacs Shell @cindex Print, format from Emacs shell @cindex Format, print from Emacs shell @cindex Shell, format, print from @cindex Emacs shell, format, print from @cindex GNU Emacs shell, format, print from You can give formatting and printing commands from a shell within GNU Emacs. To create a shell within Emacs, type @kbd{M-x shell}. In this shell, you can format and print the document. @xref{Hardcopy, , Format and Print Hardcopy}, for details. You can switch to and from the shell buffer while @code{tex} is running and do other editing. If you are formatting a long document on a slow machine, this can be very convenient.@refill You can also use @code{texi2dvi} from an Emacs shell. For example, here is how to use @code{texi2dvi} to format and print @cite{Using and Porting GNU CC} from a shell within Emacs: @example @group texi2dvi gcc.texinfo lpr -d gcc.dvi @end group @end example @ifinfo @xref{Texinfo Mode Printing}, for more information about formatting and printing in Texinfo mode.@refill @end ifinfo @node Texinfo Mode Printing, Compile-Command, Within Emacs, Hardcopy @section Formatting and Printing in Texinfo Mode @cindex Region printing in Texinfo mode @cindex Format and print in Texinfo mode @cindex Print and format in Texinfo mode Texinfo mode provides several predefined key commands for @TeX{} formatting and printing. These include commands for sorting indices, looking at the printer queue, killing the formatting job, and recentering the display of the buffer in which the operations occur.@refill @table @kbd @item C-c C-t C-b @itemx M-x texinfo-tex-buffer Run @code{texi2dvi} on the current buffer.@refill @item C-c C-t C-r @itemx M-x texinfo-tex-region Run @TeX{} on the current region.@refill @item C-c C-t C-i @itemx M-x texinfo-texindex Sort the indices of a Texinfo file formatted with @code{texinfo-tex-region}.@refill @item C-c C-t C-p @itemx M-x texinfo-tex-print Print a DVI file that was made with @code{texinfo-tex-region} or @code{texinfo-tex-buffer}.@refill @item C-c C-t C-q @itemx M-x tex-show-print-queue Show the print queue.@refill @item C-c C-t C-d @itemx M-x texinfo-delete-from-print-queue Delete a job from the print queue; you will be prompted for the job number shown by a preceding @kbd{C-c C-t C-q} command (@code{texinfo-show-tex-print-queue}).@refill @item C-c C-t C-k @itemx M-x tex-kill-job Kill the currently running @TeX{} job started by either @code{texinfo-tex-region} or @code{texinfo-tex-buffer}, or any other process running in the Texinfo shell buffer.@refill @item C-c C-t C-x @itemx M-x texinfo-quit-job Quit a @TeX{} formatting job that has stopped because of an error by sending an @key{x} to it. When you do this, @TeX{} preserves a record of what it did in a @file{.log} file.@refill @item C-c C-t C-l @itemx M-x tex-recenter-output-buffer Redisplay the shell buffer in which the @TeX{} printing and formatting commands are run to show its most recent output.@refill @end table @need 1000 Thus, the usual sequence of commands for formatting a buffer is as follows (with comments to the right):@refill @example @group C-c C-t C-b @r{Run @code{texi2dvi} on the buffer.} C-c C-t C-p @r{Print the DVI file.} C-c C-t C-q @r{Display the printer queue.} @end group @end example 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. 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 as you would any other shell buffer.@refill @need 1500 The formatting and print commands depend on the values of several variables. The default values are:@refill @example @group @r{Variable} @r{Default value} texinfo-texi2dvi-command "texi2dvi" texinfo-tex-command "tex" texinfo-texindex-command "texindex" texinfo-delete-from-print-queue-command "lprm" texinfo-tex-trailer "@@bye" tex-start-of-header "%**start" tex-end-of-header "%**end" tex-dvi-print-command "lpr -d" tex-show-queue-command "lpq" @end group @end example You can change the values of these variables with the @kbd{M-x edit-options} command (@pxref{Edit Options, , Editing Variable Values, emacs, The GNU Emacs Manual}), with the @kbd{M-x set-variable} command (@pxref{Examining, , Examining and Setting Variables, emacs, The GNU Emacs Manual}), or with your @file{.emacs} initialization file (@pxref{Init File, , , emacs, The GNU Emacs Manual}).@refill @cindex Customize Emacs package @findex Development/Docs/Texinfo Customize group Beginning with version 20, GNU Emacs offers a user-friendly interface, called @dfn{Customize}, for changing values of user-definable variables. @xref{Easy Customization, , Easy Customization Interface, emacs, The GNU Emacs Manual}, for more details about this. The Texinfo variables can be found in the @samp{Development/Docs/Texinfo} group, once you invoke the @kbd{M-x customize} command. @node Compile-Command, Requirements Summary, Texinfo Mode Printing, Hardcopy @section Using the Local Variables List @cindex Local variables @cindex Compile command for formatting @cindex Format with the compile command Yet another way to apply the @TeX{} formatting command to a Texinfo file is to put that command in a @dfn{local variables list} at the end of the Texinfo file. You can then specify the @code{tex} or @code{texi2dvi} commands as a @code{compile-command} and have Emacs run it by typing @kbd{M-x compile}. This creates a special shell called the @file{*compilation*} buffer in which Emacs runs the compile command. For example, at the end of the @file{gdb.texinfo} file, after the @code{@@bye}, you could put the following:@refill @example @group Local Variables: compile-command: "texi2dvi gdb.texinfo" End: @end group @end example @noindent This technique is most often used by programmers who also compile programs this way; see @ref{Compilation, , , emacs, The GNU Emacs Manual}.@refill @node Requirements Summary @section @TeX{} Formatting Requirements Summary @cindex Requirements for formatting @cindex Minimal requirements for formatting @cindex Formatting requirements Every Texinfo file that is to be input to @TeX{} must begin with a @code{\input} command and must contain an @code{@@setfilename} command: @example \input texinfo @@setfilename @var{arg-not-used-by-@TeX{}} @end example @noindent The first command instructs @TeX{} to load the macros it needs to process a Texinfo file and the second command opens auxiliary files. Every Texinfo file must end with a line that terminates @TeX{}'s processing and forces out unfinished pages: @example @@bye @end example Strictly speaking, these lines are all a Texinfo file needs to be processed successfully by @TeX{}. Usually, however, the beginning includes an @code{@@settitle} command to define the title of the printed manual, 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. (And of course most manuals contain a body of text as well.) For more information, see: @itemize @bullet @item @ref{settitle, , @code{@@settitle}} @item @ref{setchapternewpage, , @code{@@setchapternewpage}} @item @ref{Headings, ,Page Headings} @item @ref{Titlepage & Copyright Page} @item @ref{Printing Indices & Menus} @item @ref{Contents} @end itemize @node Preparing for TeX @section Preparing for @TeX{} @cindex Preparing for @TeX{} @cindex @TeX{} input initialization @cindex @code{TEXINPUTS} environment variable @vindex TEXINPUTS @cindex @b{.profile} initialization file @cindex @b{.cshrc} initialization file @cindex Initialization file for @TeX{} input -@TeX{} needs to know where to find the @file{texinfo.tex} file that you -have told it to input with the @samp{\input texinfo} command at the -beginning of the first line. The @file{texinfo.tex} file tells @TeX{} -how to handle @@-commands; it is included in all standard GNU -distributions. +@TeX{} needs to know where to find the @file{texinfo.tex} file that the +@samp{\input texinfo} command on the first line reads. The +@file{texinfo.tex} file tells @TeX{} how to handle @@-commands; it is +included in all standard GNU distributions. @pindex texinfo.tex@r{, installing} -Usually, the @file{texinfo.tex} file is put under the default directory -that contains @TeX{} macros -(@file{/usr/local/share/texmf/tex/texinfo/texinfo.tex} by default) 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 current directory -when you run @TeX{}, and @TeX{} will find it there. + +Usually, the installer has put the @file{texinfo.tex} file in the +default directory that contains @TeX{} macros when GNU Texinfo, Emacs or +other GNU software is installed. In this case, @TeX{} will find the +file and you do not need to do anything special. If this has not been +done, you can put @file{texinfo.tex} in the current directory when you +run @TeX{}, and @TeX{} will find it there. @pindex epsf.tex@r{, installing} -Also, you should install @file{epsf.tex} in the same place as -@file{texinfo.tex}, if it is not already installed from another -distribution. This file is needed to support the @code{@@image} command -(@pxref{Images}). +Also, you should install @file{epsf.tex}, if it is not already installed +from another distribution. More details are at the end of the description +of the @code{@@image} command (@pxref{Images}). + +@pindex pdfcolor.tex@r{, installing} +Likewise for @file{pdfcolor.tex}, if it is not already installed and you +use pdftex. @pindex texinfo.cnf @r{installation} @cindex Customizing of @TeX{} for Texinfo @cindex Site-wide Texinfo configuration file Optionally, you may create an additional @file{texinfo.cnf}, and install it as well. This file is read by @TeX{} when the @code{@@setfilename} command is executed (@pxref{setfilename,, @code{@@setfilename}}). You can put any commands you like there, according to local site-wide conventions. They will be read by @TeX{} when processing any Texinfo document. For example, if @file{texinfo.cnf} contains the line @samp{@@afourpaper} (@pxref{A4 Paper}), then all Texinfo documents will be processed with that page size in effect. If you have nothing to put in @file{texinfo.cnf}, you do not need to create it. @vindex TEXINPUTS If neither of the above locations for these system files suffice for you, you can specify the directories explicitly. For @file{texinfo.tex}, you can do this by writing the complete path for the file after the @code{\input} command. Another way, that works for both @file{texinfo.tex} and @file{texinfo.cnf} (and any other file @TeX{} might read), is to set the @code{TEXINPUTS} environment variable in your @file{.cshrc} or @file{.profile} file. Which you use of @file{.cshrc} or @file{.profile} depends on whether you use a Bourne shell-compatible (@code{sh}, @code{bash}, @code{ksh}, @dots{}) or C shell-compatible (@code{csh}, @code{tcsh}) command interpreter. The latter read the @file{.cshrc} file for initialization information, and the former read @file{.profile}. In a @file{.cshrc} file, you could use the following @code{csh} command sequence: @example setenv TEXINPUTS .:/home/me/mylib:/usr/lib/tex/macros @end example @need 1000 In a @file{.profile} file, you could use the following @code{sh} command sequence: @example @group TEXINPUTS=.:/home/me/mylib:/usr/lib/tex/macros export TEXINPUTS @end group @end example On MS-DOS/MS-Windows, you would say it like this@footnote{Note the use of the @samp{;} character, instead of @samp{:}, as directory separator on these systems.}: @example @group set TEXINPUTS=.;d:/home/me/mylib;c:/usr/lib/tex/macros @end group @end example @noindent It is customary for DOS/Windows users to put such commands in the @file{autoexec.bat} file, or in the Windows Registry.@refill @noindent These settings would cause @TeX{} to look for @file{\input} file first in the current directory, indicated by the @samp{.}, then in a hypothetical user's @file{me/mylib} directory, and finally in a system directory @file{/usr/lib/tex/macros}. @cindex Dumping a .fmt file @cindex Format file, dumping Finally, you may wish to dump a @file{.fmt} file (@pxref{Memory dumps,,, web2c, Web2c}) so that @TeX{} can load Texinfo faster. (The disadvantage is that then updating @file{texinfo.tex} requires redumping.) You can do this by running this command, assuming @file{epsf.tex} is findable by @TeX{}: @example initex texinfo @@dump @end example -(@code{@@dump} is a @TeX{} primitive.) You'll then need to move -@file{texinfo.fmt} to wherever your @code{.fmt} files are found; -typically this will be in the subdirectory @file{web2c} of your @TeX{} -installation, for example, @file{/usr/local/share/tex/web2c}. +(@code{dump} is a @TeX{} primitive.) Then, move @file{texinfo.fmt} to +wherever your @code{.fmt} files are found; typically, this will be in the +subdirectory @file{web2c} of your @TeX{} installation. @node Overfull hboxes @section Overfull ``hboxes'' @cindex Overfull @samp{hboxes} @cindex @samp{hboxes}, overfull @cindex Final output @TeX{} is sometimes unable to typeset a line without extending it into the right margin. This can occur when @TeX{} comes upon what it interprets as a long word that it cannot hyphenate, such as an electronic mail network address or a very long title. When this happens, @TeX{} prints an error message like this: @example Overfull @@hbox (20.76302pt too wide) @end example @findex hbox @noindent (In @TeX{}, lines are in ``horizontal boxes'', hence the term, ``hbox''. @samp{@@hbox} is a @TeX{} primitive not needed in the Texinfo language.) @TeX{} also provides the line number in the Texinfo source file and the text of the offending line, which is marked at all the places that @TeX{} considered hyphenation. @xref{Debugging with TeX, , Catching Errors with @TeX{} Formatting}, for more information about typesetting errors. If the Texinfo file has an overfull hbox, you can rewrite the sentence so the overfull hbox does not occur, or you can decide to leave it. A small excursion into the right margin often does not matter and may not even be noticeable. If you have many overfull boxes and/or an antipathy to rewriting, you can coerce @TeX{} into greatly increasing the allowable interword spacing, thus (if you're lucky) avoiding many of the bad line breaks, like this: @findex \emergencystretch @example @@tex \global\emergencystretch = .9\hsize @@end tex @end example @noindent -(You can adjust the fraction as needed.) This huge value for +(You should adjust the fraction as needed.) This huge value for @code{\emergencystretch} cannot be the default, since then the typeset -output would generally be of noticeably lower quality. The default -value is @samp{.15\hsize}. @code{\hsize} is the @TeX{} dimension +output would generally be of noticeably lower quality; the default +is @samp{.15\hsize}. @code{\hsize} is the @TeX{} dimension containing the current line width. @cindex Black rectangle in hardcopy @cindex Rectangle, black in hardcopy @cindex Box, ugly black in hardcopy @cindex Ugly black rectangles in hardcopy For what overfull boxes you have, however, @TeX{} will print a large, ugly, black rectangle beside the line that contains the overfull hbox unless told otherwise. This is so you will notice the location of the problem if you are correcting a draft. @findex finalout To prevent such a monstrosity from marring your final printout, write the following in the beginning of the Texinfo file on a line of its own, before the @code{@@titlepage} command: @example @@finalout @end example @node smallbook @section Printing ``Small'' Books @findex smallbook @cindex Small book size @cindex Book, printing small @cindex Page sizes for books @cindex Size of printed book By default, @TeX{} typesets pages for printing in an 8.5 by 11 inch format. However, you can direct @TeX{} to typeset a document in a 7 by 9.25 inch format that is suitable for bound books by inserting the following command on a line by itself at the beginning of the Texinfo file, before the title page:@refill @example @@smallbook @end example @noindent (Since many books are about 7 by 9.25 inches, this command might better have been called the @code{@@regularbooksize} command, but it came to be called the @code{@@smallbook} command by comparison to the 8.5 by 11 inch format.) If you write the @code{@@smallbook} command between the start-of-header and end-of-header lines, the Texinfo mode @TeX{} region formatting command, @code{texinfo-tex-region}, will format the region in ``small'' book size (@pxref{Start of Header}).@refill @xref{small}, for information about commands that make it easier to produce examples for a smaller manual. @xref{Format with texi2dvi}, and @ref{Preparing for TeX,,Preparing for @TeX{}}, for other ways to format with @code{@@smallbook} that do not require changing the source file. @node A4 Paper @section Printing on A4 Paper @cindex A4 paper, printing on -@cindex Paper size, European A4 +@cindex A5 paper, printing on +@cindex Paper size, A4 @cindex European A4 paper @findex afourpaper You can tell @TeX{} to format a document for printing on European size -A4 paper with the @code{@@afourpaper} command. Write the command on a -line by itself near the beginning of the Texinfo file, before the title -page. For example, this is how you would write the header for this -manual: +A4 paper (or A5) with the @code{@@afourpaper} (or @code{@@afivepaper}) +command. Write the command on a line by itself near the beginning of +the Texinfo file, before the title page. For example, this is how you +would write the header for this manual: @example @group \input texinfo @@c -*-texinfo-*- @@c %**start of header @@setfilename texinfo @@settitle Texinfo @@afourpaper @@c %**end of header @end group @end example @xref{Format with texi2dvi}, and @ref{Preparing for TeX,,Preparing for -@TeX{}}, for other ways to format with @code{@@afourpaper} that do not +@TeX{}}, for other ways to format for different paper sizes that do not require changing the source file. @findex afourlatex +@findex afourwide You may or may not prefer the formatting that results from the command @code{@@afourlatex}. There's also @code{@@afourwide} for A4 paper in wide format. - @node pagesizes @section @code{@@pagesizes} [@var{width}][, @var{height}]: Custom page sizes @findex pagesizes @cindex Custom page sizes @cindex Page sizes, customized @cindex Text width and height @cindex Width of text area @cindex Height of text area @cindex Depth of text area You can explicitly specify the height and (optionally) width of the main text area on the page with the @code{@@pagesizes} command. Write this on a line by itself near the beginning of the Texinfo file, before the title page. The height comes first, then the width if desired, separated by a comma. Examples: @example @@pagesizes 200mm,150mm @c for b5 paper @end example @noindent and @example @@pagesizes 11.5in @c for legal paper @end example @cindex B5 paper, printing on @cindex Legal paper, printing on This would be reasonable for printing on B5-size paper. To emphasize, this command specifies the size of the @emph{text area}, not the size of the paper (which is 250@dmn{mm} by 177@dmn{mm} for B5, 14@dmn{in} by 8.5@dmn{in} for legal). @cindex Margins on page, not controllable To make more elaborate changes, such as changing any of the page margins, you must define a new command in @file{texinfo.tex} (or @file{texinfo.cnf}, @pxref{Preparing for TeX,,Preparing for @TeX{}}). @xref{Format with texi2dvi}, and @ref{Preparing for TeX,,Preparing for @TeX{}}, for other ways to specify @code{@@pagesizes} that do not require changing the source file. @code{@@pagesizes} is ignored by @code{makeinfo}. @node Cropmarks and Magnification @section Cropmarks and Magnification @findex cropmarks @cindex Cropmarks for printing @cindex Printing cropmarks You can (attempt to) direct @TeX{} to print cropmarks at the corners of pages with the @code{@@cropmarks} command. Write the @code{@@cropmarks} command on a line by itself between @code{@@iftex} and @code{@@end iftex} lines near the beginning of the Texinfo file, before the title page, like this:@refill @example @group @@iftex @@cropmarks @@end iftex @end group @end example This command is mainly for printers that typeset several pages on one sheet of film; but you can attempt to use it to mark the corners of a book set to 7 by 9.25 inches with the @code{@@smallbook} command. (Printers will not produce cropmarks for regular sized output that is printed on regular sized paper.) Since different printing machines work in different ways, you should explore the use of this command with a spirit of adventure. You may have to redefine the command in @file{texinfo.tex}. @findex mag @r{(@TeX{} command)} @cindex Magnified printing @cindex Larger or smaller pages 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 write this command between @code{@@tex} and @code{@@end tex} (@pxref{Raw Formatter Commands}). Follow the @code{\mag} command with an @samp{=} and then a number that is 1000 times the magnification you desire. For example, to print pages at 1.2 normal size, write the following near the beginning of the Texinfo file, before the title page: @example @group @@tex \mag=1200 @@end tex @end group @end example With some printing technologies, you can print normal-sized copies that look better than usual by giving a larger-than-normal master to your print shop. They do the reduction, thus effectively increasing the resolution. Depending on your system, DVI files prepared with a nonstandard-@code{\mag} may not print or may print only with certain magnifications. Be prepared to experiment. @node PDF Output @section PDF Output @cindex PDF output @pindex pdftex You can generate a PDF output file from Texinfo source by using the @command{pdftex} program to process your file instead of plain @command{tex}. Just run @samp{pdftex foo.texi} instead of @samp{tex foo.texi}, or give the @samp{--pdf} option to @command{texi2dvi}. -PDF stands for Portable Document Format, and was invented by Adobe -Systems. The -@uref{http://www.adobe.com/prodindex/acrobat/adobepdf.html, file format -definition} is freely available, as is a -@uref{http://www.foolabs.com/xpdf/, free viewer} for the X window -system. Since PDF is a binary format, there is no @samp{@@ifpdf} or -@samp{@@pdf} command by analogy with the other output formats. +@dfn{PDF} stands for `Portable Document Format'. It was invented by +Adobe Systems some years ago for document interchange, based on their +PostScript language. A @uref{http://www.foolabs.com/xpdf/, PDF reader} +for the X window system is freely available, as is the +@uref{http://partners.adobe.com/asn/developer/technotes/, definition of +the file format}. Since PDF is a binary format, there are no +@samp{@@ifpdf} or @samp{@@pdf} commands as with the other output +formats. Despite the `portable' in the name, PDF files are nowhere near as -portable in practice as the plain ASCII formats (Info, HTML) Texinfo -also supports (portability relative to DVI is arguable). They also tend -to be much larger and do not support the bitmap fonts used by @TeX{} (by +portable in practice as the plain ASCII formats (Info, HTML) that +Texinfo supports (DVI portability is arguable). They also tend to be +much larger and do not support the bitmap fonts used by @TeX{} (by default) very well. Nevertheless, a PDF file does preserve an actual -printed document on a screen as faithfully as possible, unlike HTML, -say, so have their place. +printed document on a screen as faithfully as possible, so it has its place. PDF support in Texinfo is fairly rudimentary. @node Creating and Installing Info Files @chapter Creating and Installing Info Files -This chapter describes how to create and install info files. @xref{Info +This chapter describes how to create and install Info files. @xref{Info Files}, for general information about the file format itself. - @menu * Creating an Info File:: -* Install an Info File:: +* Installing an Info File:: @end menu + @node Creating an Info File @section Creating an Info File @cindex Creating an Info file @cindex Info, creating an online file @cindex Formatting a file for Info @code{makeinfo} is a program that converts a Texinfo file into an Info file, HTML file, or plain text. @code{texinfo-format-region} and @code{texinfo-format-buffer} are GNU Emacs functions that convert Texinfo to Info. For information on installing the Info file in the Info system, -@pxref{Install an Info File}. +@pxref{Installing an Info File}. @menu * makeinfo advantages:: @code{makeinfo} provides better error checking. * Invoking makeinfo:: How to run @code{makeinfo} from a shell. * makeinfo options:: Specify fill-column and other options. * 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 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 to run better. * makeinfo html:: Generating HTML output. @end menu @node makeinfo advantages @subsection @code{makeinfo} Preferred The @code{makeinfo} utility creates an Info file from a Texinfo source file more quickly than either of the Emacs formatting commands and provides better error messages. We recommend it. @code{makeinfo} is a C program that is independent of Emacs. You do not need to run Emacs to use @code{makeinfo}, which means you can use @code{makeinfo} on machines that are too small to run Emacs. You can run @code{makeinfo} in any one of three ways: from an operating system shell, from a shell inside Emacs, or by typing the @kbd{C-c C-m C-r} or the @kbd{C-c C-m C-b} command in Texinfo mode in Emacs. @refill The @code{texinfo-format-region} and the @code{texinfo-format-buffer} commands are useful if you cannot run @code{makeinfo}. Also, in some circumstances, they format short regions or buffers more quickly than @code{makeinfo}.@refill @node Invoking makeinfo @subsection Running @code{makeinfo} from a Shell To create an Info file from a Texinfo file, type @code{makeinfo} followed by the name of the Texinfo file. Thus, to create the Info file for Bison, type the following to the shell: @example makeinfo bison.texinfo @end example (You can run a shell inside Emacs by typing @kbd{M-x shell}.)@refill @ifinfo Sometimes you will want to specify options. For example, if you wish to discover which version of @code{makeinfo} you are using, type:@refill @example makeinfo --version @end example @xref{makeinfo options}, for more information. @end ifinfo @node makeinfo options @comment node-name, next, previous, up @subsection Options for @code{makeinfo} @cindex @code{makeinfo} options @cindex Options for @code{makeinfo} The @code{makeinfo} command takes a number of options. Most often, options are used to set the value of the fill column and specify the footnote style. Each command line option is a word preceded by @samp{--} or a letter preceded by @samp{-}. You can use abbreviations for the long option names as long as they are unique.@refill For example, you could use the following shell command to create an Info file for @file{bison.texinfo} in which each line is filled to only 68 columns:@refill @example makeinfo --fill-column=68 bison.texinfo @end example You can write two or more options in sequence, like this:@refill @example makeinfo --no-split --fill-column=70 @dots{} @end example @noindent This would keep the Info file together as one possibly very long file and would also set the fill column to 70.@refill The options are: @table @code @item -D @var{var} @opindex -D @var{var} Cause the variable @var{var} to be defined. This is equivalent to @code{@@set @var{var}} in the Texinfo file (@pxref{set clear value}). @item --commands-in-node-names @opindex --commands-in-node-names Allow @code{@@}-commands in node names. This is not recommended, as it can probably never be implemented in @TeX{}. It also makes @code{makeinfo} much slower. Also, this option is ignored when @samp{--no-validate} is used. @xref{Pointer Validation}, for more details. +@item --docbook +@opindex --docbook +Generate DocBook output rather than Info. + @item --error-limit=@var{limit} @itemx -e @var{limit} @opindex --error-limit=@var{limit} @opindex -e @var{limit} Set the maximum number of errors that @code{makeinfo} will report before exiting (on the assumption that continuing would be useless); default 100. @item --fill-column=@var{width} @itemx -f @var{width} @opindex --fill-column=@var{width} @opindex -f @var{width} Specify the maximum number of columns in a line; this is the right-hand edge of a line. Paragraphs that are filled will be filled to this width. (Filling is the process of breaking up and connecting lines so that lines are the same length as or shorter than the number specified as the fill column. Lines are broken between words.) The default value is 72. Ignored with @samp{--html}. @item --footnote-style=@var{style} @itemx -s @var{style} @opindex --footnote-style=@var{style} @opindex -s @var{style} Set the footnote style to @var{style}, either @samp{end} for the end node style (the default) or @samp{separate} for the separate node style. The value set by this option overrides the value set in a Texinfo file by an @code{@@footnotestyle} command (@pxref{Footnotes}). When the footnote style is @samp{separate}, @code{makeinfo} makes a new node containing the footnotes found in the current node. When the footnote style is @samp{end}, @code{makeinfo} places the footnote references at the end of the current node. Ignored with @samp{--html}. @item --force @itemx -F @opindex --force @opindex -F Ordinarily, if the input file has errors, the output files are not created. With this option, they are preserved. @item --help @itemx -h @opindex --help @opindex -h Print a usage message listing all available options, then exit successfully. @item --html -Generate HTML output rather than Info. @xref{makeinfo html}. +@opindex --html +Generate HTML output rather than Info. @xref{makeinfo html}. By +default, the HTML output is split into one output file per source node, +and the split output is written into a subdirectory with the name of the +top-level info file. @item -I @var{dir} @opindex -I @var{dir} Append @var{dir} to the directory search list for finding files that are included using the @code{@@include} command. By default, @code{makeinfo} searches only the current directory. If @var{dir} is not given, the current directory @file{.} is appended. Note that @var{dir} can actually be a list of several directories separated by the usual path separator character (@samp{:} on Unix, @samp{;} on MS-DOS/MS-Windows). @item --macro-expand=@var{file} @itemx -E @var{file} Output the Texinfo source with all the macros expanded to the named file. Normally, the results of macro expansion are used internally by @code{makeinfo} and then discarded. This option is used by @command{texi2dvi} if you are using an old version of @file{texinfo.tex} that does not support @code{@@macro}. @item --no-headers @opindex --no-headers @cindex Plain text output @cindex ASCII text output @cindex Generating plain text files @cindex @file{INSTALL} file, generating For Info output, do not include menus or node lines in the output and write to standard output (unless @option{--output} is specified). This results in an @sc{ascii} file that you cannot read in Info since it does not contain the requisite nodes or menus. It is primarily useful to extract certain pieces of a manual into separate files to be included in a distribution, such as @file{INSTALL} files. @cindex Navigation links, omitting For HTML output, if @samp{--no-split} is also specified, do not include a navigation links at the top of each node. @xref{makeinfo html}. @item --no-split @opindex --no-split @cindex Splitting of output files @cindex Output file splitting Suppress the splitting stage of @code{makeinfo}. By default, large output files (where the size is greater than 70k bytes) are split into smaller subfiles. For Info output, each one is approximately 50k bytes. For HTML output, each file contains one node (@pxref{makeinfo html}). @item --no-pointer-validate @itemx --no-validate @opindex --no-pointer-validate @opindex --no-validate @cindex Pointer validation, suppressing Suppress the pointer-validation phase of @code{makeinfo}. This can also be done with the @code{@@novalidate} command (@pxref{Use TeX,,Use @TeX{}}). Normally, after a Texinfo file is processed, some consistency checks are made to ensure that cross references can be resolved, etc. @xref{Pointer Validation}. @item --no-warn @opindex --no-warn Suppress warning messages (but @emph{not} error messages). You might want this if the file you are creating has examples of Texinfo cross references within it, and the nodes that are referenced do not actually exist. @item --number-sections @opindex --number-sections Output chapter, section, and appendix numbers as in printed manuals. @item --no-number-footnotes @opindex --no-number-footnotes Suppress automatic footnote numbering. By default, @code{makeinfo} numbers each footnote sequentially in a single node, resetting the current footnote number to 1 at the start of each node. @item --output=@var{file} @itemx -o @var{file} @opindex --output=@var{file} @opindex -o @var{file} Specify that the output should be directed to @var{file} and not to the file name specified in the @code{@@setfilename} command found in the Texinfo source (@pxref{setfilename}). If @var{file} is @samp{-}, output goes to standard output and @samp{--no-split} is implied. For split -HTML output, @var{file} is the name of the output file for the top node -(@pxref{makeinfo html}). +HTML output, @var{file} is the name for the directory into which all +HTML nodes are written (@pxref{makeinfo html}). @item -P @var{dir} @opindex -P @var{dir} Prepend @var{dir} to the directory search list for @code{@@include}. If @var{dir} is not given, the current directory @file{.} is prepended. See @samp{-I} for more details. @item --paragraph-indent=@var{indent} @itemx -p @var{indent} @opindex --paragraph-indent=@var{indent} @opindex -p @var{indent} Set the paragraph indentation style to @var{indent}. The value set by this option overrides the value set in a Texinfo file by an @code{@@paragraphindent} command (@pxref{paragraphindent}). The value of @var{indent} is interpreted as follows: @table @asis @item @samp{asis} Preserve any existing indentation at the starts of paragraphs. @item @samp{0} or @samp{none} Delete any existing indentation. @item @var{num} Indent each paragraph by @var{num} spaces. @end table @item --reference-limit=@var{limit} @itemx -r @var{limit} @opindex --reference-limit=@var{limit} @opindex -r @var{limit} Set the value of the number of references to a node that @code{makeinfo} will make without reporting a warning. If a node has more than this number of references in it, @code{makeinfo} will make the references but also report a warning. The default is 1000. @item -U @var{var} Cause @var{var} to be undefined. This is equivalent to @code{@@clear @var{var}} in the Texinfo file (@pxref{set clear value}). @item --verbose @opindex --verbose Cause @code{makeinfo} to display messages saying what it is doing. Normally, @code{makeinfo} only outputs messages if there are errors or warnings. @item --version @itemx -V @opindex --version @opindex -V Print the version number, then exit successfully. +@item --xml +@opindex --xml +Generate XML output rather than Info. + @end table @node Pointer Validation @subsection Pointer Validation @cindex Pointer validation with @code{makeinfo} @cindex Validation of pointers If you do not suppress pointer validation with the @samp{--no-validate} option or the @code{@@novalidate} command in the source file (@pxref{Use TeX,,Use @TeX{}}), @code{makeinfo} will check the validity of the final Info file. Mostly, this means ensuring that nodes you have referenced really exist. Here is a complete list of what is checked: @enumerate @item If a `Next', `Previous', or `Up' node reference is a reference to a 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, then the node pointed to by the `Previous' field must have a `Next' field which points back to this node.@refill @item Every node except the `Top' node must have an `Up' pointer.@refill @item The node referenced by an `Up' pointer must itself reference the current node through a menu item, unless the node referenced by `Up' has the form `(@var{file})'. @item If the `Next' reference of a node is not the same as the `Next' reference of the `Up' reference, then the node referenced by the `Next' pointer must have a `Previous' pointer that points back to the current node. This rule allows the last node in a section to point to the first node of the next chapter.@refill @item Every node except `Top' should be referenced by at least one other node, either via the `Previous' or `Next' links, or via a menu or a cross-reference.@refill @end enumerate @cindex @@-commands in @@node, limited support Some Texinfo documents might fail during the validation phase because they use commands like @code{@@value} and @code{@@definfoenclose} in node definitions and cross-references inconsistently. Consider the following example: @example @group @@set nodename Node 1 @@node @@value@{nodename@}, Node 2, Top, Top This is node 1. @@node Node 2, , Node 1, Top This is node 2. @end group @end example @noindent Here, the node ``Node 1'' was referenced both verbatim and through @code{@@value}. By default, @code{makeinfo} fails such cases, because node names are not fully expanded until they are written to the output file. You should always try to reference nodes consistently; e.g., in the above example, the second @code{@@node} line should have also used @code{@@value}. However, if, for some reason, you @emph{must} reference node names inconsistently, and @code{makeinfo} fails to validate the file, you can use the @samp{--commands-in-node-names} option to force @code{makeinfo} to perform the expensive expansion of all node names it finds in the document. This might considerably slow down the program, though; twofold increase in conversion time was measured for large documents such as the Jargon file. @cindex @@value in @@node lines The support for @code{@@}-commands in @code{@@node} directives is not general enough to be freely used. For example, if the example above redefined @code{nodename} somewhere in the document, @code{makeinfo} will fail to convert it, even if invoked with the @samp{--commands-in-node-names} option. @samp{--commands-in-node-names} has no effect if the @samp{--no-validate} option is given. @node makeinfo in Emacs @subsection Running @code{makeinfo} inside Emacs @cindex Running @code{makeinfo} in Emacs @cindex @code{makeinfo} inside Emacs @cindex Shell, running @code{makeinfo} in You can run @code{makeinfo} in GNU Emacs Texinfo mode by using either the @code{makeinfo-region} or the @code{makeinfo-buffer} commands. In Texinfo mode, the commands are bound to @kbd{C-c C-m C-r} and @kbd{C-c C-m C-b} by default.@refill @table @kbd @item C-c C-m C-r @itemx M-x makeinfo-region Format the current region for Info.@refill @findex makeinfo-region @item C-c C-m C-b @itemx M-x makeinfo-buffer Format the current buffer for Info.@refill @findex makeinfo-buffer @end table When you invoke either @code{makeinfo-region} or @code{makeinfo-buffer}, Emacs prompts for a file name, offering the name of the visited file as the default. You can edit the default file name in the minibuffer if you wish, before pressing @key{RET} to start the @code{makeinfo} process.@refill The Emacs @code{makeinfo-region} and @code{makeinfo-buffer} commands run the @code{makeinfo} program in a temporary shell buffer. If @code{makeinfo} finds any errors, Emacs displays the error messages in the temporary buffer.@refill @cindex Errors, parsing @cindex Parsing errors @findex next-error You can parse the error messages by typing @kbd{C-x `} (@code{next-error}). This causes Emacs to go to and position the cursor on the line in the Texinfo source that @code{makeinfo} thinks caused the error. @xref{Compilation, , Running @code{make} or Compilers Generally, emacs, The GNU Emacs Manual}, for more information about using the @code{next-error} command.@refill In addition, you can kill the shell in which the @code{makeinfo} command is running or make the shell buffer display its most recent output.@refill @table @kbd @item C-c C-m C-k @itemx M-x makeinfo-kill-job @findex makeinfo-kill-job Kill the current running @code{makeinfo} job (from @code{makeinfo-region} or @code{makeinfo-buffer}).@refill @item C-c C-m C-l @itemx M-x makeinfo-recenter-output-buffer @findex makeinfo-recenter-output-buffer Redisplay the @code{makeinfo} shell buffer to display its most recent output.@refill @end table @noindent (Note that the parallel commands for killing and recentering a @TeX{} job are @kbd{C-c C-t C-k} and @kbd{C-c C-t C-l}. @xref{Texinfo Mode Printing}.)@refill You can specify options for @code{makeinfo} by setting the @code{makeinfo-options} variable with either the @kbd{M-x edit-options} or the @kbd{M-x set-variable} command, or by setting the variable in your @file{.emacs} initialization file.@refill For example, you could write the following in your @file{.emacs} file:@refill @example @group (setq makeinfo-options "--paragraph-indent=0 --no-split --fill-column=70 --verbose") @end group @end example @c If you write these three cross references using xref, you see @c three references to the same named manual, which looks strange. @iftex For more information, see @ref{makeinfo options, , Options for @code{makeinfo}}, as well as ``Editing Variable Values,'' ``Examining and Setting Variables,'' and ``Init File'' in @cite{The GNU Emacs Manual}. @end iftex @noindent @ifinfo For more information, see@* @ref{Edit Options, , Editing Variable Values, emacs, The GNU Emacs Manual},@* @ref{Examining, , Examining and Setting Variables, emacs, The GNU Emacs Manual},@* @ref{Init File, , , emacs, The GNU Emacs Manual}, and@* @ref{makeinfo options, , Options for @code{makeinfo}}. @end ifinfo @node texinfo-format commands @comment node-name, next, previous, up @subsection The @code{texinfo-format@dots{}} Commands @findex texinfo-format-region @findex texinfo-format-buffer In GNU Emacs in Texinfo mode, you can format part or all of a Texinfo file with the @code{texinfo-format-region} command. This formats the current region and displays the formatted text in a temporary buffer called @samp{*Info Region*}.@refill Similarly, you can format a buffer with the @code{texinfo-format-buffer} command. This command creates a new buffer and generates the Info file in it. Typing @kbd{C-x C-s} will save the Info file under the name specified by the @code{@@setfilename} line which must be near the beginning of the Texinfo file.@refill @table @kbd @item C-c C-e C-r @itemx @code{texinfo-format-region} Format the current region for Info. @findex texinfo-format-region @item C-c C-e C-b @itemx @code{texinfo-format-buffer} Format the current buffer for Info. @findex texinfo-format-buffer @end table The @code{texinfo-format-region} and @code{texinfo-format-buffer} commands provide you with some error checking, and other functions can provide you with further help in finding formatting errors. These procedures are described in an appendix; see @ref{Catching Mistakes}. However, the @code{makeinfo} program is often faster and provides better error checking (@pxref{makeinfo in Emacs}).@refill @node Batch Formatting @comment node-name, next, previous, up @subsection Batch Formatting @cindex Batch formatting for Info @cindex Info batch formatting You can format Texinfo files for Info using @code{batch-texinfo-format} and Emacs Batch mode. You can run Emacs in Batch mode from any shell, including a shell inside of Emacs. (@xref{Command Switches, , Command Line Switches and Arguments, emacs, The GNU Emacs Manual}.)@refill Here is a shell command to format all the files that end in @file{.texinfo} in the current directory: @example emacs -batch -funcall batch-texinfo-format *.texinfo @end example @noindent Emacs processes all the files listed on the command line, even if an error occurs while attempting to format some of them.@refill Run @code{batch-texinfo-format} only with Emacs in Batch mode as shown; it is not interactive. It kills the Batch mode Emacs on completion.@refill @code{batch-texinfo-format} is convenient if you lack @code{makeinfo} and want to format several Texinfo files at once. When you use Batch mode, you create a new Emacs process. This frees your current Emacs, so 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 @comment node-name, next, previous, up @subsection Tag Files and Split Files @cindex Making a tag table automatically @cindex Tag table, making automatically If a Texinfo file has more than 30,000 bytes, @code{texinfo-format-buffer} automatically creates a tag table for its Info file; @code{makeinfo} always creates a tag table. With a @dfn{tag table}, Info can jump to new nodes more quickly than it can otherwise.@refill @cindex Indirect subfiles In addition, if the Texinfo file contains more than about 70,000 bytes, @code{texinfo-format-buffer} and @code{makeinfo} split the large Info file into shorter @dfn{indirect} subfiles of about 50,000 bytes each. Big files are split into smaller files so that Emacs does not need to make a large buffer to hold the whole of a large Info file; instead, Emacs allocates just enough memory for the small, split-off file that is needed at the time. This way, Emacs avoids wasting memory when you run Info. (Before splitting was implemented, Info files were always kept short and @dfn{include files} were designed as a way to create a single, large printed manual out of the smaller Info files. @xref{Include Files}, for more information. Include files are still used for very large documents, such as @cite{The Emacs Lisp Reference Manual}, in which each chapter is a separate file.)@refill When a file is split, Info itself makes use of a shortened version of the original file that contains just the tag table and references to the files that were split off. The split-off files are called @dfn{indirect} files.@refill The split-off files have names that are created by appending @w{@samp{-1}}, @w{@samp{-2}}, @w{@samp{-3}} and so on to the file name specified by the @code{@@setfilename} command. The shortened version of the original file continues to have the name specified by @code{@@setfilename}.@refill At one stage in writing this document, for example, the Info file was saved as the file @file{test-texinfo} and that file looked like this:@refill @example @group Info file: test-texinfo, -*-Text-*- produced by texinfo-format-buffer from file: new-texinfo-manual.texinfo ^_ Indirect: test-texinfo-1: 102 test-texinfo-2: 50422 @end group @group test-texinfo-3: 101300 ^_^L Tag table: (Indirect) Node: overview^?104 Node: info file^?1271 @end group @group Node: printed manual^?4853 Node: conventions^?6855 @dots{} @end group @end example @noindent (But @file{test-texinfo} had far more nodes than are shown here.) Each of the split-off, indirect files, @file{test-texinfo-1}, @file{test-texinfo-2}, and @file{test-texinfo-3}, is listed in this file after the line that says @samp{Indirect:}. The tag table is listed after the line that says @samp{Tag table:}. @refill In the list of indirect files, the number following the file name records the cumulative number of bytes in the preceding indirect files, not counting the file list itself, the tag table, or the permissions text in each file. In the tag table, the number following the node name records the location of the beginning of the node, in bytes from the beginning of the (unsplit) output. If you are using @code{texinfo-format-buffer} to create Info files, you may want to run the @code{Info-validate} command. (The @code{makeinfo} command does such a good job on its own, you do not need @code{Info-validate}.) However, you cannot run the @kbd{M-x Info-validate} node-checking command on indirect files. For 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 makeinfo html @subsection Generating HTML @cindex HTML -As an alternative to the normal Info format output you can use the +Besides generating output in the Info format, you can use the @samp{--html} option to generate output in HTML format, for installation -on a web site (for example). In this release, HTML output from -@code{makeinfo} is monolithic, splitting the output by chapter or node -is not supported. We hope to implement this feature soon. - -The HTML output file is named according to @code{@@setfilename}, but -with any @samp{.info} extension replaced with @samp{.html}. +on a web site (for example). By default, the HTML output is split at +node level. + +When splitting, the HTML output files are written into a subdirectory. +The subdirectory is named according to the name from +@code{@@setfilename} with any extension removed; for example, HTML +output for @code{@@setfilename emacs.info} would be written into a +subdirectory named @samp{emacs}. If that directory cannot be created +for any reason, then @samp{.html} is appended to the directory name, as +in @samp{emacs.html} (this is necessary because sometimes the info file +is named without an extension, e.g., @samp{texinfo}). If the +@samp{@var{name}.html} directory can't be created either, +@code{makeinfo} gives up. In any case, the top-level output file within +the directory is always named @samp{index.html}. + +Monolithic output (@code{--no-split}) is named according to +@code{@@setfilename} or @code{--outfile}. Cross-document node +references are not supported in monolithic HTML. Texinfo input marked up with the @code{@@ifhtml} command will produce output only with the @samp{--html} option supplied. Input marked up with the @code{@@html} is passed literally to the output (suppressing the normal escaping of input @samp{<}, @samp{>} and @samp{&} characters which have special significance in HTML). The @samp{--footnote-style} option is currently ignored for HTML output; -footnotes are hyperlinked at the end of the output file. +footnotes are linked to the end of the output file. -The HTML generated is mostly standard (i.e., HTML 2.0, RFC1866). The +The HTML generated is mostly standard (i.e., HTML 2.0, RFC-1866). The exception is that HTML 3.2 tables are generated from the @code{@@multitable} command, but tagged to degrade as well as possible in browsers without table support. Please report output from an -error-free run of @code{makeinfo} which violates the HTML 3.2 DTD as a -bug. +error-free run of @code{makeinfo} which violates the @w{HTML 3.2} DTD as +a bug. Navigation bars are inserted at the start of nodes, similarly to Info output. The @samp{--no-headers} option will suppress this if used with @samp{--no-split}. Header @code{<link>} elements in split output can support info-like navigation with browsers like Lynx and @w{Emacs W3} -which implement this @w{HTML 1.0} feature. You still won't normally get -the multi-file regexp and index search facilities provided by Info -readers. Otherwise, hyperlinks are generated from Texinfo commands -where appropriate. @samp{@@xref} commands to other documents are -generated assuming the other document is available in HTML form too, and -@samp{.html} is appended to the @samp{@@xref} Info file name. This -presumably will often not work. +which implement this @w{HTML 1.0} feature. @samp{@@xref} commands to +other documents are generated assuming the other document is available +in split HTML form, and installed in the same HTML documentation tree, +at @file{../<info-document>/}. -@node Install an Info File +@node Installing an Info File @section Installing an Info File @cindex Installing an Info file @cindex Info file installation @cindex @file{dir} directory for Info installation Info files are usually kept in the @file{info} directory. You can read Info files using the standalone Info program or the Info reader built into Emacs. (@inforef{Top, info, info}, for an introduction to Info.) @menu * Directory File:: The top level menu for all Info files. * New Info File:: Listing a new info file. * 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 @subsection The Directory File @file{dir} For Info to work, the @file{info} directory must contain a file that serves as a top level directory for the Info system. By convention, this file is called @file{dir}. (You can find the location of this file within Emacs by typing @kbd{C-h i} to enter Info and then typing @kbd{C-x C-f} to see the pathname to the @file{info} directory.) The @file{dir} file is itself an Info file. It contains the top level menu for all the Info files in the system. The menu looks like this:@refill @example @group * Menu: * 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 - TeX or an Info file. + @@TeX@{@} or an Info file. @dots{} @end group @end example Each of these menu entries points to the `Top' node of the Info file that is named in parentheses. (The menu entry does not need to specify the `Top' node, since Info goes to the `Top' node if no node name is mentioned. @xref{Other Info Files, , Nodes in Other Info Files}.)@refill Thus, the @samp{Info} entry points to the `Top' node of the @file{info} file and the @samp{Emacs} entry points to the `Top' node of the @file{emacs} file.@refill In each of the Info files, the `Up' pointer of the `Top' node refers back to the @code{dir} file. For example, the line for the `Top' node of the Emacs manual looks like this in Info:@refill @example File: emacs Node: Top, Up: (DIR), Next: Distrib @end example @noindent In this case, the @file{dir} file name is written in upper case letters---it can be written in either upper or lower case. This is not true in general, it is a special case for @file{dir}. @node New Info File @subsection Listing a New Info File -@cindex Adding a new info file -@cindex Listing a new info file -@cindex New info file, listing it in @file{dir} file +@cindex Adding a new Info file +@cindex Listing a new Info file +@cindex New Info file, listing it in @file{dir} file @cindex Info file, listing a new @cindex @file{dir} file listing 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. @end example @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. 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}@footnote{On MS-DOS/MS-Windows systems, Info will try the @file{.inf} extension as well.}; so it is better to avoid clutter and not to write @samp{.info} explicitly in the menu entry. For example, the GDB menu entry should use just @samp{gdb} for the file name, not @samp{gdb.info}. @node Other Info Directories @subsection Info Files in Other Directories @cindex Installing Info in another directory @cindex Info installed in another directory @cindex Another Info directory @cindex @file{dir} files and Info directories If an Info file is not in the @file{info} directory, there are three ways to specify its location:@refill @enumerate @item Write the pathname in the @file{dir} file as the second part of the menu. @item If you are using Emacs, list the name of the file in a second @file{dir} 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 variable tells Emacs where to look for @file{dir} files (the files must be named @file{dir}). Emacs merges the files named @file{dir} from each of the listed directories. (In Emacs version 18, you can set the @code{Info-directory} variable to the name of only one directory.)@refill @item Specify the Info directory name in the @code{INFOPATH} environment variable in your @file{.profile} or @file{.cshrc} initialization file. (Only you and others who set this environment variable will be able to find Info files whose location is specified this way.) @end enumerate For example, to reach a test file in the @file{/home/bob/info} directory, you could add an entry like this to the menu in the standard @file{dir} file:@refill @example * Test: (/home/bob/info/info-test). Bob's own test file. @end example @noindent In this case, the absolute file name of the @file{info-test} file is written as the second part of the menu entry.@refill -Alternatively, you could write the following in your @file{.emacs} -file:@refill +Alternatively, you could write the following in your @file{.emacs} file: @vindex Info-directory-list @example @group (require 'info) (setq Info-directory-list - (cons (expand-file-name "/home/bob/info") Info-directory-list)) + (cons (expand-file-name "/home/bob/info") + Info-directory-list)) @end group @end example -This tells Emacs to merge the @file{dir} file from the -@file{/home/bob/info} directory with the system @file{dir} file. Info -will list the @file{/home/bob/info/info-test} file as a menu entry in -the @file{/home/bob/info/dir} file. Emacs does the merging only -when @kbd{M-x info} is first run, so if you want to set +This tells Emacs to merge the system @file{dir} file with the @file{dir} +file in @file{/home/bob/info}. Thus, Info will list the +@file{/home/bob/info/info-test} file as a menu entry in the +@file{/home/bob/info/dir} file. Emacs does the merging only when +@kbd{M-x info} is first run, so if you want to set @code{Info-directory-list} in an Emacs session where you've already run @code{info}, you must @code{(setq Info-dir-contents nil)} to force Emacs to recompose the @file{dir} file. @vindex INFOPATH Finally, you can tell Info where to look by setting the @code{INFOPATH} environment variable in your shell startup file, such as @file{.cshrc}, @file{.profile} or @file{autoexec.bat}. If you use a Bourne-compatible shell such as @code{sh} or @code{bash} for your shell command interpreter, you set the @code{INFOPATH} environment variable in the @file{.profile} initialization file; but if you use @code{csh} or @code{tcsh}, you set the variable in the @file{.cshrc} initialization file. On MS-DOS/MS-Windows systems, you must set @code{INFOPATH} in your @file{autoexec.bat} file or in the Registry. Each type of shell uses a different syntax. @itemize @bullet @item In a @file{.cshrc} file, you could set the @code{INFOPATH} variable as follows:@refill @smallexample setenv INFOPATH .:~/info:/usr/local/emacs/info @end smallexample @item In a @file{.profile} file, you would achieve the same effect by writing:@refill @smallexample INFOPATH=.:$HOME/info:/usr/local/emacs/info export INFOPATH @end smallexample @item @pindex autoexec.bat In a @file{autoexec.bat} file, you write this command@footnote{Note the use of @samp{;} as the directory separator, and a different syntax for using values of other environment variables.}: @smallexample set INFOPATH=.;%HOME%/info;c:/usr/local/emacs/info @end smallexample @end itemize @noindent The @samp{.} indicates the current directory as usual. Emacs uses the @code{INFOPATH} environment variable to initialize the value of Emacs's own @code{Info-directory-list} variable. The stand-alone Info reader merges any files named @file{dir} in any directory listed in the @env{INFOPATH} variable into a single menu presented to you in the node called @samp{(dir)Top}. -@cindex @samp{:} @r{last in @env{INFOPATH}} +@cindex colon, last in @env{INFOPATH} However you set @env{INFOPATH}, if its last character is a colon@footnote{On MS-DOS/MS-Windows systems, use semi-colon instead.}, this is replaced by the default (compiled-in) path. This gives you a way to augment the default path with new directories without having to list all the standard places. For example (using @code{sh} syntax): @example INFOPATH=/local/info: export INFOPATH @end example @noindent will search @file{/local/info} first, then the standard directories. Leading or doubled colons are not treated specially. @cindex @file{dir} file, creating your own When you create your own @file{dir} file for use with @code{Info-directory-list} or @env{INFOPATH}, it's easiest to start by copying an existing @file{dir} file and replace all the text after the @samp{* Menu:} with your desired entries. That way, the punctuation and special CTRL-_ characters that Info needs will be present. -@node Installing Dir Entries, Invoking install-info, Other Info Directories, Install an Info File +@node Installing Dir Entries @subsection Installing Info Directory Files When you install an Info file onto your system, you can use the program @code{install-info} to update the Info directory file @file{dir}. 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}@dots{}@code{@@end direntry} in the Texinfo source file. Use @code{@@direntry} to specify the menu entries to add to the Info directory file, and use @code{@@dircategory} to specify which part of the Info directory to put it in. Here is how these commands are used in this manual: @smallexample @@dircategory Texinfo documentation system @@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 the `current' category; any subsequent @code{@@direntry} commands will add to that category. -Here are some recommended @code{@@dircategory} categories: `GNU -packages', `GNU programming tools', `GNU programming documentation', -`GNU Emacs Lisp', `GNU libraries', `Linux', `TeX', `Individual -utilities'. The idea is to include the `invoking' node for every -program installed by a package under `Individual utilities', and an -entry for the manual as a whole in the appropriate other category. +Here are some recommended @code{@@dircategory} categories: + +@display +GNU packages +GNU programming tools +GNU programming documentation +GNU Emacs Lisp +GNU libraries +Linux +TeX +Individual utilities +@end display + +The idea is to include the `Invoking' node for every program installed +by a package under `Individual utilities', and an entry for the manual +as a whole in the appropriate other category. @node Invoking install-info @subsection Invoking install-info @pindex install-info @code{install-info} inserts menu entries from an Info file into the top-level @file{dir} file in the Info system (see the previous sections for an explanation of how the @file{dir} file works). It's most often run as part of software installation, or when constructing a @file{dir} file for all manuals on a system. Synopsis: @example install-info [@var{option}]@dots{} [@var{info-file} [@var{dir-file}]] @end example If @var{info-file} or @var{dir-file} are not specified, the options (described below) that define them must be. There are no compile-time defaults, and standard input is never used. @code{install-info} can read only one Info file and write only one @file{dir} file per invocation. @cindex @file{dir}, created by @code{install-info} If @var{dir-file} (however specified) does not exist, @code{install-info} creates it if possible (with no entries). @cindex Compressed files, reading @cindex Dir files, compressed If any input file is compressed with @code{gzip} (@pxref{Invoking gzip,,,gzip, Gzip}), @code{install-info} automatically uncompresses it for reading. And if @var{dir-file} is compressed, @code{install-info} also automatically leaves it compressed after writing any changes. If @var{dir-file} itself does not exist, @code{install-info} tries to open @file{@var{dir-file}.gz}. Options: @table @code @item --delete @opindex --delete Delete the entries in @var{info-file} from @var{dir-file}. The file name in the entry in @var{dir-file} must be @var{info-file} (except for an optional @samp{.info} in either one). Don't insert any new entries. @item --dir-file=@var{name} @itemx -d @var{name} @opindex --dir-file=@var{name} @opindex -d @var{name} Specify file name of the Info directory file. This is equivalent to using the @var{dir-file} argument. @item --entry=@var{text} @itemx -e @var{text} @opindex --entry=@var{text} @opindex -e @var{text} Insert @var{text} as an Info directory entry; @var{text} should have the form of an Info menu item line plus zero or more extra lines starting with whitespace. If you specify more than one entry, they are all added. If you don't specify any entries, they are determined from information in the Info file itself. @item --help @itemx -h @opindex --help @opindex -h Display a usage message listing basic usage and all available options, then exit successfully. @item --info-file=@var{file} @itemx -i @var{file} @opindex --info-file=@var{file} @opindex -i @var{file} Specify Info file to install in the directory. Equivalent to using the @var{info-file} argument. @item --info-dir=@var{dir} @itemx -D @var{dir} @opindex --info-dir=@var{dir} @opindex -D @var{dir} Specify the directory where @file{dir} resides. Equivalent to @samp{--dir-file=@var{dir}/dir}. @item --item=@var{text} @opindex --item=@var{text} Same as @samp{--entry=@var{text}}. An Info directory entry is actually a menu item. @item --quiet @opindex --quiet Suppress warnings. @item --remove @itemx -r @opindex --remove @opindex -r Same as @samp{--delete}. @item --section=@var{sec} @itemx -s @var{sec} @opindex --section=@var{sec} @opindex -s @var{sec} Put this file's entries in section @var{sec} of the directory. If you specify more than one section, all the entries are added in each of the sections. If you don't specify any sections, they are determined from information in the Info file itself. @item --version @itemx -V @opindex --version @opindex -V @cindex version number, finding Display version information and exit successfully. @end table @node Command List @appendix @@-Command List @cindex Alphabetical @@-command list @cindex List of @@-commands @cindex @@-command list @cindex Reference to @@-commands Here is an alphabetical list of the @@-commands in Texinfo. Square brackets, @t{[}@w{ }@t{]}, indicate optional arguments; an ellipsis, @samp{@dots{}}, indicates repeated text. @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 @@. 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{Not Ending a Sentence}. @item @@= Generate a macron (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 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 brace, @samp{@{}. @xref{Braces Atsigns, , Inserting @@ and braces}. @item @@@} Stands for a right-hand brace, @samp{@}}.@* @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 @@acronym@{@var{abbrev}@} Tag @var{abbrev} as an acronym, that is, an abbreviation written in all capital letters, such as `NASA'. @xref{acronym,, @code{acronym}}. @item @@AE@{@} @itemx @@ae@{@} Generate the uppercase and lowercase AE ligatures, respectively: @AE{}, @ae{}. @xref{Inserting Accents}. +@itemx @@afivepaper +Change page dimensions for the A5 paper size. @xref{A4 Paper}. + @item @@afourlatex @itemx @@afourpaper @itemx @@afourwide Change page dimensions for the A4 paper size. @xref{A4 Paper}. @item @@alias @var{new}=@var{existing} Make the command @samp{@@@var{new}} an alias for the existing command @samp{@@@var{existing}}. @xref{alias}. @item @@anchor@{@var{name}@} Define @var{name} as the current location for use as a cross-reference target. @xref{anchor,, @code{@@anchor}}. @item @@appendix @var{title} Begin an appendix. The title appears in the table of contents of a printed manual. In Info, the title is underlined with asterisks. @xref{unnumbered & appendix, , The @code{@@unnumbered} and @code{@@appendix} Commands}.@refill @item @@appendixsec @var{title} @itemx @@appendixsection @var{title} Begin an appendix section within an appendix. The section title appears in the table of contents of a printed manual. In Info, the title is underlined with equal signs. @code{@@appendixsection} is a longer spelling of the @code{@@appendixsec} command. @xref{unnumberedsec appendixsec heading, , Section Commands}.@refill @item @@appendixsubsec @var{title} Begin an appendix subsection within an appendix. The title appears in the table of contents of a printed manual. In Info, the title is underlined with hyphens. @xref{unnumberedsubsec appendixsubsec subheading, , Subsection Commands}.@refill @item @@appendixsubsubsec @var{title} Begin an appendix subsubsection within an appendix subsection. 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 @@asis Used following @code{@@table}, @code{@@ftable}, and @code{@@vtable} to print the table's first column without highlighting (``as is''). @xref{Two-column Tables, , Making a Two-column Table}.@refill @item @@author @var{author} Typeset @var{author} flushleft and underline it. @xref{title subtitle author, , The @code{@@title} and @code{@@author} Commands}.@refill @item @@b@{@var{text}@} Print @var{text} in @b{bold} font. No effect in Info. @xref{Fonts}.@refill @ignore @item @@br Force a paragraph break. If used within a line, follow @code{@@br} with braces. @xref{br, , @code{@@br}}.@refill @end ignore @item @@bullet@{@} Generate a large round dot, or the closest possible thing to one. @xref{bullet, , @code{@@bullet}}.@refill @item @@bye Stop formatting a file. The formatters do not see the contents of a file following an @code{@@bye} command. @xref{Ending a File}.@refill @item @@c @var{comment} Begin a comment in Texinfo. The rest of the line does not appear in either the Info file or the printed manual. A synonym for @code{@@comment}. @xref{Comments, , Comments}.@refill @item @@cartouche Highlight an example or quotation by drawing a box with rounded corners around it. Pair with @code{@@end cartouche}. No effect in Info. @xref{cartouche, , Drawing Cartouches Around Examples}.)@refill @item @@center @var{line-of-text} Center the line of text following the command. @xref{titlefont center sp, , @code{@@center}}.@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 contents of a printed manual. In Info, the title is underlined with asterisks. @xref{majorheading & chapheading, , @code{@@majorheading} and @code{@@chapheading}}.@refill @item @@chapter @var{title} Begin a chapter. The chapter title appears in the table of contents of a printed manual. In Info, the title is underlined with asterisks. @xref{chapter, , @code{@@chapter}}.@refill @item @@cindex @var{entry} Add @var{entry} to the index of concepts. @xref{Index Entries, , Defining the Entries of an Index}.@refill @item @@cite@{@var{reference}@} Highlight the name of a book or other reference that lacks a companion Info file. @xref{cite, , @code{@@cite}}.@refill @item @@clear @var{flag} 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. @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill @item @@code@{@var{sample-code}@} Highlight text that is an expression, a syntactically complete token of a program, or a program name. @xref{code, , @code{@@code}}.@refill @item @@command@{@var{command-name}@} Indicate a command name, such as @command{ls}. @xref{command,, @code{@@command}}. @item @@comment @var{comment} Begin a comment in Texinfo. The rest of the line does not appear in either the Info file or the printed manual. A synonym for @code{@@c}. @xref{Comments}. @item @@contents Print a complete table of contents. Has no effect in Info, which uses menus instead. @xref{Contents, , Generating a Table of Contents}.@refill @item @@copyright@{@} Generate a copyright symbol. @xref{copyright symbol, , @code{@@copyright}}.@refill @ignore @item @@ctrl@{@var{ctrl-char}@} Describe an @sc{ascii} control character. Insert actual control character into Info file. @xref{ctrl, , @code{@@ctrl}}.@refill @end ignore @item @@defcodeindex @var{index-name} Define a new index and its indexing command. Print entries in an @code{@@code} font. @xref{New Indices, , Defining New 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}, 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 entity, and its arguments, if any. @xref{Definition Commands}.@refill @item @@defindex @var{index-name} Define a new index and its indexing command. Print entries in a roman font. @xref{New Indices, , Defining New Indices}.@refill @item @@definfoenclose @var{newcmd}, @var{before}, @var{after}, Create new @@-command @var{newcmd} for Info that marks text by enclosing it in strings that precede and follow the text. @xref{definfoenclose}. @item @@defivar @var{class} @var{instance-variable-name} @itemx @@defivarx @var{class} @var{instance-variable-name} 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}, and @ref{deffnx,, Def Cmds in Detail}. @item @@defmac @var{macroname} @var{arguments}@dots{} @itemx @@defmacx @var{macroname} @var{arguments}@dots{} Format a description for a macro. The command is equivalent to @samp{@@deffn Macro @dots{}}. @xref{Definition Commands}, and @ref{deffnx,, Def Cmds in Detail}. @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}, 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}, and @ref{Abstract Objects}. @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}, and @ref{deffnx,, Def Cmds in Detail}. @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}, and @ref{deffnx,, Def Cmds in Detail}. @item @@deftp @var{category} @var{name-of-type} @var{attributes}@dots{} @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{Data Types}. @item @@deftypefn @var{classification} @var{data-type} @var{name} @var{arguments}@dots{} @itemx @@deftypefnx @var{classification} @var{data-type} @var{name} @var{arguments}@dots{} 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}, 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}, and @ref{deffnx,, Def Cmds in Detail}. @item @@deftypeivar @var{class} @var{data-type} @var{variable-name} @itemx @@deftypeivarx @var{class} @var{data-type} @var{variable-name} Format a description for a typed instance variable in object-oriented programming. @xref{Definition Commands}, and @ref{Abstract Objects}. @item @@deftypemethod @var{class} @var{data-type} @var{method-name} @var{arguments}@dots{} @itemx @@deftypemethodx @var{class} @var{data-type} @var{method-name} @var{arguments}@dots{} Format a description for a typed method in object-oriented programming. @xref{Definition Commands}, and @ref{deffnx,, Def Cmds in Detail}. @item @@deftypeop @var{category} @var{class} @var{data-type} @var{name} @var{arguments}@dots{} @itemx @@deftypeopx @var{category} @var{class} @var{data-type} @var{name} @var{arguments}@dots{} Format a description for a typed operation in object-oriented programming. @xref{Definition Commands}, and @ref{Abstract Objects}. @item @@deftypevar @var{data-type} @var{variable-name} @itemx @@deftypevarx @var{data-type} @var{variable-name} Format a description for a variable in a typed language. The command is equivalent to @samp{@@deftypevr Variable @dots{}}. @xref{Definition Commands}, and @ref{deffnx,, Def Cmds in Detail}. @item @@deftypevr @var{classification} @var{data-type} @var{name} @itemx @@deftypevrx @var{classification} @var{data-type} @var{name} Format a description for something like a variable in a typed 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}, 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}, 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}, 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}, and @ref{deffnx,, Def Cmds in Detail}. @item @@detailmenu Avoid @code{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. Pair with @code{@@end direntry}. @xref{Installing Dir Entries}. @item @@display Begin a kind of example. Like @code{@@example} (indent text, do not fill), but do not select a new font. Pair with @code{@@end display}. @xref{display, , @code{@@display}}. @item @@dmn@{@var{dimension}@} Format a unit of measure, as in 12@dmn{pt}. Causes @TeX{} to insert a thin space before @var{dimension}. No effect in Info. @xref{dmn, , @code{@@dmn}}. +@item @@documentdescription +Set the document description text, included in the HTML output. Pair +with @code{@@end documentdescription}. @xref{documentdescription,, +@code{@@documentdescription}}. + @item @@documentencoding @var{enc} -Declare the input encoding as @var{enc}. +Declare the input encoding to be @var{enc}. @xref{documentencoding,, @code{@@documentencoding}}. @item @@documentlanguage @var{CC} Declare the document language as the two-character ISO-639 abbreviation @var{CC}. @xref{documentlanguage,, @code{@@documentlanguage}}. @item @@dotaccent@{@var{c}@} Generate a dot accent over the character @var{c}, as in @dotaccent{o}. @xref{Inserting Accents}. @item @@dots@{@} Insert an ellipsis: @samp{@dots{}}. @xref{dots, , @code{@@dots}}.@refill @item @@email@{@var{address}[, @var{displayed-text}]@} Indicate an electronic mail address. @xref{email, , @code{@@email}}. @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}. @item @@end @var{environment} Ends @var{environment}, as in @samp{@@end example}. @xref{Formatting Commands,,@@-commands}. @item @@env@{@var{environment-variable}@} Indicate an environment variable name, such as @env{PATH}. @xref{env,, @code{@@env}}. @item @@enddots@{@} Generate an end-of-sentence of ellipsis, like this @enddots{} @xref{dots,,@code{@@dots@{@}}}. @item @@enumerate [@var{number-or-letter}] Begin a numbered list, using @code{@@item} for each entry. Optionally, start list with @var{number-or-letter}. Pair with @code{@@end enumerate}. @xref{enumerate, , @code{@@enumerate}}.@refill @item @@equiv@{@} Indicate to the reader the exact equivalence of two forms with a glyph: @samp{@equiv{}}. @xref{Equivalence}.@refill @item @@error@{@} Indicate to the reader with a glyph that the following text is an error message: @samp{@error{}}. @xref{Error Glyph}.@refill @item @@evenfooting [@var{left}] @@| [@var{center}] @@| [@var{right}] @itemx @@evenheading [@var{left}] @@| [@var{center}] @@| [@var{right}] Specify page footings resp.@: headings for even-numbered (left-hand) pages. Only allowed inside @code{@@iftex}. @xref{Custom Headings, , How to Make Your Own Headings}.@refill @item @@everyfooting [@var{left}] @@| [@var{center}] @@| [@var{right}] @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 @@exampleindent @var{indent} Indent example-like environments by @var{indent} number of spaces (perhaps 0). @xref{exampleindent,, Paragraph Indenting}. @item @@exclamdown@{@} Produce an upside-down exclamation point. @xref{Inserting Accents}. @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{}}. @xref{expansion, , @expansion{} Indicating an Expansion}.@refill @item @@file@{@var{filename}@} Highlight the name of a file, buffer, node, or directory. @xref{file, , @code{@@file}}.@refill @item @@finalout Prevent @TeX{} from printing large black warning rectangles beside over-wide lines. @xref{Overfull hboxes}.@refill @item @@findex @var{entry} Add @var{entry} to the index of functions. @xref{Index Entries, , Defining the Entries of an Index}.@refill @item @@flushleft @itemx @@flushright Left justify every line but leave the right end ragged. Leave font as is. Pair with @code{@@end flushleft}. @code{@@flushright} analogous. @xref{flushleft & flushright, , @code{@@flushleft} and @code{@@flushright}}.@refill @item @@footnote@{@var{text-of-footnote}@} Enter a footnote. Footnote text is printed at the bottom of the page by @TeX{}; Info may format in either `End' node or `Separate' node style. @xref{Footnotes}.@refill @item @@footnotestyle @var{style} Specify an Info file's footnote style, either @samp{end} for the end node style or @samp{separate} for the separate node style. @xref{Footnotes}.@refill @item @@format Begin a kind of example. Like @code{@@display}, but do not narrow the margins. Pair with @code{@@end format}. @xref{example,, @code{@@example}}. @item @@ftable @var{formatting-command} Begin a two-column table, using @code{@@item} for each entry. Automatically enter each of the items in the first column into the index of functions. Pair with @code{@@end ftable}. The same as @code{@@table}, except for indexing. @xref{ftable vtable, , @code{@@ftable} and @code{@@vtable}}.@refill @item @@group 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 underlined with equal signs. @xref{unnumberedsec appendixsec heading, , Section Commands}.@refill @item @@headings @var{on-off-single-double} 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 @@html Enter HTML completely. Pair with @code{@@end html}. @xref{Raw Formatter Commands}. @item @@hyphenation@{@var{hy-phen-a-ted words}@} Explicitly define hyphenation points. @xref{- and hyphenation,, @code{@@-} and @code{@@hyphenation}}. @item @@i@{@var{text}@} Print @var{text} in @i{italic} font. No effect in Info. @xref{Fonts}.@refill @item @@ifclear @var{flag} If @var{flag} is cleared, the Texinfo formatting commands format text between @code{@@ifclear @var{flag}} and the following @code{@@end ifclear} command. @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@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}. @item @@ifnothtml @itemx @@ifnotinfo @itemx @@ifnottex Begin a stretch of text that will be ignored in one output format but not the others. The text appears only in the format not specified. Pair with @code{@@end ifnothtml} resp.@: @code{@@end ifnotinfo} resp.@: @code{@@end ifnotinfo}. @xref{Conditionals}. @item @@ifset @var{flag} If @var{flag} is set, the Texinfo formatting commands format text between @code{@@ifset @var{flag}} and the following @code{@@end ifset} command. @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill @item @@iftex Begin a stretch of text that will not appear in the Info file, but will be processed only by @TeX{}. Pair with @code{@@end iftex}. @xref{Conditionals, , Conditionally Visible Text}.@refill @item @@ignore Begin a stretch of text that will not appear in either the Info file or the printed output. Pair with @code{@@end ignore}. @xref{Comments, , Comments and Ignored Text}.@refill -@item @@image@{@var{filename}, [@var{width}], [@var{height}]@} +@item @@image@{@var{filename}, [@var{width}], [@var{height}], [@var{alt}], [@var{ext}]@} Include graphics image in external @var{filename} scaled to the given -@var{width} and/or @var{height}. @xref{Images}. +@var{width} and/or @var{height}, using @var{alt} text and looking for +@samp{@var{filename}.@var{ext}} in HTML. @xref{Images}. @item @@include @var{filename} Incorporate the contents of the file @var{filename} into the Info file or printed document. @xref{Include Files}.@refill @item @@inforef@{@var{node-name}, [@var{entry-name}], @var{info-file-name}@} Make a cross reference to an Info file for which there is no printed manual. @xref{inforef, , Cross references using @code{@@inforef}}.@refill @item \input @var{macro-definitions-file} 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 recognize @code{@@} until after it has read the definitions file. @xref{Header, , The Texinfo File Header}.@refill @item @@item Indicate the beginning of a marked paragraph for @code{@@itemize} and @code{@@enumerate}; indicate the beginning of the text of a first column entry for @code{@@table}, @code{@@ftable}, and @code{@@vtable}. @xref{Lists and Tables}.@refill @item @@itemize @var{mark-generating-character-or-command} Produce a sequence of indented paragraphs, with a mark inside the left margin at the beginning of each paragraph. Pair with @code{@@end itemize}. @xref{itemize, , @code{@@itemize}}.@refill @item @@itemx 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 is characters of input to be typed by users. @xref{kbd, , @code{@@kbd}}.@refill @item @@kbdinputstyle @var{style} Specify when @code{@@kbd} should use a font distinct from @code{@@code}. @xref{kbd, , @code{@@kbd}}.@refill @item @@key@{@var{key-name}@} Indicate 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. @c Yes, let's toss it, it's pretty weird. --karl, 15jun97. @c @item @@global@@let@var{new-command}=@var{existing-command} @c Equate a new highlighting command with an existing one. Only for @c @TeX{}. Write definition inside of @code{@@iftex} @dots{} @code{@@end @c iftex}. @xref{Customized Highlighting}.@refill @item @@lisp Begin an example of Lisp code. Indent text, do not fill, and select fixed-width font. Pair with @code{@@end lisp}. @xref{lisp, , @code{@@lisp}}. @item @@lowersections Change subsequent chapters to sections, sections to subsections, and so on. @xref{Raise/lower sections, , @code{@@raisesections} and @code{@@lowersections}}.@refill @item @@macro @var{macroname} @{@var{params}@} Define a new Texinfo command @code{@@@var{macroname}@{@var{params}@}}. Only supported by @code{makeinfo} and @code{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 heading line is underlined with asterisks. @xref{majorheading & chapheading, , @code{@@majorheading} and @code{@@chapheading}}.@refill @item @@math@{@var{mathematical-expression}@} Format a mathematical expression. @xref{math, , @code{@@math}: Inserting Mathematical Expressions}. @item @@menu 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, `@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 (thousandths of an inch) remain on the current page. @xref{need, , @code{@@need}}.@refill @item @@node @var{name}, @var{next}, @var{previous}, @var{up} Define the beginning of a new node in Info, and serve as a locator for references for @TeX{}. @xref{node, , @code{@@node}}.@refill @item @@noindent Prevent text from being indented as if it were a new paragraph. @xref{noindent, , @code{@@noindent}}.@refill @item @@novalidate Suppress validation of node references, omit creation of auxiliary files with @TeX{}. Use before @code{@@setfilename}. @xref{Pointer Validation}. @item @@O@{@} @itemx @@o@{@} Generate the uppercase and lowercase O-with-slash letters, respectively: @O{}, @o{}. @item @@oddfooting [@var{left}] @@| [@var{center}] @@| [@var{right}] @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 @@OE@{@} @itemx @@oe@{@} Generate the uppercase and lowercase OE ligatures, respectively: @OE{}, @oe{}. @xref{Inserting Accents}. @item @@option@{@var{option-name}@} Indicate a command-line option, such as @option{-l} or @option{--help}. @xref{option,, @code{@@option}}. @item @@page Start a new page in a printed manual. No effect in Info. @xref{page, , @code{@@page}}.@refill @item @@pagesizes [@var{width}][, @var{height}] Change page dimensions. @xref{pagesizes}. @item @@paragraphindent @var{indent} Indent paragraphs by @var{indent} number of spaces (perhaps 0); preserve source file indentation if @var{indent} is @code{asis}. @xref{paragraphindent,, Paragraph Indenting}. @item @@pindex @var{entry} Add @var{entry} to the index of programs. @xref{Index Entries, , Defining the Entries of an Index}.@refill @item @@point@{@} 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 @item @@printindex @var{index-name} Print an alphabetized two-column index in a printed manual or generate an alphabetized menu of index entries for Info. @xref{Printing 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. 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 @code{@@end quotation}. @xref{quotation, , @code{@@quotation}}.@refill @item @@r@{@var{text}@} Print @var{text} in @r{roman} font. No effect in Info. @xref{Fonts}.@refill @item @@raisesections Change subsequent sections to chapters, subsections to sections, and so on. @xref{Raise/lower sections, , @code{@@raisesections} and @code{@@lowersections}}.@refill @item @@ref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@} Make a reference. In a printed manual, the reference does not start with a `See'. Follow command with a punctuation mark. Only the first argument is mandatory. @xref{ref, , @code{@@ref}}.@refill @item @@refill In Info, refill and indent the paragraph after all the other processing has been done. No effect on @TeX{}, which always refills. This command is no longer needed, since all formatters now automatically refill. @xref{Refilling Paragraphs}.@refill @item @@result@{@} 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 entire shell commands. @xref{samp, , @code{@@samp}}.@refill @item @@sc@{@var{text}@} Set @var{text} in a printed output in @sc{the small caps font} and set text in the Info file in uppercase letters. @xref{Smallcaps}.@refill @item @@section @var{title} Begin a section within a chapter. In a printed manual, the section title is numbered and appears in the table of contents. In Info, the title is underlined with equal signs. @xref{section, , @code{@@section}}.@refill @item @@set @var{flag} [@var{string}] Make @var{flag} active, causing the Texinfo formatting commands to format text between subsequent pairs of @code{@@ifset @var{flag}} and @code{@@end ifset} commands. Optionally, set value of @var{flag} to @var{string}. @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}. @item @@setchapternewpage @var{on-off-odd} Specify whether chapters start on new pages, and if so, whether on odd-numbered (right-hand) new pages. @xref{setchapternewpage, , @code{@@setchapternewpage}}. @item @@setcontentsaftertitlepage Put the table of contents after the @samp{@@end titlepage} even if the @code{@@contents} command is not there. @xref{Contents}. @item @@setfilename @var{info-file-name} Provide a name to be used by the Info file. This command is essential for @TeX{} formatting as well, even though it produces no output. @xref{setfilename, , @code{@@setfilename}}. @item @@setshortcontentsaftertitlepage Place the short table of contents after the @samp{@@end titlepage} command even if the @code{@@shortcontents} command is not there. @xref{Contents}. @item @@settitle @var{title} -Provide a title for page headers in a printed manual. +Provide a title for page headers in a printed manual, and the default +document description for HTML @samp{<head>}. @xref{settitle, , @code{@@settitle}}.@refill @item @@shortcontents Print a short table of contents. Not relevant to Info, which uses 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}}. @item @@smallbook Cause @TeX{} to produce a printed manual in a 7 by 9.25 inch format rather than the regular 8.5 by 11 inch format. @xref{smallbook, , Printing Small Books}. Also, see @ref{small}. @item @@smalldisplay -Begin a kind of example. Like @code{@@smallexample} (indent text, no -filling), but do not select the fixed-width font. In @code{@@smallbook} -format, print text in a smaller font than with @code{@@display}. Pair -with @code{@@end smalldisplay}. @xref{small}. +Begin a kind of example. Like @code{@@smallexample} (narrow margins, no +filling), but do not select the fixed-width font. Pair with @code{@@end +smalldisplay}. @xref{small}. @item @@smallexample Indent text to indicate an example. Do not fill, select fixed-width -font. In @code{@@smallbook} format, print text in a smaller font than -with @code{@@example}. Pair with @code{@@end smallexample}. +font, narrow the margins. In printed manuals, print text in a smaller +font than with @code{@@example}. Pair with @code{@@end smallexample}. @xref{small}. @item @@smallformat Begin a kind of example. Like @code{@@smalldisplay}, but do not narrow -the margins and do not select the fixed-width font. -In @code{@@smallbook} format, print text in a smaller font than -with @code{@@format}. Pair with @code{@@end smallformat}. -@xref{small}. +the margins. Pair with @code{@@end smallformat}. @xref{small}. @item @@smalllisp -Begin an example of Lisp code. Indent text, do not fill, select -fixed-width font. In @code{@@smallbook} format, print text in a -smaller font. Pair with @code{@@end smalllisp}. @xref{small}. +Begin an example of Lisp code. Same as @code{@@smallexample}. Pair +with @code{@@end smalllisp}. @xref{small}. @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}. @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 @item @@subheading @var{title} Print an unnumbered subsection-like heading in the text, but not in the table of contents of a printed manual. In Info, the title is underlined with hyphens. @xref{unnumberedsubsec appendixsubsec subheading, , @code{@@unnumberedsubsec} @code{@@appendixsubsec} @code{@@subheading}}.@refill @item @@subsection @var{title} Begin a subsection within a section. In a printed manual, the subsection title is numbered and appears in the table of contents. In Info, the title is underlined with hyphens. @xref{subsection, , @code{@@subsection}}.@refill @item @@subsubheading @var{title} Print an unnumbered subsubsection-like heading in the text, but not in the table of contents of a printed manual. In Info, the title is underlined with periods. @xref{subsubsection, , The `subsub' Commands}.@refill @item @@subsubsection @var{title} Begin a subsubsection within a subsection. In a printed manual, the subsubsection title is numbered and appears in the table of contents. In Info, the title is underlined with periods. @xref{subsubsection, , The `subsub' Commands}.@refill @item @@subtitle @var{title} In a printed manual, set a subtitle in a normal sized font flush to the right-hand side of the page. Not relevant to Info, which does not have title pages. @xref{title subtitle author, , @code{@@title} @code{@@subtitle} and @code{@@author} Commands}.@refill @item @@summarycontents Print a short table of contents. Not relevant to Info, which uses menus rather than tables of contents. A synonym for @code{@@shortcontents}. @xref{Contents, , Generating a Table of Contents}.@refill @item @@syncodeindex @var{from-index} @var{into-index} Merge the index named in the first argument into the index named in the second argument, printing the entries from the first index in @code{@@code} font. @xref{Combining Indices}.@refill @item @@synindex @var{from-index} @var{into-index} Merge the index named in the first argument into the index named in the second argument. Do not change the font of @var{from-index} entries. @xref{Combining Indices}.@refill @item @@t@{@var{text}@} 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}. @item @@table @var{formatting-command} Begin a two-column table, using @code{@@item} for each entry. Write each first column entry on the same line as @code{@@item}. First 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}}, and @ref{itemx, , @code{@@itemx}}.@refill @item @@TeX@{@} Insert the logo @TeX{}. @xref{TeX and copyright, , Inserting @TeX{} and @copyright{}}.@refill @item @@tex Enter @TeX{} completely. Pair with @code{@@end tex}. @xref{Raw Formatter Commands}. @item @@thischapter @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 @@tieaccent@{@var{cc}@} Generate a tie-after accent over the next two characters @var{cc}, as in `@tieaccent{oo}'. @xref{Inserting Accents}. @item @@tindex @var{entry} Add @var{entry} to the index of data types. @xref{Index Entries, , Defining the Entries of an Index}.@refill @item @@title @var{title} In a 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. Not relevant to Info, which does not have title pages. @xref{title subtitle author, , The @code{@@title} @code{@@subtitle} and @code{@@author} Commands}.@refill @item @@titlefont@{@var{text}@} In a printed manual, print @var{text} in a larger than normal font. Not relevant to Info, which does not have title pages. @xref{titlefont center sp, , The @code{@@titlefont} @code{@@center} and @code{@@sp} Commands}.@refill @item @@titlepage Indicate to Texinfo the beginning of the title page. Write command on a line of its own. Pair with @code{@@end titlepage}. Nothing between @code{@@titlepage} and @code{@@end titlepage} appears in Info. @xref{titlepage, , @code{@@titlepage}}.@refill @item @@today@{@} Insert the current date, in `1 Jan 1900' style. @xref{Custom Headings, , How to Make Your Own Headings}.@refill @item @@top @var{title} In a Texinfo file to be formatted with @code{makeinfo}, identify the topmost @code{@@node} line in the file, which must be written on the line immediately preceding the @code{@@top} command. Used for @code{makeinfo}'s node pointer insertion feature. The title is underlined with asterisks. Both the @code{@@node} line and the @code{@@top} line normally should be enclosed by @code{@@ifinfo} and @code{@@end 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 printed manual. In Info, the title is underlined with asterisks. @xref{unnumbered & appendix, , @code{@@unnumbered} and @code{@@appendix}}.@refill @item @@unnumberedsec @var{title} In a printed manual, begin a section that appears without section numbers of any kind. The title appears in the table of contents of a printed manual. In Info, the title is underlined with equal signs. @xref{unnumberedsec appendixsec heading, , Section Commands}.@refill @item @@unnumberedsubsec @var{title} In a printed manual, begin an unnumbered subsection within a chapter. The title appears in the table of contents of a printed manual. In Info, the title is underlined with hyphens. @xref{unnumberedsubsec appendixsubsec subheading, , @code{@@unnumberedsubsec} @code{@@appendixsubsec} @code{@@subheading}}.@refill @item @@unnumberedsubsubsec @var{title} In a printed manual, begin an unnumbered subsubsection within a chapter. The title appears in the table of contents of a printed manual. In Info, the title is underlined with periods. @xref{subsubsection, , The `subsub' Commands}.@refill @item @@uref@{@var{url}[, @var{displayed-text}][, @var{replacement}@} Define a cross reference to an external uniform resource locator for the World Wide Web. @xref{uref, , @code{@@uref}}.@refill @item @@url@{@var{url}@} Indicate 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}}. @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill @item @@var@{@var{metasyntactic-variable}@} Highlight a metasyntactic variable, which is something that stands for another piece of text. @xref{var, , Indicating Metasyntactic Variables}.@refill +@item @@verb@{@var{delim} @var{literal} @var{delim}@} +Output @var{literal}, delimited by the single character @var{delim}, +exactly as is (in the fixed-width font), including any whitespace or +Texinfo special characters. @xref{verb,,@code{verb}}. + +@item @@verbatim +Output the text of the environment exactly as is (in the fixed-width +font). Pair with @code{@@end verbatim}. @xref{verbatim,,@code{verbatim}}. + +@item @@verbatiminclude @var{filename} +Output the contents of @var{filename} exactly as is (in the fixed-width font). +@xref{verbatiminclude,,@code{verbatiminclude}}. + @item @@vindex @var{entry} Add @var{entry} to the index of variables. @xref{Index Entries, , Defining the Entries of an Index}.@refill @item @@vskip @var{amount} In a printed manual, insert whitespace so as to push text on the remainder of the page towards the bottom of the page. Used in formatting the copyright page with the argument @samp{0pt plus 1filll}. (Note spelling of @samp{filll}.) @code{@@vskip} may be used only in contexts ignored for Info. @xref{Copyright & Permissions, , The Copyright Page and Printed Permissions}.@refill @item @@vtable @var{formatting-command} Begin a two-column table, using @code{@@item} for each entry. Automatically enter each of the items in the first column into the index of variables. Pair with @code{@@end vtable}. The same as @code{@@table}, except for indexing. @xref{ftable vtable, , @code{@@ftable} and @code{@@vtable}}.@refill @item @@w@{@var{text}@} Prevent @var{text} from being split across two lines. Do not end a paragraph that uses @code{@@w} with an @code{@@refill} command. @xref{w, , @code{@@w}}.@refill @item @@xref@{@var{node-name}, [@var{entry}], [@var{topic-or-title}], [@var{info-file}], [@var{manual}]@} Make a reference that starts with `See' in a printed manual. Follow command with a punctuation mark. Only the first argument is mandatory. @xref{xref, , @code{@@xref}}.@refill @end table @node Tips @appendix Tips and Hints Here are some tips for writing Texinfo documentation:@refill @cindex Tips @cindex Usage tips @cindex Hints @itemize @bullet @item Write in the present tense, not in the past or the future. @item Write actively! For example, write ``We recommend that @dots{}'' rather than ``It is recommended that @dots{}''. @item Use 70 or 72 as your fill column. Longer lines are hard to read. @item Include a copyright notice and copying permissions. @end itemize @subsubheading Index, Index, Index! Write many index entries, in different ways. Readers like indices; they are helpful and convenient. Although it is easiest to write index entries as you write the body of the text, some people prefer to write entries afterwards. In either case, write an entry before the paragraph to which it applies. This way, an index entry points to the first page of a paragraph that is split across pages. 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. @item Write index entries only where a topic is discussed significantly. For example, it is not useful to index ``debugging information'' in a chapter on reporting bugs. Someone who wants to know about debugging information will certainly not find it in that chapter. @item Consistently capitalize the first word of every concept index entry, or else consistently use lower case. Terse entries often call for lower case; longer entries for capitalization. Whichever case convention you use, please use one or the other consistently! Mixing the two styles looks bad. @item Always capitalize or use upper case for those words in an index for 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 Write the indexing commands that refer to a whole section immediately after the section command, and write the indexing commands that refer to a paragraph before that paragraph. In the example that follows, a blank line comes after the index entry for ``Leaping'': @example @group @@section The Dog and the Fox @@cindex Jumping, in general @@cindex Leaping @@cindex Dog, lazy, jumped over @@cindex Lazy dog jumped over @@cindex Fox, jumps over dog @@cindex Quick fox jumps over dog The quick brown fox jumps over the lazy dog. @end group @end example @noindent (Note that the example shows entries for the same concept that are written in different ways---@samp{Lazy dog}, and @samp{Dog, lazy}---so readers can look up the concept in different ways.) @end itemize @subsubheading Blank Lines @itemize @bullet @item Insert a blank line between a sectioning command and the first following sentence or paragraph, or between the indexing commands associated with the sectioning command and the first following sentence or paragraph, as shown in the tip on indexing. Otherwise, a formatter may fold title and 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. @need 1000 For example, @example @group Types of fox: @@table @@samp @@item Quick Jump over lazy dogs. @end group @group @@item Brown Also jump over lazy dogs. @@end table @end group @group @@noindent On the other hand, @dots{} @end group @end example Insert blank lines before and after @code{@@itemize} @dots{} @code{@@end itemize} and @code{@@enumerate} @dots{} @code{@@end enumerate} in the same way. @end itemize @subsubheading Complete Phrases Complete phrases are easier to read than @dots{} @itemize @bullet @item Write entries in an itemized list as complete sentences; or at least, as complete phrases. Incomplete expressions @dots{} awkward @dots{} like this. @item Write the prefatory sentence or phrase for a multi-item list or table as a complete expression. Do not write ``You can set:''; instead, write ``You can set these variables:''. The former expression sounds cut off. @end itemize @subsubheading Editions, Dates and Versions Write the edition and version numbers and date in three places in every manual: @enumerate @item In the first @code{@@ifinfo} section, for people reading the Texinfo file. @item In the @code{@@titlepage} section, for people reading the printed manual. @item In the `Top' node, for people reading the Info file. @end enumerate @noindent Also, it helps to write a note before the first @code{@@ifinfo} section to explain what you are doing. @need 800 @noindent For example: @example @group @@c ===> NOTE! <== @@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 @group @@ifinfo @@c !!set edition, date, version 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} (@pxref{value Example, , @code{@@value} Example}). @subsubheading Definition Commands Definition commands are @code{@@deffn}, @code{@@defun}, @code{@@defmac}, and the like, and enable you to write descriptions in a uniform format.@refill @itemize @bullet @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. @item Use @code{@@table} @dots{} @code{@@end table} in an appendix that contains a summary of functions, not @code{@@deffn} or other definition commands. @end itemize @subsubheading Capitalization @itemize @bullet @item Capitalize ``Texinfo''; it is a name. Do not write the @samp{x} or @samp{i} in upper case. @item Capitalize ``Info''; it is a name. @item Write @TeX{} using the @code{@@TeX@{@}} command. Note the uppercase @samp{T} and @samp{X}. This command causes the formatters to typeset the name according to the wishes of Donald Knuth, who wrote @TeX{}. @end itemize @subsubheading Spaces Do not use spaces to format a Texinfo file, except inside of @code{@@example} @dots{} @code{@@end example} and similar commands. @need 700 For example, @TeX{} fills the following: @example @group @@kbd@{C-x v@} @@kbd@{M-x vc-next-action@} Perform the next logical operation on the version-controlled file corresponding to the current buffer. @end group @end example @need 950 @noindent so it looks like this: @iftex @quotation @kbd{C-x v} @kbd{M-x vc-next-action} Perform the next logical operation on the version-controlled file corresponding to the current buffer. @end quotation @end iftex @ifinfo @quotation `C-x v' `M-x vc-next-action' Perform the next logical operation on the version-controlled file corresponding to the current buffer. @end quotation @end ifinfo @noindent In this case, the text should be formatted with @code{@@table}, @code{@@item}, and @code{@@itemx}, to create a table. @subsubheading @@code, @@samp, @@var, and @samp{---} @itemize @bullet @item Use @code{@@code} around Lisp symbols, including command names. For example, @example The main function is @@code@{vc-next-action@}, @dots{} @end example @item Avoid putting letters such as @samp{s} immediately after an @samp{@@code}. Such letters look bad. @item Use @code{@@var} around meta-variables. Do not write angle brackets 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. @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 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: @example Evidently, @samp{au} is an abbreviation for ``author''. @end example @noindent since @samp{au} does @emph{not} serve as an abbreviation for @samp{author.} (with a period following the word). @subsubheading Introducing New Terms @itemize @bullet @item 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 rewritten so they are understandable. @quotation The major function assists you in checking in a file to your version control system and registering successive sets of changes to it as deltas. @end quotation @item Use the @code{@@dfn} command around a word being introduced, to indicate 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 @c !!! maybe include this in the tips on pxref @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 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 Absolutely never use @code{@@pxref} except in the special context for which it is designed: inside parentheses, with the closing parenthesis following immediately after the closing brace. One formatter automatically inserts closing punctuation and the other does not. This means that the output looks right both in printed output and in an Info file, but only when the command is used inside parentheses. @subsubheading Invoking from a Shell You can invoke programs such as Emacs, GCC, and @code{gawk} from a shell. The documentation for each program should contain a section that 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 +sections are all different, they are difficult for users to find. + +So, there is a convention to name such sections with a phrase beginning +with the word `Invoking', as in `Invoking Emacs'; this way, users can +find the section easily. -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 ANSI C Syntax When you use @code{@@example} to describe a C function's calling conventions, use the ANSI C syntax, like this:@refill @example void dld_init (char *@@var@{path@}); @end example @noindent And in the subsequent discussion, refer to the argument values by writing the same argument names, again highlighted with @code{@@var}.@refill @need 800 Avoid the obsolete style that looks like this:@refill @example #include <dld.h> dld_init (path) char *path; @end example Also, it is best to avoid writing @code{#include} above the declaration just to indicate that the function is declared in a header file. The practice may give the misimpression that the @code{#include} belongs near the declaration of the function. Either state explicitly which header file holds the declaration or, better yet, name the header file used for a group of functions at the beginning of the section that describes the functions.@refill @subsubheading Bad Examples Here are several examples of bad writing to avoid: 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 @code{@@dfn}@{check in@}. @end quotation In the following example, say, ``@dots{} makes a unified interface such as VC mode possible.'' @quotation SCCS, RCS and other version-control systems all perform similar functions in broadly similar ways (it is this resemblance which makes a unified control mode like this possible). @end quotation And in this example, you should specify what `it' refers to: @quotation If you are working with other people, it assists in coordinating everyone's changes so they do not step on each other. @end quotation @subsubheading And Finally @dots{} @itemize @bullet @item Pronounce @TeX{} as if the @samp{X} were a Greek `chi', as the last sound in the name `Bach'. But pronounce Texinfo as in `speck': ``teckinfo''. @item Write notes for yourself at the very end of a Texinfo file after the @code{@@bye}. None of the formatters process text after the @code{@@bye}; it is as if the text were within @code{@@ignore} @dots{} @code{@@end ignore}. @end itemize @node Sample Texinfo File @appendix A Sample Texinfo File @cindex Sample Texinfo file, no comments Here is a complete, short sample Texinfo file, without any commentary. You can see this file, with comments, in the first chapter. @xref{Short Sample, , A Short Sample Texinfo File}. @sp 1 @example \input texinfo @@c -*-texinfo-*- @@c %**start of header @@setfilename sample.info @@settitle Sample Document @@c %**end of header -@@setchapternewpage odd - @@ifinfo This is a short example of a complete Texinfo file. -Copyright 1990 Free Software Foundation, Inc. +Copyright (C) 2002 Free Software Foundation, Inc. @@end ifinfo @@titlepage -@@sp 10 @@comment The title is printed in a large font. -@@center @@titlefont@{Sample Title@} +@@title Sample Title @@c The following two commands start the copyright page. @@page @@vskip 0pt plus 1filll -Copyright @@copyright@{@} 1990 Free Software Foundation, Inc. +Copyright @@copyright@{@} 2002 Free Software Foundation, Inc. @@end titlepage -@@node Top, First Chapter, , (dir) -@@comment node-name, next, previous, up +@@c Output the table of the contents at the beginning. +@@contents + +@@ifnottex +@@node Top + +This is the top node of a sample document. +@@end ifnottex @@menu * First Chapter:: The first chapter is the only chapter in this sample. * Concept Index:: This index has two entries. @@end menu -@@node First Chapter, Concept Index, Top, Top -@@comment node-name, next, previous, up + +@@node First Chapter @@chapter First Chapter -@@cindex Sample index entry +@@cindex Chapter, first This is the contents of the first chapter. @@cindex Another sample index entry Here is a numbered list. @@enumerate @@item This is the first item. @@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 -manual. +The @@code@{makeinfo@} command transforms a Texinfo source file +such as this into an Info file or HTML; and @@TeX typesets it +for a printed manual. -@@node Concept Index, , First Chapter, Top -@@comment node-name, next, previous, up + +@@node Concept Index @@unnumbered Concept Index @@printindex cp -@@contents @@bye @end example -@node Sample Permissions -@appendix Sample Permissions -@cindex Permissions -@cindex Sample permissions -@cindex Copying permissions - -Texinfo files should contain sections that tell the readers that they -have the right to copy and distribute the Texinfo file, the Info file, -and the printed manual.@refill - -Also, if you are writing a manual about software, you should explain -that the software is free and either include the GNU General Public -License (GPL) or provide a reference to it. @xref{Distrib, , -Distribution, emacs, The GNU Emacs Manual}, for an example of the text -that could be used in the software ``Distribution'', ``General Public -License'', and ``NO WARRANTY'' sections of a document. @xref{Copying, -, Texinfo Copying Conditions}, for an example of a brief explanation -of how the copying conditions provide you with rights. @refill - -@menu -* Inserting Permissions:: How to put permissions in your document. -* ifinfo Permissions:: Sample @samp{ifinfo} copying permissions. -* Titlepage Permissions:: Sample Titlepage copying permissions. -@end menu - -@node Inserting Permissions, ifinfo Permissions, Sample Permissions, Sample Permissions -@ifinfo -@section Inserting Permissions -@end ifinfo - -In a Texinfo file, the first @code{@@ifinfo} section usually begins -with a line that says what the file documents. This is what a person -reading the unprocessed Texinfo file or using the advanced Info -command @kbd{g *} sees first. @inforef{Expert, Advanced Info -commands, info}, for more information. (A reader using the regular -Info commands usually starts reading at the first node and skips -this first section, which is not in a node.)@refill - -In the @code{@@ifinfo} section, the summary sentence is followed by a -copyright notice and then by the copying permission notice. One of -the copying permission paragraphs is enclosed in @code{@@ignore} and -@code{@@end ignore} commands. This paragraph states that the Texinfo -file can be processed through @TeX{} and printed, provided the printed -manual carries the proper copying permission notice. This paragraph -is not made part of the Info file since it is not relevant to the Info -file; but it is a mandatory part of the Texinfo file since it permits -people to process the Texinfo file in @TeX{} and print the -results.@refill - -In the printed manual, the Free Software Foundation copying permission -notice follows the copyright notice and publishing information and is -located within the region delineated by the @code{@@titlepage} and -@code{@@end titlepage} commands. The copying permission notice is exactly -the same as the notice in the @code{@@ifinfo} section except that the -paragraph enclosed in @code{@@ignore} and @code{@@end ignore} commands is -not part of the notice.@refill - -To make it simple to insert a permission notice into each section of -the Texinfo file, sample permission notices for each section are -reproduced in full below.@refill - -You may need to specify the correct name of a section mentioned in the -permission notice. For example, in @cite{The GDB Manual}, the name of -the section referring to the General Public License is called the ``GDB -General Public License'', but in the sample shown below, that section is -referred to generically as the ``GNU General Public License''. If the -Texinfo file does not carry a copy of the General Public License, leave -out the reference to it, but be sure to include the rest of the -sentence. - -@node ifinfo Permissions, Titlepage Permissions, Inserting Permissions, Sample Permissions -@comment node-name, next, previous, up -@section @samp{ifinfo} Copying Permissions -@cindex @samp{ifinfo} permissions - -In the @code{@@ifinfo} section of a Texinfo file, the standard Free -Software Foundation permission notice reads as follows:@refill - -@example -This file documents @dots{} - -Copyright 1999 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 preserved on all copies. - -@@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 -one except for the removal of this paragraph (this -paragraph not being relevant to the printed manual). - -@@end ignore -Permission is granted to copy and distribute modified -versions of this manual under the conditions for -verbatim copying, provided also that the sections -entitled ``Copying'' and ``GNU General Public License'' -are included exactly as in the original, and provided -that the entire resulting derived work is distributed -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, -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 -@comment node-name, next, previous, up -@section Titlepage Copying Permissions -@cindex Titlepage permissions - -In the @code{@@titlepage} section of a Texinfo file, the standard Free -Software Foundation copying permission notice follows the copyright -notice and publishing information. The standard phrasing is as -follows:@refill - -@example -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. - -Permission is granted to copy and distribute modified -versions of this manual under the conditions for -verbatim copying, provided also that the sections -entitled ``Copying'' and ``GNU General Public License'' -are included exactly as in the original, and provided -that the entire resulting derived work is distributed -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, -except that this permission notice may be stated in a -translation approved by the Free Software Foundation. -@end example - - @node Include Files @appendix Include Files @cindex Include files When @TeX{} or an Info formatting command sees an @code{@@include} command in a Texinfo file, it processes the contents of the file named by the command and incorporates them into the DVI or Info file being created. Index entries from the included file are incorporated into the indices of the output file.@refill Include files let you keep a single large document as a collection of -conveniently small parts.@refill +conveniently small parts. @menu * Using Include Files:: How to use the @code{@@include} command. * texinfo-multiple-files-update:: How to create and update nodes and menus when using included files. * Include File Requirements:: What @code{texinfo-multiple-files-update} expects. * Sample Include File:: A sample outer file with included files within it; and a sample included file. * Include Files Evolution:: How use of the @code{@@include} command has changed over time. @end menu @node Using Include Files, texinfo-multiple-files-update, Include Files, Include Files @section How to Use Include Files @findex include To include another file within a Texinfo file, write the @code{@@include} command at the beginning of a line and follow it on the same line by the name of a file to be included. For example:@refill @example @@include buffers.texi @end example An included file should simply be a segment of text that you expect to be included as is into the overall or @dfn{outer} Texinfo file; it should not contain the standard beginning and end parts of a Texinfo file. In particular, you should not start an included file with a line saying @samp{\input texinfo}; if you do, that phrase is inserted into the output file as is. Likewise, you should not end an included file with an @code{@@bye} command; nothing after @code{@@bye} is formatted.@refill In the past, you were required to write an @code{@@setfilename} line at the beginning of an included file, but no longer. Now, it does not matter whether you write such a line. If an @code{@@setfilename} line exists in an included file, it is ignored.@refill Conventionally, an included file begins with an @code{@@node} line that is followed by an @code{@@chapter} line. Each included file is one chapter. This makes it easy to use the regular node and menu creating and updating commands to create the node pointers and menus within the included file. However, the simple Emacs node and menu creating and updating commands do not work with multiple Texinfo files. Thus you cannot use these commands to fill in the `Next', `Previous', and `Up' pointers of the @code{@@node} line that begins the included file. Also, you cannot use the regular commands to create a master menu for the whole file. Either you must insert the menus and the `Next', `Previous', and `Up' pointers by hand, or you must use the GNU Emacs Texinfo mode command, @code{texinfo-multiple-files-update}, that is designed for @code{@@include} files.@refill @node texinfo-multiple-files-update, Include File Requirements, Using Include Files, Include Files @section @code{texinfo-multiple-files-update} @findex texinfo-multiple-files-update GNU Emacs Texinfo mode provides the @code{texinfo-multiple-files-update} command. This command creates or updates `Next', `Previous', and `Up' pointers of included files as well as those in the outer or overall Texinfo file, and it creates or updates a main menu in the outer file. Depending whether you call it with optional arguments, the command updates only the pointers in the first @code{@@node} line of the included files or all of them:@refill @table @kbd @item M-x texinfo-multiple-files-update Called without any arguments:@refill @itemize @minus @item Create or update the `Next', `Previous', and `Up' pointers of the first @code{@@node} line in each file included in an outer or overall Texinfo file.@refill @item Create or update the `Top' level node pointers of the outer or overall file.@refill @item Create or update a main menu in the outer file.@refill @end itemize @item C-u M-x texinfo-multiple-files-update Called with @kbd{C-u} as a prefix argument: @itemize @minus{} @item Create or update pointers in the first @code{@@node} line in each included file. @item Create or update the `Top' level node pointers of the outer file. @item Create and insert a master menu in the outer file. The master menu is made from all the menus in all the included files.@refill @end itemize @item C-u 8 M-x texinfo-multiple-files-update Called with a numeric prefix argument, such as @kbd{C-u 8}: @itemize @minus @item Create or update @strong{all} the `Next', `Previous', and `Up' pointers of all the included files.@refill @item Create or update @strong{all} the menus of all the included files.@refill @item Create or update the `Top' level node pointers of the outer or overall file.@refill @item And then create a master menu in the outer file. This is similar to invoking @code{texinfo-master-menu} with an argument when you are working with just one file.@refill @end itemize @end table Note the use of the prefix argument in interactive use: with a regular prefix argument, just @w{@kbd{C-u}}, the @code{texinfo-multiple-files-update} command inserts a master menu; with a numeric prefix argument, such as @kbd{C-u 8}, the command updates @strong{every} pointer and menu in @strong{all} the files and then inserts a master menu.@refill -@node Include File Requirements, Sample Include File, texinfo-multiple-files-update, Include Files + +@node Include File Requirements @section Include File Requirements @cindex Include file requirements @cindex Requirements for include files If you plan to use the @code{texinfo-multiple-files-update} command, the outer Texinfo file that lists included files within it should contain nothing but the beginning and end parts of a Texinfo file, and a number of @code{@@include} commands listing the included files. It should not even include indices, which should be listed in an included file of their own.@refill Moreover, each of the included files must contain exactly one highest level node (conventionally, @code{@@chapter} or equivalent), and this node must be the first node in the included file. Furthermore, each of these highest level nodes in each included file must be at the same hierarchical level in the file structure. Usually, each is an @code{@@chapter}, an @code{@@appendix}, or an @code{@@unnumbered} node. Thus, normally, each included file contains one, and only one, chapter or equivalent-level node.@refill The outer file should contain only @emph{one} node, the `Top' node. It should @emph{not} contain any nodes besides the single `Top' node. The @code{texinfo-multiple-files-update} command will not process them.@refill @node Sample Include File, Include Files Evolution, Include File Requirements, Include Files @section Sample File with @code{@@include} @cindex Sample @code{@@include} file @cindex Include file sample @cindex @code{@@include} file sample Here is an example of a complete outer Texinfo file with @code{@@include} files within it before running @code{texinfo-multiple-files-update}, which would insert a main or master menu:@refill @example @group \input texinfo @@c -*-texinfo-*- @c %**start of header @@setfilename include-example.info @@settitle Include Example @c %**end of header @end group @group @@setchapternewpage odd @@titlepage @@sp 12 @@center @@titlefont@{Include Example@} @@sp 2 @@center by Whom Ever @end group @group @@page @@vskip 0pt plus 1filll -Copyright @@copyright@{@} 1999 Free Software Foundation, Inc. +Copyright @@copyright@{@} 2002 Free Software Foundation, Inc. @@end titlepage @end group @group @@ifinfo @@node Top, First, , (dir) @@top Master Menu @@end ifinfo @end group @group @@include foo.texinfo @@include bar.texinfo @@include concept-index.texinfo @end group @group @@summarycontents @@contents @@bye @end group @end example An included file, such as @file{foo.texinfo}, might look like this:@refill @example @group @@node First, Second, , Top @@chapter First Chapter Contents of first chapter @dots{} @end group @end example The full contents of @file{concept-index.texinfo} might be as simple as this: @example @group @@node Concept Index @@unnumbered Concept Index @@printindex cp @end group @end example The outer Texinfo source file for @cite{The GNU Emacs Lisp Reference 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 -@comment node-name, next, previous, up + +@node Include Files Evolution @section Evolution of Include Files When Info was first created, it was customary to create many small Info files on one subject. Each Info file was formatted from its own Texinfo source file. This custom meant that Emacs did not need to make a large buffer to hold the whole of a large Info file when someone wanted information; instead, Emacs allocated just enough memory for the small Info file that contained the particular 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, , @code{@@xref} with Four and Five Arguments}.)@refill Include files were designed primarily as a way to create a single, large printed manual out of several smaller Info files. In a printed manual, all the references were within the same document, so @TeX{} could automatically determine the references' page numbers. The Info formatting commands used include files only for creating joint indices; each of the individual Texinfo files had to be formatted for Info individually. (Each, therefore, required its own @code{@@setfilename} line.)@refill However, because large Info files are now split automatically, it is no longer necessary to keep them small.@refill Nowadays, multiple Texinfo files are used mostly for large documents, such as @cite{The GNU Emacs Lisp Reference Manual}, and for projects in which several different people write different sections of a document simultaneously.@refill In addition, the Info formatting commands have been extended to work with the @code{@@include} command so as to create a single large Info file that is split into smaller files if necessary. This means that you can write menus and cross references without naming the different Texinfo files.@refill @node Headings @appendix Page Headings @cindex Headings @cindex Footings @cindex Page numbering @cindex Page headings @cindex Formatting headings and footings Most printed manuals contain headings along the top of every page except the title and copyright pages. Some manuals also contain footings. (Headings and footings have no meaning to Info, which is not paginated.)@refill @menu * Headings Introduced:: Conventions for using page headings. * Heading Format:: Standard page heading formats. * Heading Choice:: How to specify the type of page heading. * Custom Headings:: How to create your own headings and footings. @end menu @node Headings Introduced, Heading Format, Headings, Headings @ifinfo @heading Headings Introduced @end ifinfo Texinfo provides standard page heading formats for manuals that are printed on one side of each sheet of paper and for manuals that are printed on both sides of the paper. Typically, you will use these formats, but you can specify your own format if you wish.@refill In addition, you can specify whether chapters should begin on a new page, or merely continue the same page as the previous chapter; and if chapters begin on new pages, you can specify whether they must be odd-numbered pages.@refill By convention, a book is printed on both sides of each sheet of paper. When you open a book, the right-hand page is odd-numbered, and chapters begin on right-hand pages---a preceding left-hand page is left blank if necessary. Reports, however, are often printed on just one side of paper, and chapters begin on a fresh page immediately following the end of the preceding chapter. In short or informal reports, chapters often do not begin on a new page at all, but are separated from the preceding text by a small amount of whitespace.@refill The @code{@@setchapternewpage} command controls whether chapters begin on new pages, and whether one of the standard heading formats is used. In addition, Texinfo has several heading and footing commands that you can use to generate your own heading and footing formats.@refill In Texinfo, headings and footings are single lines at the tops and bottoms of pages; you cannot create multiline headings or footings. Each header or footer line is divided into three parts: a left part, a middle part, and a right part. Any part, or a whole line, may be left blank. Text for the left part of a header or footer line is set flushleft; text for the middle part is centered; and, text for the right part is set flushright.@refill @node Heading Format, Heading Choice, Headings Introduced, Headings @comment node-name, next, previous, up @section Standard Heading Formats Texinfo provides two standard heading formats, one for manuals printed on one side of each sheet of paper, and the other for manuals printed on both sides of the paper. By default, nothing is specified for the footing of a Texinfo file, so the footing remains blank.@refill The standard format for single-sided printing consists of a header line in which the left-hand part contains the name of the chapter, the central part is blank, and the right-hand part contains the page number.@refill @need 950 A single-sided page looks like this: @example @group _______________________ | | | chapter page number | | | | Start of text ... | | ... | | | @end group @end example The standard format for two-sided printing depends on whether the page number is even or odd. By convention, even-numbered pages are on the left- and odd-numbered pages are on the right. (@TeX{} will adjust the widths of the left- and right-hand margins. Usually, widths are correct, but during double-sided printing, it is wise to check that pages will bind properly---sometimes a printer will produce output in which the even-numbered pages have a larger right-hand margin than the odd-numbered pages.)@refill In the standard double-sided format, the left part of the left-hand (even-numbered) page contains the page number, the central part is blank, and the right part contains the title (specified by the @code{@@settitle} command). The left part of the right-hand (odd-numbered) page contains the name of the chapter, the central part is blank, and the right part contains the page number.@refill @need 750 Two pages, side by side as in an open book, look like this:@refill @example @group _______________________ _______________________ | | | | | page number title | | chapter page number | | | | | | Start of text ... | | More text ... | | ... | | ... | | | | | @end group @end example @noindent The chapter name is preceded by the word ``Chapter'', the chapter number and a colon. This makes it easier to keep track of where you are in the manual.@refill @node Heading Choice, Custom Headings, Heading Format, Headings @comment node-name, next, previous, up @section Specifying the Type of Heading @TeX{} does not begin to generate page headings for a standard Texinfo file until it reaches the @code{@@end titlepage} command. Thus, the title and copyright pages are not numbered. The @code{@@end titlepage} command causes @TeX{} to begin to generate page headings according to a standard format specified by the @code{@@setchapternewpage} command that precedes the @code{@@titlepage} section.@refill @need 1000 There are four possibilities:@refill @table @asis @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} Specify the single-sided heading format, with chapters on new pages.@refill @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} 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 @comment node-name, next, previous, up @section How to Make Your Own Headings You can use the standard headings provided with Texinfo or specify your own. By default, Texinfo has no footers, so if you specify them, the available page size for the main text will be slightly reduced. Texinfo provides six commands for specifying headings and footings: @itemize @bullet @item @code{@@everyheading} @code{@@everyfooting} generate page headers and footers that are the same for both even- and odd-numbered pages. @item @code{@@evenheading} and @code{@@evenfooting} command generate headers and footers for even-numbered (left-hand) pages. @item @code{@@oddheading} and @code{@@oddfooting} generate headers and footers for odd-numbered (right-hand) pages. @end itemize Write custom heading specifications in the Texinfo file immediately after the @code{@@end titlepage} command. Enclose your specifications between @code{@@iftex} and @code{@@end iftex} commands since the @code{texinfo-format-buffer} command may not recognize them. Also, you must cancel the predefined heading commands with the @code{@@headings off} command before defining your own specifications.@refill @need 1000 Here is how to tell @TeX{} to place the chapter name at the left, the page number in the center, and the date at the right of every header for both even- and odd-numbered pages:@refill @example @group @@iftex @@headings off @@everyheading @@thischapter @@| @@thispage @@| @@today@{@} @@end iftex @end group @end example @noindent You need to divide the left part from the central part and the central part from the right part by inserting @samp{@@|} between parts. Otherwise, the specification command will not be able to tell where the text for one part ends and the next part begins.@refill Each part can contain text or @@-commands. The text is printed as if the part were within an ordinary paragraph in the body of the page. The @@-commands replace themselves with the page number, date, chapter name, or whatever.@refill @need 950 Here are the six heading and footing commands:@refill @findex everyheading @findex everyfooting @table @code @item @@everyheading @var{left} @@| @var{center} @@| @var{right} @itemx @@everyfooting @var{left} @@| @var{center} @@| @var{right} The `every' commands specify the format for both even- and odd-numbered pages. These commands are for documents that are printed on one side of each sheet of paper, or for documents in which you want symmetrical headers or footers.@refill @findex evenheading @findex evenfooting @findex oddheading @findex oddfooting @item @@evenheading @var{left} @@| @var{center} @@| @var{right} @itemx @@oddheading @var{left} @@| @var{center} @@| @var{right} @itemx @@evenfooting @var{left} @@| @var{center} @@| @var{right} @itemx @@oddfooting @var{left} @@| @var{center} @@| @var{right} The `even' and `odd' commands specify the format for even-numbered pages and odd-numbered pages. These commands are for books and manuals that are printed on both sides of each sheet of paper. @end table Use the @samp{@@this@dots{}} series of @@-commands to provide the names of chapters and sections and the page number. You can use the @samp{@@this@dots{}} commands in the left, center, or right portions of headers and footers, or anywhere else in a Texinfo file so long as they are between @code{@@iftex} and @code{@@end iftex} commands.@refill @need 1000 Here are the @samp{@@this@dots{}} commands:@refill @table @code @findex thispage @item @@thispage Expands to the current page number.@refill @c !!! Karl Berry says that `thissection' can fail on page breaks. @ignore @item @@thissection Expands to the name of the current section.@refill @end ignore @findex thischaptername @item @@thischaptername Expands to the name of the current chapter.@refill @findex thischapter @item @@thischapter Expands to the number and name of the current chapter, in the format `Chapter 1: Title'.@refill @findex thistitle @item @@thistitle Expands to the name of the document, as specified by the @code{@@settitle} command.@refill @findex 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 @emph{not} provide the name of the current Texinfo source file unless it is an @code{@@include} file. (@xref{Include Files}, for more information about @code{@@include} files.)@refill @end table @noindent You can also use the @code{@@today@{@}} command, which expands to the current date, in `1 Jan 1900' format.@refill @findex today Other @@-commands and text are printed in a header or footer just as if they were in the body of a page. It is useful to incorporate text, particularly when you are writing drafts:@refill @example @group @@iftex @@headings off @@everyheading @@emph@{Draft!@} @@| @@thispage @@| @@thischapter @@everyfooting @@| @@| Version: 0.27: @@today@{@} @@end iftex @end group @end example Beware of overlong titles: they may overlap another part of the header or footer and blot it out.@refill @node Catching Mistakes @appendix Formatting Mistakes @cindex Structure, catching mistakes in @cindex Nodes, catching mistakes @cindex Catching mistakes @cindex Correcting mistakes @cindex Mistakes, catching @cindex Problems, catching @cindex Debugging the Texinfo structure Besides mistakes in the content of your documentation, there are two kinds of mistake you can make with Texinfo: you can make mistakes with @@-commands, and you can make mistakes with the structure of the nodes and chapters.@refill Emacs has two tools for catching the @@-command mistakes and two for catching structuring mistakes.@refill For finding problems with @@-commands, you can run @TeX{} or a region formatting command on the region that has a problem; indeed, you can run these commands on each region as you write it.@refill For finding problems with the structure of nodes and chapters, you can use @kbd{C-c C-s} (@code{texinfo-show-structure}) and the related @code{occur} command and you can use the @kbd{M-x Info-validate} command.@refill @menu * makeinfo Preferred:: @code{makeinfo} finds errors. * Debugging with Info:: How to catch errors with Info formatting. * Debugging with TeX:: How to catch errors with @TeX{} formatting. * Using texinfo-show-structure:: How to use @code{texinfo-show-structure}. * Using occur:: How to list all lines containing a pattern. * Running Info-Validate:: How to find badly referenced nodes. @end menu @node makeinfo Preferred, Debugging with Info, Catching Mistakes, Catching Mistakes @ifinfo @heading @code{makeinfo} Find Errors @end ifinfo The @code{makeinfo} program does an excellent job of catching errors and reporting them---far better than @code{texinfo-format-region} or @code{texinfo-format-buffer}. In addition, the various functions for automatically creating and updating node pointers and menus remove many opportunities for human error.@refill If you can, use the updating commands to create and insert pointers and menus. These prevent many errors. Then use @code{makeinfo} (or its Texinfo mode manifestations, @code{makeinfo-region} and @code{makeinfo-buffer}) to format your file and check for other errors. This is the best way to work with Texinfo. But if you cannot use @code{makeinfo}, or your problem is very puzzling, then you may want to use the tools described in this appendix.@refill @node Debugging with Info, Debugging with TeX, makeinfo Preferred, Catching Mistakes @comment node-name, next, previous, up @section Catching Errors with Info Formatting @cindex Catching errors with Info formatting @cindex Debugging with Info formatting After you have written part of a Texinfo file, you can use the @code{texinfo-format-region} or the @code{makeinfo-region} command to see whether the region formats properly.@refill Most likely, however, you are reading this section because for some reason you cannot use the @code{makeinfo-region} command; therefore, the rest of this section presumes that you are using @code{texinfo-format-region}.@refill If you have made a mistake with an @@-command, @code{texinfo-format-region} will stop processing at or after the error and display an error message. To see where in the buffer the error occurred, switch to the @samp{*Info Region*} buffer; the cursor will be in a position that is after the location of the error. Also, the text will not be formatted after the place where the error occurred (or more precisely, where it was detected).@refill For example, if you accidentally end a menu with the command @code{@@end menus} with an `s' on the end, instead of with @code{@@end menu}, you will see an error message that says:@refill @example @@end menus is not handled by texinfo @end example @noindent The cursor will stop at the point in the buffer where the error occurs, or not long after it. The buffer will look like this:@refill @example @group ---------- Buffer: *Info Region* ---------- * Menu: * Using texinfo-show-structure:: How to use `texinfo-show-structure' to catch mistakes. * Running Info-Validate:: How to check for unreferenced nodes. @@end menus @point{} ---------- Buffer: *Info Region* ---------- @end group @end example The @code{texinfo-format-region} command sometimes provides slightly odd error messages. For example, the following cross reference fails to format:@refill @example (@@xref@{Catching Mistakes, for more info.) @end example @noindent In this case, @code{texinfo-format-region} detects the missing closing brace but displays a message that says @samp{Unbalanced parentheses} rather than @samp{Unbalanced braces}. This is because the formatting command looks for mismatches between braces as if they were parentheses.@refill Sometimes @code{texinfo-format-region} fails to detect mistakes. For example, in the following, the closing brace is swapped with the closing parenthesis:@refill @example (@@xref@{Catching Mistakes), for more info.@} @end example @noindent Formatting produces: @example (*Note for more info.: Catching Mistakes) @end example The only way for you to detect this error is to realize that the reference should have looked like this:@refill @example (*Note Catching Mistakes::, for more info.) @end example Incidentally, if you are reading this node in Info and type @kbd{f @key{RET}} (@code{Info-follow-reference}), you will generate an error message that says: @example No such node: "Catching Mistakes) The only way @dots{} @end example @noindent This is because Info perceives the example of the error as the first cross reference in this node and if you type a @key{RET} immediately after typing the Info @kbd{f} command, Info will attempt to go to the referenced node. If you type @kbd{f catch @key{TAB} @key{RET}}, Info will complete the node name of the correctly written example and take you to the `Catching Mistakes' node. (If you try this, you can return from the `Catching Mistakes' node by typing @kbd{l} (@code{Info-last}).) @c !!! section on using Elisp debugger ignored. @ignore Sometimes @code{texinfo-format-region} will stop long after the original error; this is because it does not discover the problem until then. In this case, you will need to backtrack.@refill @c menu @c * Using the Emacs Lisp Debugger:: How to use the Emacs Lisp debugger. @c end menu @c node Using the Emacs Lisp Debugger @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 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 @code{texinfo-format-region} function the problem occurred. You can turn on the debugger with the command:@refill @example M-x set-variable @key{RET} debug-on-error @key{RET} t @key{RET} @end example @noindent and turn it off with @example M-x set-variable @key{RET} debug-on-error @key{RET} nil @key{RET} @end example Often, when you are using the debugger, it is easier to follow what is going on if you use the Emacs Lisp files that are not byte-compiled. The byte-compiled sources send octal numbers to the debugger that may look mysterious. To use the uncompiled source files, load @file{texinfmt.el} and @file{texinfo.el} with the @kbd{M-x load-file} command.@refill The debugger will not catch an error if @code{texinfo-format-region} does not detect one. In the example shown above, @code{texinfo-format-region} did not find the error when the whole list was formatted, but only when part of the list was formatted. When @code{texinfo-format-region} did not find an error, the debugger did not find one either. @refill However, when @code{texinfo-format-region} did report an error, it invoked the debugger. This is the backtrace it produced:@refill @example ---------- Buffer: *Backtrace* ---------- Signalling: (search-failed "[@},]") re-search-forward("[@},]") (while ...) (let ...) texinfo-format-parse-args() (let ...) texinfo-format-xref() funcall(texinfo-format-xref) (if ...) (let ...) (if ...) (while ...) texinfo-format-scan() (save-excursion ...) (let ...) texinfo-format-region(103370 103631) * call-interactively(texinfo-format-region) ---------- Buffer: *Backtrace* ---------- @end example The backtrace is read from the bottom up. @code{texinfo-format-region} was called interactively; and it, in turn, called various functions, including @code{texinfo-format-scan}, @code{texinfo-format-xref} and @code{texinfo-format-parse-args}. Inside the function @code{texinfo-format-parse-args}, the function @code{re-search-forward} was called; it was this function that could not find the missing right-hand brace.@refill @xref{Lisp Debug, , Debugging Emacs Lisp, emacs, The GNU Emacs Manual}, for more information.@refill @end ignore @node Debugging with TeX, Using texinfo-show-structure, Debugging with Info, Catching Mistakes @comment node-name, next, previous, up @section Catching Errors with @TeX{} Formatting @cindex Catching errors with @TeX{} formatting @cindex Debugging with @TeX{} formatting You can also catch mistakes when you format a file with @TeX{}.@refill Usually, you will want to do this after you have run @code{texinfo-format-buffer} (or, better, @code{makeinfo-buffer}) on the same file, because @code{texinfo-format-buffer} sometimes displays error messages that make more sense than @TeX{}. (@xref{Debugging with Info}, for more information.)@refill For example, @TeX{} was run on a Texinfo file, part of which is shown here:@refill @example ---------- Buffer: texinfo.texi ---------- name of the Texinfo file as an extension. The @@samp@{??@} are `wildcards' that cause the shell to substitute all the raw index files. (@@xref@{sorting indices, for more information about sorting indices.)@@refill ---------- Buffer: texinfo.texi ---------- @end example @noindent (The cross reference lacks a closing brace.) @TeX{} produced the following output, after which it stopped:@refill @example ---------- Buffer: *tex-shell* ---------- Runaway argument? @{sorting indices, for more information about sorting indices.) @@refill @@ETC. ! Paragraph ended before @@xref was complete. <to be read again> @@par l.27 ? ---------- Buffer: *tex-shell* ---------- @end example In this case, @TeX{} produced an accurate and understandable error message: @example Paragraph ended before @@xref was complete. @end example @noindent @samp{@@par} is an internal @TeX{} command of no relevance to Texinfo. @samp{l.27} means that @TeX{} detected the problem on line 27 of the Texinfo file. The @samp{?} is the prompt @TeX{} uses in this circumstance.@refill Unfortunately, @TeX{} is not always so helpful, and sometimes you must truly be a Sherlock Holmes to discover what went wrong.@refill In any case, if you run into a problem like this, you can do one of three things.@refill @enumerate @item You can tell @TeX{} to continue running and ignore just this error by typing @key{RET} at the @samp{?} prompt.@refill @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 This is often the best thing to do. However, beware: the one error may produce a cascade of additional error messages as its consequences are felt through the rest of the file. To stop @TeX{} when it is producing such an avalanche of error messages, type @kbd{C-c} (or @kbd{C-c C-c}, if you are running a shell inside Emacs). @item You can tell @TeX{} to stop this run by typing @kbd{x @key{RET}} at the @samp{?} prompt.@refill @end enumerate If you are running @TeX{} inside Emacs, you need to switch to the shell buffer and line at which @TeX{} offers the @samp{?} prompt. Sometimes @TeX{} will format a file without producing error messages even though there is a problem. This usually occurs if a command is not ended but @TeX{} is able to continue processing anyhow. For example, if you fail to end an itemized list with the @code{@@end itemize} command, @TeX{} will write a DVI file that you can print out. The only error message that @TeX{} will give you is the somewhat mysterious comment that@refill @example (@@end occurred inside a group at level 1) @end example @noindent However, if you print the DVI file, you will find that the text of the file that follows the itemized list is entirely indented as if it were part of the last item in the itemized list. The error message is the way @TeX{} says that it expected to find an @code{@@end} command somewhere in the file; but that it could not determine where it was needed.@refill Another source of notoriously hard-to-find errors is a missing @code{@@end group} command. If you ever are stumped by incomprehensible errors, look for a missing @code{@@end group} command first.@refill If the Texinfo file lacks header lines, @TeX{} may stop in the 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 3.14159 (Web2c 7.0) (test.texinfo [1]) * @end example @noindent In this case, simply type @kbd{\end @key{RET}} after the asterisk. Then write the header lines in the Texinfo file and run the @TeX{} command again. (Note the use of the backslash, @samp{\}. @TeX{} uses @samp{\} instead of @samp{@@}; and in this circumstance, you are working directly with @TeX{}, not with Texinfo.)@refill @node Using texinfo-show-structure, Using occur, Debugging with TeX, Catching Mistakes @comment node-name, next, previous, up @section Using @code{texinfo-show-structure} @cindex Showing the structure of a file @findex texinfo-show-structure It is not always easy to keep track of the nodes, chapters, sections, and subsections of a Texinfo file. This is especially true if you are revising or adding to a Texinfo file that someone else has written.@refill 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), 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 The lines are displayed in a buffer called the @samp{*Occur*} buffer, indented by hierarchical level. For example, here is a part of what was produced by running @code{texinfo-show-structure} on this manual:@refill @example @group Lines matching "^@@\\(chapter \\|sect\\|subs\\|subh\\| unnum\\|major\\|chapheading \\|heading \\|appendix\\)" in buffer texinfo.texi. @dots{} 4177:@@chapter Nodes 4198: @@heading Two Paths 4231: @@section Node and Menu Illustration 4337: @@section The @@code@{@@@@node@} Command 4393: @@subheading Choosing Node and Pointer Names 4417: @@subsection How to Write an @@code@{@@@@node@} Line 4469: @@subsection @@code@{@@@@node@} Line Tips @dots{} @end group @end example This says that lines 4337, 4393, and 4417 of @file{texinfo.texi} begin with the @code{@@section}, @code{@@subheading}, and @code{@@subsection} commands respectively. If you move your cursor into the @samp{*Occur*} window, you can position the cursor over one of the lines and use the @kbd{C-c C-c} command (@code{occur-mode-goto-occurrence}), to jump to the corresponding spot in the Texinfo file. @xref{Other Repeating Search, , Using Occur, emacs, The GNU Emacs Manual}, for more information about @code{occur-mode-goto-occurrence}.@refill The first line in the @samp{*Occur*} window describes the @dfn{regular expression} specified by @var{texinfo-heading-pattern}. This regular expression is the pattern that @code{texinfo-show-structure} looks for. @xref{Regexps, , Using Regular Expressions, emacs, The GNU Emacs Manual}, for more information.@refill When you invoke the @code{texinfo-show-structure} command, Emacs will display the structure of the whole buffer. If you want to see the structure of just a part of the buffer, of one chapter, for example, use the @kbd{C-x n n} (@code{narrow-to-region}) command to mark the region. (@xref{Narrowing, , , emacs, The GNU Emacs Manual}.) This is how the example used above was generated. (To see the whole buffer again, use @kbd{C-x n w} (@code{widen}).)@refill If you call @code{texinfo-show-structure} with a prefix argument by typing @w{@kbd{C-u C-c C-s}}, it will list lines beginning with @code{@@node} as well as the lines beginning with the @@-sign commands for @code{@@chapter}, @code{@@section}, and the like.@refill You can remind yourself of the structure of a Texinfo file by looking at the list in the @samp{*Occur*} window; and if you have mis-named a node 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 @section Using @code{occur} @cindex Occurrences, listing with @code{@@occur} @findex occur Sometimes the @code{texinfo-show-structure} command produces too much information. Perhaps you want to remind yourself of the overall structure of a Texinfo file, and are overwhelmed by the detailed list produced by @code{texinfo-show-structure}. In this case, you can use the @code{occur} command directly. To do this, type@refill @example @kbd{M-x occur} @end example @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 the current location of the cursor in the buffer to the end of the buffer. If you want to run @code{occur} on the whole buffer, place the cursor at the beginning of the buffer.@refill For example, to see all the lines that contain the word @samp{@@chapter} in them, just type @samp{@@chapter}. This will produce a list of the chapters. It will also list all the sentences with @samp{@@chapter} in the middle of the line.@refill If you want to see only those lines that start with the word @samp{@@chapter}, type @samp{^@@chapter} when prompted by @code{occur}. If you want to see all the lines that end with a word or phrase, end the last word with a @samp{$}; for example, @samp{catching mistakes$}. This can be helpful when you want to see all the nodes that are part of the same chapter or section and 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 @comment node-name, next, previous, up @section Finding Badly Referenced Nodes @findex Info-validate @cindex Nodes, checking for badly referenced @cindex Checking for badly referenced nodes @cindex Looking for badly referenced nodes @cindex Finding 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 node. This command checks that every node pointer points to an existing node. The @code{Info-validate} command works only on Info files, not on Texinfo files.@refill The @code{makeinfo} program validates pointers automatically, so you do not need to use the @code{Info-validate} command if you are using @code{makeinfo}. You only may need to use @code{Info-validate} if you are unable to run @code{makeinfo} and instead must create an Info file using @code{texinfo-format-region} or @code{texinfo-format-buffer}, or if you write an Info file from scratch.@refill @menu * Using Info-validate:: How to run @code{Info-validate}. * Unsplit:: How to create an unsplit file. * Tagifying:: How to tagify a file. * Splitting:: How to split a file manually. @end menu @node Using Info-validate, Unsplit, Running Info-Validate, Running Info-Validate @subsection Running @code{Info-validate} @cindex Running @code{Info-validate} @cindex Info validating a large file @cindex Validating a large file To use @code{Info-validate}, visit the Info file you wish to check and type:@refill @example M-x Info-validate @end example @noindent Note that the @code{Info-validate} command requires an upper case `I'. You may also need to create a tag table before running @code{Info-validate}. @xref{Tagifying}. If your file is valid, you will receive a message that says ``File appears valid''. However, if you have a pointer that does not point to a node, error messages will be displayed in a buffer called @samp{*problems in info file*}.@refill For example, @code{Info-validate} was run on a test file that contained only the first node of this manual. One of the messages said:@refill @example In node "Overview", invalid Next: Texinfo Mode @end example @noindent This meant that the node called @samp{Overview} had a `Next' pointer that did not point to anything (which was true in this case, since the test file had only one node in it).@refill Now suppose we add a node named @samp{Texinfo Mode} to our test case but we do not specify a `Previous' for this node. Then we will get the following error message:@refill @example In node "Texinfo Mode", should have Previous: Overview @end example @noindent This is because every `Next' pointer should be matched by a `Previous' (in the node where the `Next' points) which points back.@refill @code{Info-validate} also checks that all menu entries and cross references point to actual nodes.@refill @code{Info-validate} requires a tag table and does not work with files that have been split. (The @code{texinfo-format-buffer} command automatically splits large files.) In order to use @code{Info-validate} on a large file, you must run @code{texinfo-format-buffer} with an argument so that it does not split the Info file; and you must create a tag table for the unsplit file. @node Unsplit, Tagifying, Using Info-validate, Running Info-Validate @comment node-name, next, previous, up @subsection Creating an Unsplit File @cindex Creating an unsplit file @cindex Unsplit file creation You can run @code{Info-validate} only on a single Info file that has a tag table. The command will not work on the indirect subfiles that are generated when a master file is split. If you have a large file (longer than 70,000 bytes or so), you need to run the @code{texinfo-format-buffer} or @code{makeinfo-buffer} command in such a way that it does not create indirect subfiles. You will also need to create a tag table for the Info file. After you have done this, you can run @code{Info-validate} and look for badly referenced nodes.@refill The first step is to create an unsplit Info file. To prevent @code{texinfo-format-buffer} from splitting a Texinfo file into smaller Info files, give a prefix to the @kbd{M-x texinfo-format-buffer} command:@refill @example C-u M-x texinfo-format-buffer @end example @noindent or else @example C-u C-c C-e C-b @end example @noindent When you do this, Texinfo will not split the file and will not create a tag table for it. @refill @cindex Making a tag table manually @cindex Tag table, making manually @node Tagifying, Splitting, Unsplit, Running Info-Validate @subsection Tagifying a File After creating an unsplit Info file, you must create a tag table for it. Visit the Info file you wish to tagify and type:@refill @example M-x Info-tagify @end example @noindent (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 @example M-x Info-validate @end example @noindent (Note the upper case @samp{I} in @code{Info-validate}.) In brief, the steps are:@refill @example @group C-u M-x texinfo-format-buffer M-x Info-tagify M-x Info-validate @end group @end example After you have validated the node structure, you can rerun @code{texinfo-format-buffer} in the normal way so it will construct a 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 @comment node-name, next, previous, up @subsection Splitting a File Manually @cindex Splitting an Info file manually @cindex Info file, splitting manually You should split a large file or else let the @code{texinfo-format-buffer} or @code{makeinfo-buffer} command do it for you automatically. (Generally you will let one of the formatting commands do this job for you. @xref{Creating an Info File}.)@refill The split-off files are called the indirect subfiles.@refill Info files are split to save memory. With smaller files, Emacs does not have make such a large buffer to hold the information.@refill If an Info file has more than 30 nodes, you should also make a tag table for it. @xref{Using Info-validate}, for information about creating a tag table. (Again, tag tables are usually created automatically by the formatting command; you only need to create a tag table yourself if you are doing the job manually. Most likely, you will do this for a large, unsplit file on which you have run @code{Info-validate}.)@refill @c Info-split is autoloaded in `loaddefs.el' in Emacs 18.51 @ignore Before running @code{Info-split}, you need to load the @code{info} library into Emacs by giving the command @kbd{M-x load-library @key{RET} info @key{RET}}. @end ignore Visit the Info file you wish to tagify and split and type the two commands:@refill @example M-x Info-tagify M-x Info-split @end example @noindent (Note that the @samp{I} in @samp{Info} is upper case.)@refill When you use the @code{Info-split} command, the buffer is modified into a (small) Info file which lists the indirect subfiles. This file should be saved in place of the original visited file. The indirect subfiles are written in the same directory the original file is in, with names generated by appending @samp{-} and a number to the original file name.@refill The primary file still functions as an Info file, but it contains just the tag table and a directory of subfiles.@refill @node Refilling Paragraphs @appendix Refilling Paragraphs @cindex Refilling paragraphs @cindex Filling paragraphs @cindex Paragraphs, filling @findex refill The @code{@@refill} command refills and, optionally, indents the first line of a paragraph.@footnote{Perhaps the command should have been called the @code{@@refillandindent} command, but @code{@@refill} is shorter and the name was chosen before indenting was possible.} The @code{@@refill} command is no longer important, but we describe it here because you once needed it. You will see it in many old Texinfo files.@refill Without refilling, paragraphs containing long @@-constructs may look bad after formatting because the formatter removes @@-commands and shortens some lines more than others. In the past, neither the @code{texinfo-format-region} command nor the @code{texinfo-format-buffer} command refilled paragraphs automatically. The @code{@@refill} command had to be written at the end of every paragraph to cause these formatters to fill them. (Both @TeX{} and @code{makeinfo} have always refilled paragraphs automatically.) Now, all the Info formatters automatically fill and indent those paragraphs that need to be filled and indented.@refill The @code{@@refill} command causes @code{texinfo-format-region} and @code{texinfo-format-buffer} to refill a paragraph in the Info file @emph{after} all the other processing has been done. For this reason, you can not use @code{@@refill} with a paragraph containing either @code{@@*} or @code{@@w@{ @dots{} @}} since the refilling action will override those two commands.@refill The @code{texinfo-format-region} and @code{texinfo-format-buffer} commands now automatically append @code{@@refill} to the end of each paragraph that should be filled. They do not append @code{@@refill} to the ends of paragraphs that contain @code{@@*} or @w{@code{@@w@{ @dots{}@}}} and therefore do not refill or indent them.@refill @node Command Syntax @appendix @@-Command Syntax @cindex @@-command syntax @cindex Syntax, of @@-commands @cindex Command syntax The character @samp{@@} is used to start special Texinfo commands. (It has the same meaning that @samp{\} has in plain @TeX{}.) Texinfo has four types of @@-command:@refill @table @asis @item 1. Non-alphabetic commands. These commands consist of an @@ followed by a punctuation mark or other character that is not part of the alphabet. Non-alphabetic commands are almost always part of the text within a paragraph, and never take any argument. The two characters (@@ and the other one) are complete in themselves; none is followed by braces. The non-alphabetic commands are: @code{@@.}, @code{@@:}, @code{@@*}, @code{@@@kbd{SPACE}}, @code{@@@kbd{TAB}}, @code{@@@kbd{NL}}, @code{@@@@}, @code{@@@{}, and @code{@@@}}.@refill @item 2. Alphabetic commands that do not require arguments. These commands start with @@ followed by a word followed by left- and right-hand braces. These commands insert special symbols in the document; they do not require arguments. For example, @code{@@dots@{@}} @result{} @samp{@dots{}}, @code{@@equiv@{@}} @result{} @samp{@equiv{}}, @code{@@TeX@{@}} @result{} `@TeX{}', and @code{@@bullet@{@}} @result{} @samp{@bullet{}}.@refill @item 3. Alphabetic commands that require arguments within braces. These commands start with @@ followed by a letter or a word, followed by an argument within braces. For example, the command @code{@@dfn} indicates the introductory or defining use of a term; it is used as follows: @samp{In Texinfo, @@@@-commands are @@dfn@{mark-up@} commands.}@refill @item 4. Alphabetic commands that occupy an entire line. These commands occupy an entire line. The line starts with @@, followed by the name of the command (a word); for example, @code{@@center} or @code{@@cindex}. If no argument is needed, the word is followed by the end of the line. If there is an argument, it is separated from the command name by a space. Braces are not used.@refill @end table @cindex Braces and argument syntax Thus, the alphabetic commands fall into classes that have different argument syntaxes. You cannot tell to which class a command belongs by the appearance of its name, but you can tell by the command's meaning: if the command stands for a glyph, it is in class 2 and does not require an argument; if it makes sense to use the command together with other text as part of a paragraph, the command is in class 3 and must be followed by an argument in braces; otherwise, it is in class 4 and uses the rest of the line as its argument.@refill The purpose of having a different syntax for commands of classes 3 and 4 is to make Texinfo files easier to read, and also to help the GNU Emacs paragraph and filling commands work properly. There is only one exception to this rule: the command @code{@@refill}, which is always used at the end of a paragraph immediately following the final period or other punctuation character. @code{@@refill} takes no argument and does @emph{not} require braces. @code{@@refill} never confuses the Emacs paragraph commands because it cannot appear at the beginning of a line.@refill @node Obtaining TeX @appendix How to Obtain @TeX{} @cindex Obtaining @TeX{} @cindex @TeX{}, how to obtain @c !!! Here is information about obtaining TeX. Update it whenever. @c !!! Also consider updating TeX.README on ftp.gnu.org. @c Updated by RJC on 1 March 1995, conversation with MacKay. @c Updated by kb@cs.umb.edu on 29 July 1996. @c Updated by kb@cs.umb.edu on 25 April 1997. @c Updated by kb@cs.umb.edu on 27 February 1998. @TeX{} is freely redistributable. You can obtain @TeX{} for Unix systems via anonymous ftp or on physical media. The core material consists of the Web2c @TeX{} distribution (@uref{http://tug.org/web2c}). Instructions for retrieval by anonymous ftp and information on other available distributions: @example @uref{ftp://tug.org/tex/unixtex.ftp} @uref{http://tug.org/unixtex.ftp} @end example The Free Software Foundation provides a core distribution on its Source Code CD-ROM suitable for printing Texinfo manuals. To order it, contact: @display @group Free Software Foundation, Inc. 59 Temple Place Suite 330 Boston, MA @ @ 02111-1307 USA Telephone: @w{+1-617-542-5942} Fax: (including Japan) @w{+1-617-542-2652} Free Dial Fax (in Japan): @w{ } @w{ } @w{ } 0031-13-2473 (KDD) @w{ } @w{ } @w{ } 0066-3382-0158 (IDC) Electronic mail: @code{gnu@@gnu.org} @end group @end display Many other @TeX{} distributions are available; see @uref{http://tug.org/}. @c These are no longer ``new'', and the explanations @c are all given elsewhere anyway, I think. --karl, 25apr97. @c So ignore the entire appendix. @ignore @c node New Features, Command and Variable Index, Obtaining TeX, Top @c appendix Second Edition Features @tex % Widen the space for the first column so three control-character % strings fit in the first column. Switched back to default .8in % value at end of chapter. \global\tableindent=1.0in @end tex The second edition of the Texinfo manual describes more than 20 new Texinfo mode commands and more than 50 previously undocumented Texinfo @@-commands. This edition is more than twice the length of the first edition.@refill Here is a brief description of the new commands.@refill @c menu * New Texinfo Mode Commands:: The updating commands are especially useful. * New Commands:: Many newly described @@-commands. @c end menu @c node New Texinfo Mode Commands, New Commands, Obtaining TeX, Obtaining TeX @c appendixsec 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.@refill The keybindings are intended to be somewhat mnemonic.@refill @c subheading Update all nodes and menus The @code{texinfo-master-menu} command is the primary command: @table @kbd @item C-c C-u m @itemx M-x texinfo-master-menu Create or update a master menu. With @kbd{C-u} as a prefix argument, first create or update all nodes and regular menus. @end table @c subheading Update Pointers @noindent Create or update `Next', `Previous', and `Up' node pointers.@refill @noindent @xref{Updating Nodes and Menus}. @table @kbd @item C-c C-u C-n @itemx M-x texinfo-update-node Update a node. @item C-c C-u C-e @itemx M-x texinfo-every-node-update Update every node in the buffer. @end table @c subheading Update Menus @noindent Create or update menus.@refill @noindent @xref{Updating Nodes and Menus}. @table @kbd @item C-c C-u C-m @itemx M-x texinfo-make-menu Make or update a menu. @item C-c C-u C-a @itemx M-x texinfo-all-menus-update Make or update all the menus in a buffer. With @kbd{C-u} as a prefix argument, first update all the nodes. @end table @c subheading Insert Title as Description @noindent 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.)@refill @noindent @xref{Inserting, Inserting Frequently Used Commands}. @table @kbd @item C-c C-c C-d Insert title. @end table @c subheading Format for Info @noindent Provide keybindings both for the Info formatting commands that are written in Emacs Lisp and for @code{makeinfo} that is written in C.@refill @noindent @xref{Info Formatting}. @noindent Use the Emacs lisp @code{texinfo-format@dots{}} commands: @table @kbd @item C-c C-e C-r Format the region. @item C-c C-e C-b Format the buffer. @end table @noindent Use @code{makeinfo}: @table @kbd @item C-c C-m C-r Format the region. @item C-c C-m C-b Format the buffer. @item C-c C-m C-l Recenter the @code{makeinfo} output buffer. @item C-c C-m C-k Kill the @code{makeinfo} formatting job. @end table @c subheading Typeset and Print @noindent Typeset and print Texinfo documents from within Emacs.@refill @ifinfo @noindent @xref{Printing}. @end ifinfo @iftex @noindent @xref{Printing, , Formatting and Printing}. @end iftex @table @kbd @item C-c C-t C-b Run @code{texi2dvi} on the buffer. @item C-c C-t C-r Run @TeX{} on the region. @item C-c C-t C-i Run @code{texindex}. @item C-c C-t C-p Print the DVI file. @item C-c C-t C-q Show the print queue. @item C-c C-t C-d Delete a job from the print queue. @item C-c C-t C-k Kill the current @TeX{} formatting job. @item C-c C-t C-x Quit a currently stopped @TeX{} formatting job. @item C-c C-t C-l Recenter the output buffer. @end table @c subheading Other Updating Commands @noindent The ``other updating commands'' do not have standard keybindings because they are used less frequently.@refill @noindent @xref{Other Updating Commands}. @table @kbd @item M-x texinfo-insert-node-lines Insert missing @code{@@node} lines using section titles as node names. @item M-x texinfo-multiple-files-update Update a multi-file document. With a numeric prefix, such as @kbd{C-u 8}, update @strong{every} pointer and menu in @strong{all} the files and then insert a master menu. @item M-x texinfo-indent-menu-description Indent descriptions in menus. @item M-x texinfo-sequential-node-update Insert node pointers in strict sequence. @end table @c no.de New Commands, , New Texinfo Mode Commands, Obtaining TeX @c appendix.sec New Texinfo @@-Commands The second edition of the Texinfo manual describes more than 50 commands that were not described in the first edition. A third or so 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:@refill @c subheading Indexing @noindent Create your own index, and merge indices.@refill @noindent @xref{Indices}. @table @kbd @item @@defindex @var{index-name} Define a new index and its indexing command. See also the @code{@@defcodeindex} command. @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. @end table @c subheading Definitions @noindent Describe functions, variables, macros, commands, user options, special forms, and other such artifacts in a uniform format.@refill @noindent @xref{Definition Commands}. @table @kbd @item @@deffn @var{category} @var{name} @var{arguments}@dots{} Format a description for functions, interactive commands, and similar entities. @item @@defvr, @@defop, @dots{} 15 other related commands. @end table @c subheading Glyphs @noindent Indicate the results of evaluation, expansion, printed output, an error message, equivalence of expressions, and the location of point.@refill @noindent @xref{Glyphs}. @table @kbd @item @@equiv@{@} @itemx @equiv{} Equivalence: @item @@error@{@} @itemx @error{} Error message @item @@expansion@{@} @itemx @expansion{} Macro expansion @item @@point@{@} @itemx @point{} Position of point @item @@print@{@} @itemx @print{} Printed output @item @@result@{@} @itemx @result{} Result of an expression @end table @c subheading Page Headings @noindent Customize page headings. @noindent @xref{Headings}. @table @kbd @item @@headings @var{on-off-single-double} Headings on or off, single, or double-sided. @item @@evenfooting [@var{left}] @@| [@var{center}] @@| [@var{right}] Footings for even-numbered (left-hand) pages. @item @@evenheading, @@everyheading, @@oddheading, @dots{} Five other related commands. @item @@thischapter Insert name of chapter and chapter number. @item @@thischaptername, @@thisfile, @@thistitle, @@thispage Related commands. @end table @c subheading Formatting @noindent Format blocks of text. @noindent @xref{Quotations and Examples}, and@* @ref{Lists and Tables, , Making Lists and Tables}. @table @kbd @item @@cartouche Draw rounded box surrounding text (not in Info). @item @@enumerate @var{optional-arg} Enumerate a list with letters or numbers. @item @@exdent @var{line-of-text} Remove indentation. @item @@flushleft Left justify. @item @@flushright Right justify. @item @@format Do not narrow nor change font. @item @@ftable @var{formatting-command} @itemx @@vtable @var{formatting-command} Two-column table with indexing. @item @@lisp For an example of Lisp code. @item @@smallexample @itemx @@smalllisp Like @@table and @@lisp @r{but for} @@smallbook. @end table @c subheading Conditionals @noindent Conditionally format text. @noindent @xref{set clear value, , @code{@@set} @code{@@clear} @code{@@value}}.@refill @table @kbd @item @@set @var{flag} [@var{string}] Set a flag. Optionally, set value of @var{flag} to @var{string}. @item @@clear @var{flag} Clear a flag. @item @@value@{@var{flag}@} Replace with value to which @var{flag} is set. @item @@ifset @var{flag} Format, if @var{flag} is set. @item @@ifclear @var{flag} Ignore, if @var{flag} is set. @end table @c subheading @@heading series for Titles @noindent Produce unnumbered headings that do not appear in a table of contents. @noindent @xref{Structuring}. @table @kbd @item @@heading @var{title} Unnumbered section-like heading not listed in the table of contents of a printed manual. @item @@chapheading, @@majorheading, @@c subheading, @@subsubheading Related commands. @end table @need 1000 @c subheading Font commands @need 1000 @noindent @xref{Smallcaps}, and @* @ref{Fonts}. @table @kbd @item @@r@{@var{text}@} Print in roman font. @item @@sc@{@var{text}@} Print in @sc{small caps} font. @end table @c subheading Miscellaneous @noindent See @ref{title subtitle author, , @code{@@title} @code{@@subtitle} and @code{@@author} Commands},@* see @ref{Customized Highlighting},@* see @ref{Overfull hboxes},@* see @ref{Footnotes},@* see @ref{dmn, , Format a Dimension},@* see @ref{Raise/lower sections, , @code{@@raisesections} and @code{@@lowersections}},@* see @ref{math, , @code{@@math}: Inserting Mathematical Expressions}.@* see @ref{minus, , Inserting a Minus Sign},@* see @ref{paragraphindent, , Paragraph Indenting},@* 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}. @table @kbd @item @@author @var{author} Typeset author's name. @c @item @@definfoenclose @var{new-command}, @var{before}, @var{after}, @c Define a highlighting command for Info. (Info only.) @item @@finalout Produce cleaner printed output. @item @@footnotestyle @var{end-or-separate} Specify footnote style. @item @@dmn@{@var{dimension}@} Format a dimension. @item @@global@@let@var{new-cmd}=@var{existing-cmd} Define a highlighting command for @TeX{}. (@TeX{} only.) @item @@lowersections Reduce hierarchical level of sectioning commands. @item @@math@{@var{mathematical-expression}@} Format a mathematical expression. @item @@minus@{@} Generate a minus sign. @item @@paragraphindent @var{asis-or-number} Specify paragraph indentation. @item @@raisesections Raise hierarchical level of sectioning commands. @item @@ref@{@var{node-name}, @r{[}@var{entry}@r{]}, @r{[}@var{topic-or-title}@r{]}, @r{[}@var{info-file}@r{]}, @r{[}@var{manual}@r{]}@} Make a reference. In the printed manual, the reference does not start with the word `see'. @item @@title @var{title} Typeset @var{title} in the alternative title page format. @item @@subtitle @var{subtitle} Typeset @var{subtitle} in the alternative title page format. @item @@today@{@} Insert the current date. @end table @tex % Switch width of first column of tables back to default value \global\tableindent=.8in @end tex @end ignore +@node Documentation Copying +@appendix GNU Free Documentation License + +@cindex FDL, GNU Free Documentation License +@center Version 1.1, March 2000 + +@display +Copyright @copyright{} 2000 Free Software Foundation, Inc. +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. +@end display + +@enumerate 0 +@item +PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +written document @dfn{free} in the sense of freedom: to assure everyone +the effective freedom to copy and redistribute it, with or without +modifying it, either commercially or noncommercially. Secondarily, +this License preserves for the author and publisher a way to get +credit for their work, while not being considered responsible for +modifications made by others. + +This License is a kind of ``copyleft'', which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + +@item +APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work that contains a +notice placed by the copyright holder saying it can be distributed +under the terms of this License. The ``Document'', below, refers to any +such manual or work. Any member of the public is a licensee, and is +addressed as ``you''. + +A ``Modified Version'' of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A ``Secondary Section'' is a named appendix or a front-matter section of +the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall subject +(or to related matters) and contains nothing that could fall directly +within that overall subject. (For example, if the Document is in part a +textbook of mathematics, a Secondary Section may not explain any +mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The ``Invariant Sections'' are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. + +The ``Cover Texts'' are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. + +A ``Transparent'' copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, whose contents can be viewed and edited directly and +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup has been designed to thwart or discourage +subsequent modification by readers is not Transparent. A copy that is +not ``Transparent'' is called ``Opaque''. + +Examples of suitable formats for Transparent copies include plain +@sc{ascii} without markup, Texinfo input format, La@TeX{} input format, +@acronym{SGML} or @acronym{XML} using a publicly available +@acronym{DTD}, and standard-conforming simple @acronym{HTML} designed +for human modification. Opaque formats include PostScript, +@acronym{PDF}, proprietary formats that can be read and edited only by +proprietary word processors, @acronym{SGML} or @acronym{XML} for which +the @acronym{DTD} and/or processing tools are not generally available, +and the machine-generated @acronym{HTML} produced by some word +processors for output purposes only. + +The ``Title Page'' means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, ``Title Page'' means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +@item +VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + +@item +COPYING IN QUANTITY + +If you publish printed copies of the Document numbering more than 100, +and the Document's license notice requires Cover Texts, you must enclose +the copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a publicly-accessible computer-network location containing a complete +Transparent copy of the Document, free of added material, which the +general network-using public has access to download anonymously at no +charge using public-standard network protocols. If you use the latter +option, you must take reasonably prudent steps, when you begin +distribution of Opaque copies in quantity, to ensure that this +Transparent copy will remain thus accessible at the stated location +until at least one year after the last time you distribute an Opaque +copy (directly or through your agents or retailers) of that edition to +the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. + +@item +MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +@enumerate A +@item +Use in the Title Page (and on the covers, if any) a title distinct +from that of the Document, and from those of previous versions +(which should, if there were any, be listed in the History section +of the Document). You may use the same title as a previous version +if the original publisher of that version gives permission. + +@item +List on the Title Page, as authors, one or more persons or entities +responsible for authorship of the modifications in the Modified +Version, together with at least five of the principal authors of the +Document (all of its principal authors, if it has less than five). + +@item +State on the Title page the name of the publisher of the +Modified Version, as the publisher. + +@item +Preserve all the copyright notices of the Document. + +@item +Add an appropriate copyright notice for your modifications +adjacent to the other copyright notices. + +@item +Include, immediately after the copyright notices, a license notice +giving the public permission to use the Modified Version under the +terms of this License, in the form shown in the Addendum below. + +@item +Preserve in that license notice the full lists of Invariant Sections +and required Cover Texts given in the Document's license notice. + +@item +Include an unaltered copy of this License. + +@item +Preserve the section entitled ``History'', and its title, and add to +it an item stating at least the title, year, new authors, and +publisher of the Modified Version as given on the Title Page. If +there is no section entitled ``History'' in the Document, create one +stating the title, year, authors, and publisher of the Document as +given on its Title Page, then add an item describing the Modified +Version as stated in the previous sentence. + +@item +Preserve the network location, if any, given in the Document for +public access to a Transparent copy of the Document, and likewise +the network locations given in the Document for previous versions +it was based on. These may be placed in the ``History'' section. +You may omit a network location for a work that was published at +least four years before the Document itself, or if the original +publisher of the version it refers to gives permission. + +@item +In any section entitled ``Acknowledgments'' or ``Dedications'', +preserve the section's title, and preserve in the section all the +substance and tone of each of the contributor acknowledgments +and/or dedications given therein. + +@item +Preserve all the Invariant Sections of the Document, +unaltered in their text and in their titles. Section numbers +or the equivalent are not considered part of the section titles. + +@item +Delete any section entitled ``Endorsements''. Such a section +may not be included in the Modified Version. + +@item +Do not retitle any existing section as ``Endorsements'' +or to conflict in title with any Invariant Section. +@end enumerate + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section entitled ``Endorsements'', provided it contains +nothing but endorsements of your Modified Version by various +parties---for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + +@item +COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections entitled ``History'' +in the various original documents, forming one section entitled +``History''; likewise combine any sections entitled ``Acknowledgments'', +and any sections entitled ``Dedications''. You must delete all sections +entitled ``Endorsements.'' + +@item +COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. + +@item +AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, does not as a whole count as a Modified Version +of the Document, provided no compilation copyright is claimed for the +compilation. Such a compilation is called an ``aggregate'', and this +License does not apply to the other self-contained works thus compiled +with the Document, on account of their being thus compiled, if they +are not themselves derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one quarter +of the entire aggregate, the Document's Cover Texts may be placed on +covers that surround only the Document within the aggregate. +Otherwise they must appear on covers around the whole aggregate. + +@item +TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License provided that you also include the +original English version of this License. In case of a disagreement +between the translation and the original English version of this +License, the original English version will prevail. + +@item +TERMINATION + +You may not copy, modify, sublicense, or distribute the Document except +as expressly provided for under this License. Any other attempt to +copy, modify, sublicense or distribute the Document is void, and will +automatically terminate your rights under this License. However, +parties who have received copies, or rights, from you under this +License will not have their licenses terminated so long as such +parties remain in full compliance. + +@item +FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +@uref{http://www.gnu.org/copyleft/}. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License ``or any later version'' applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. +@end enumerate + +@page +@appendixsubsec ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + +@smallexample +@group + Copyright (C) @var{year} @var{your name}. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with the Invariant Sections being @var{list their titles}, with the + Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}. + A copy of the license is included in the section entitled ``GNU + Free Documentation License''. +@end group +@end smallexample + +If you have no Invariant Sections, write ``with no Invariant Sections'' +instead of saying which ones are invariant. If you have no +Front-Cover Texts, write ``no Front-Cover Texts'' instead of +``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. + + @node Command and Variable Index @unnumbered Command and Variable Index 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 @unnumbered Concept Index @printindex cp @bye diff --git a/contrib/texinfo/doc/version-stnd.texi b/contrib/texinfo/doc/version-stnd.texi new file mode 100644 index 000000000000..fb7f62b8ddd3 --- /dev/null +++ b/contrib/texinfo/doc/version-stnd.texi @@ -0,0 +1,4 @@ +@set UPDATED 2 March 2002 +@set UPDATED-MONTH March 2002 +@set EDITION 4.1 +@set VERSION 4.1 diff --git a/contrib/texinfo/doc/version.texi b/contrib/texinfo/doc/version.texi index 2d7c14922ab8..af97803b5a38 100644 --- a/contrib/texinfo/doc/version.texi +++ b/contrib/texinfo/doc/version.texi @@ -1,3 +1,4 @@ -@set UPDATED 28 September 1999 -@set EDITION 4.0 -@set VERSION 4.0 +@set UPDATED 4 March 2002 +@set UPDATED-MONTH March 2002 +@set EDITION 4.1 +@set VERSION 4.1 diff --git a/contrib/texinfo/info/doc.h b/contrib/texinfo/info/doc.h index 423998e37c88..53597d1d3cd3 100644 --- a/contrib/texinfo/info/doc.h +++ b/contrib/texinfo/info/doc.h @@ -1,50 +1,99 @@ -/* doc.h -- Structure associating function pointers with documentation. */ +/* doc.h -- Structures associating function pointers with documentation. + $Id: doc.h,v 1.5 2001/11/16 23:16:40 karl Exp $ -/* 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, 2001 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). */ #if !defined (DOC_H) #define DOC_H #include "info.h" /* for NAMED_FUNCTIONS, VFunction, etc. */ -typedef struct { +#if defined (INFOKEY) +/* For each function, we keep track of the first defined key sequence + which invokes that function, for each different map. This is so that + the dynamic documentation generation in infodoc.c (a) doesn't have to + search through copious KEYMAP_ENTRYs, and, more importantly, (b) the + user and programmer can choose the preferred key sequence that is + printed for any given function -- it's just the first one that + appears in the user's infokey file or the default keymaps in + infomap.c. + + Each FUNCTION_DOC has a linked list of FUNCTION_KEYSEQ structs + hanging off it, which are created on startup when the user and/or + default keymaps are being parsed. */ +typedef struct function_keyseq +{ + struct function_keyseq *next; + struct keymap_entry *map; + char *keyseq; +} FUNCTION_KEYSEQ; + +#endif /* INFOKEY */ + + +/* An array of FUNCTION_DOC structures is defined in doc.c, which is + automagically generated by the makedoc utility, whose job is to scan + through the source files for command function declarations and + compile a list of all the ones it finds. This saves tedious + housekeeping and avoids errors of omission. */ +typedef struct +{ VFunction *func; #if defined (NAMED_FUNCTIONS) char *func_name; #endif /* NAMED_FUNCTIONS */ - char *doc; +#if defined (INFOKEY) + FUNCTION_KEYSEQ *keys; +#endif /* INFOKEY */ + char *doc; } FUNCTION_DOC; extern FUNCTION_DOC function_doc_array[]; extern char *function_documentation (); extern char *key_documentation (); extern char *pretty_keyname (); +extern char *pretty_keyseq (); +extern char *where_is (); extern char *replace_in_documentation (); extern void info_document_key (); extern void dump_map_to_message_buffer (); +/* Under the old key-binding system, an info command is specified by + the pointer to its function. Under the new INFOKEY binding system, + it is specified by a pointer to the command's FUNCTION_DOC structure, + defined in doc.c, from which the pointer to the function can be + easily divined using the InfoFunction() extractor. */ +#if defined(INFOKEY) +typedef FUNCTION_DOC InfoCommand; +#define InfoFunction(ic) ((ic) ? (ic)->func : NULL) +#define InfoCmd(fn) (&function_doc_array[A_##fn]) +#define DocInfoCmd(fd) ((fd) && (fd)->func ? (fd) : NULL) +#else /* !INFOKEY */ +typedef VFunction InfoCommand; +#define InfoFunction(vf) ((vf)) +#define InfoCmd(fn) fn +#define DocInfoCmd(fd) ((fd)->func) +#endif /* !INFOKEY */ + #if defined (NAMED_FUNCTIONS) extern char *function_name (); -extern VFunction *named_function (); +extern InfoCommand *named_function (); #endif /* NAMED_FUNCTIONS */ #endif /* !DOC_H */ diff --git a/contrib/texinfo/info/echo-area.c b/contrib/texinfo/info/echo-area.c index 7500523491be..078e8e7db2b2 100644 --- a/contrib/texinfo/info/echo-area.c +++ b/contrib/texinfo/info/echo-area.c @@ -1,1505 +1,1527 @@ /* echo-area.c -- how to read a line in the echo area. - $Id: echo-area.c,v 1.12 1999/03/03 22:22:14 karl Exp $ + $Id: echo-area.c,v 1.15 2001/12/12 16:19:39 karl Exp $ - Copyright (C) 1993, 97, 98, 99 Free Software Foundation, Inc. + Copyright (C) 1993, 97, 98, 99, 2001 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). */ #include "info.h" #if defined (FD_SET) # if defined (hpux) # define fd_set_cast(x) (int *)(x) # else # define fd_set_cast(x) (fd_set *)(x) # endif /* !hpux */ #endif /* FD_SET */ /* Non-zero means that C-g was used to quit reading input. */ int info_aborted_echo_area = 0; /* Non-zero means that the echo area is being used to read input. */ int echo_area_is_active = 0; /* The address of the last command executed in the echo area. */ VFunction *ea_last_executed_command = (VFunction *)NULL; /* Non-zero means that the last command executed while reading input killed some text. */ int echo_area_last_command_was_kill = 0; /* Variables which hold on to the current state of the input line. */ static char input_line[1 + EA_MAX_INPUT]; static char *input_line_prompt; static int input_line_point; static int input_line_beg; static int input_line_end; static NODE input_line_node = { (char *)NULL, (char *)NULL, (char *)NULL, input_line, EA_MAX_INPUT, 0 }; static void echo_area_initialize_node (); static void push_echo_area (), pop_echo_area (); static int echo_area_stack_contains_completions_p (); static void ea_kill_text (); /* Non-zero means we force the user to complete. */ static int echo_area_must_complete_p = 0; static int completions_window_p (); /* If non-null, this is a window which was specifically created to display possible completions output. We remember it so we can delete it when appropriate. */ static WINDOW *echo_area_completions_window = (WINDOW *)NULL; /* Variables which keep track of the window which was active prior to entering the echo area. */ static WINDOW *calling_window = (WINDOW *)NULL; static NODE *calling_window_node = (NODE *)NULL; static long calling_window_point = 0; static long calling_window_pagetop = 0; /* Remember the node and pertinent variables of the calling window. */ static void remember_calling_window (window) WINDOW *window; { /* Only do this if the calling window is not the completions window, or, if it is the completions window and there is no other window. */ if (!completions_window_p (window) || ((window == windows) && !(window->next))) { calling_window = window; calling_window_node = window->node; calling_window_point = window->point; calling_window_pagetop = window->pagetop; } } /* Restore the caller's window so that it shows the node that it was showing on entry to info_read_xxx_echo_area (). */ static void restore_calling_window () { register WINDOW *win, *compwin = (WINDOW *)NULL; /* If the calling window is still visible, and it is the window that we used for completions output, then restore the calling window. */ for (win = windows; win; win = win->next) { if (completions_window_p (win)) compwin = win; if (win == calling_window && win == compwin) { window_set_node_of_window (calling_window, calling_window_node); calling_window->point = calling_window_point; calling_window->pagetop = calling_window_pagetop; compwin = (WINDOW *)NULL; break; } } /* Delete the completions window if it is still present, it isn't the last window on the screen, and there aren't any prior echo area reads pending which created a completions window. */ if (compwin) { if ((compwin != windows || windows->next) && !echo_area_stack_contains_completions_p ()) { WINDOW *next; int pagetop, start, end, amount; next = compwin->next; if (next) { start = next->first_row; end = start + next->height; amount = - (compwin->height + 1); pagetop = next->pagetop; } info_delete_window_internal (compwin); /* This is not necessary because info_delete_window_internal () calls echo_area_inform_of_deleted_window (), which does the right thing. */ #if defined (UNNECESSARY) echo_area_completions_window = (WINDOW *)NULL; #endif /* UNNECESSARY */ if (next) { display_scroll_display (start, end, amount); next->pagetop = pagetop; display_update_display (windows); } } } } /* Set up a new input line with PROMPT. */ static void initialize_input_line (prompt) char *prompt; { input_line_prompt = prompt; if (prompt) strcpy (input_line, prompt); else input_line[0] = '\0'; input_line_beg = input_line_end = input_line_point = strlen (prompt); } static char * echo_area_after_read () { char *return_value; if (info_aborted_echo_area) { info_aborted_echo_area = 0; return_value = (char *)NULL; } else { if (input_line_beg == input_line_end) return_value = xstrdup (""); else { int line_len = input_line_end - input_line_beg; return_value = (char *) xmalloc (1 + line_len); strncpy (return_value, &input_line[input_line_beg], line_len); return_value[line_len] = '\0'; } } return (return_value); } /* Read a line of text in the echo area. Return a malloc ()'ed string, or NULL if the user aborted out of this read. WINDOW is the currently active window, so that we can restore it when we need to. PROMPT, if non-null, is a prompt to print before reading the line. */ char * info_read_in_echo_area (window, prompt) WINDOW *window; char *prompt; { char *line; /* If the echo area is already active, remember the current state. */ if (echo_area_is_active) push_echo_area (); /* Initialize our local variables. */ initialize_input_line (prompt); /* Initialize the echo area for the first (but maybe not the last) time. */ echo_area_initialize_node (); /* Save away the original node of this window, and the window itself, so echo area commands can temporarily use this window. */ remember_calling_window (window); /* Let the rest of Info know that the echo area is active. */ echo_area_is_active++; active_window = the_echo_area; /* Read characters in the echo area. */ info_read_and_dispatch (); echo_area_is_active--; /* Restore the original active window and show point in it. */ active_window = calling_window; restore_calling_window (); display_cursor_at_point (active_window); fflush (stdout); /* Get the value of the line. */ line = echo_area_after_read (); /* If there is a previous loop waiting for us, restore it now. */ if (echo_area_is_active) pop_echo_area (); /* Return the results to the caller. */ return (line); } /* (re) Initialize the echo area node. */ static void echo_area_initialize_node () { register int i; for (i = input_line_end; i < sizeof (input_line); i++) input_line[i] = ' '; input_line[i - 1] = '\n'; window_set_node_of_window (the_echo_area, &input_line_node); input_line[input_line_end] = '\n'; } /* Prepare to read characters in the echo area. This can initialize the echo area node, but its primary purpose is to side effect the input line buffer contents. */ void echo_area_prep_read () { if (the_echo_area->node != &input_line_node) echo_area_initialize_node (); the_echo_area->point = input_line_point; input_line[input_line_end] = '\n'; display_update_one_window (the_echo_area); display_cursor_at_point (active_window); } /* **************************************************************** */ /* */ /* Echo Area Movement Commands */ /* */ /* **************************************************************** */ DECLARE_INFO_COMMAND (ea_forward, _("Move forward a character")) { if (count < 0) ea_backward (window, -count, key); else { input_line_point += count; if (input_line_point > input_line_end) input_line_point = input_line_end; } } DECLARE_INFO_COMMAND (ea_backward, _("Move backward a character")) { if (count < 0) ea_forward (window, -count, key); else { input_line_point -= count; if (input_line_point < input_line_beg) input_line_point = input_line_beg; } } DECLARE_INFO_COMMAND (ea_beg_of_line, _("Move to the start of this line")) { input_line_point = input_line_beg; } DECLARE_INFO_COMMAND (ea_end_of_line, _("Move to the end of this line")) { input_line_point = input_line_end; } #define alphabetic(c) (islower (c) || isupper (c) || isdigit (c)) /* Move forward a word in the input line. */ DECLARE_INFO_COMMAND (ea_forward_word, _("Move forward a word")) { int c; if (count < 0) ea_backward_word (window, -count, key); else { while (count--) { if (input_line_point == input_line_end) return; /* If we are not in a word, move forward until we are in one. Then, move forward until we hit a non-alphabetic character. */ c = input_line[input_line_point]; if (!alphabetic (c)) { while (++input_line_point < input_line_end) { c = input_line[input_line_point]; if (alphabetic (c)) break; } } if (input_line_point == input_line_end) return; while (++input_line_point < input_line_end) { c = input_line[input_line_point]; if (!alphabetic (c)) break; } } } } DECLARE_INFO_COMMAND (ea_backward_word, _("Move backward a word")) { int c; if (count < 0) ea_forward_word (window, -count, key); else { while (count--) { if (input_line_point == input_line_beg) return; /* Like ea_forward_word (), except that we look at the characters just before point. */ c = input_line[input_line_point - 1]; if (!alphabetic (c)) { while ((--input_line_point) != input_line_beg) { c = input_line[input_line_point - 1]; if (alphabetic (c)) break; } } while (input_line_point != input_line_beg) { c = input_line[input_line_point - 1]; if (!alphabetic (c)) break; else --input_line_point; } } } } DECLARE_INFO_COMMAND (ea_delete, _("Delete the character under the cursor")) { register int i; if (count < 0) ea_rubout (window, -count, key); else { if (input_line_point == input_line_end) return; if (info_explicit_arg || count > 1) { int orig_point; orig_point = input_line_point; ea_forward (window, count, key); ea_kill_text (orig_point, input_line_point); input_line_point = orig_point; } else { for (i = input_line_point; i < input_line_end; i++) input_line[i] = input_line[i + 1]; input_line_end--; } } } DECLARE_INFO_COMMAND (ea_rubout, _("Delete the character behind the cursor")) { if (count < 0) ea_delete (window, -count, key); else { int start; if (input_line_point == input_line_beg) return; start = input_line_point; ea_backward (window, count, key); if (info_explicit_arg || count > 1) ea_kill_text (start, input_line_point); else ea_delete (window, count, key); } } DECLARE_INFO_COMMAND (ea_abort, _("Cancel or quit operation")) { /* If any text, just discard it, and restore the calling window's node. If no text, quit. */ if (input_line_end != input_line_beg) { terminal_ring_bell (); input_line_end = input_line_point = input_line_beg; if (calling_window->node != calling_window_node) restore_calling_window (); } else info_aborted_echo_area = 1; } DECLARE_INFO_COMMAND (ea_newline, _("Accept (or force completion of) this line")) { /* Stub does nothing. Simply here to see if it has been executed. */ } DECLARE_INFO_COMMAND (ea_quoted_insert, _("Insert next character verbatim")) { unsigned char character; character = info_get_another_input_char (); ea_insert (window, count, character); } DECLARE_INFO_COMMAND (ea_insert, _("Insert this character")) { register int i; if ((input_line_end + 1) == EA_MAX_INPUT) { terminal_ring_bell (); return; } for (i = input_line_end + 1; i != input_line_point; i--) input_line[i] = input_line[i - 1]; input_line[input_line_point] = key; input_line_point++; input_line_end++; } DECLARE_INFO_COMMAND (ea_tab_insert, _("Insert a TAB character")) { ea_insert (window, count, '\t'); } /* Transpose the characters at point. If point is at the end of the line, then transpose the characters before point. */ DECLARE_INFO_COMMAND (ea_transpose_chars, _("Transpose characters at point")) { /* Handle conditions that would make it impossible to transpose characters. */ if (!count || !input_line_point || (input_line_end - input_line_beg) < 2) return; while (count) { int t; if (input_line_point == input_line_end) { t = input_line[input_line_point - 1]; input_line[input_line_point - 1] = input_line[input_line_point - 2]; input_line[input_line_point - 2] = t; } else { t = input_line[input_line_point]; input_line[input_line_point] = input_line[input_line_point - 1]; input_line[input_line_point - 1] = t; if (count < 0 && input_line_point != input_line_beg) input_line_point--; else input_line_point++; } if (count < 0) count++; else count--; } } /* **************************************************************** */ /* */ /* Echo Area Killing and Yanking */ /* */ /* **************************************************************** */ static char **kill_ring = (char **)NULL; static int kill_ring_index = 0; /* Number of kills appearing in KILL_RING. */ static int kill_ring_slots = 0; /* Number of slots allocated to KILL_RING. */ static int kill_ring_loc = 0; /* Location of current yank pointer. */ /* The largest number of kills that we remember at one time. */ static int max_retained_kills = 15; DECLARE_INFO_COMMAND (ea_yank, _("Yank back the contents of the last kill")) { register int i; register char *text; if (!kill_ring_index) { inform_in_echo_area (_("Kill ring is empty")); return; } text = kill_ring[kill_ring_loc]; for (i = 0; text[i]; i++) ea_insert (window, 1, text[i]); } /* If the last command was yank, or yank_pop, and the text just before point is identical to the current kill item, then delete that text from the line, rotate the index down, and yank back some other text. */ DECLARE_INFO_COMMAND (ea_yank_pop, _("Yank back a previous kill")) { register int len; if (((ea_last_executed_command != ea_yank) && (ea_last_executed_command != ea_yank_pop)) || (kill_ring_index == 0)) return; len = strlen (kill_ring[kill_ring_loc]); /* Delete the last yanked item from the line. */ { register int i, counter; counter = input_line_end - input_line_point; for (i = input_line_point - len; counter; i++, counter--) input_line[i] = input_line[i + len]; input_line_end -= len; input_line_point -= len; } /* Get a previous kill, and yank that. */ kill_ring_loc--; if (kill_ring_loc < 0) kill_ring_loc = kill_ring_index - 1; ea_yank (window, count, key); } /* Delete the text from point to end of line. */ DECLARE_INFO_COMMAND (ea_kill_line, _("Kill to the end of the line")) { if (count < 0) { ea_kill_text (input_line_point, input_line_beg); input_line_point = input_line_beg; } else ea_kill_text (input_line_point, input_line_end); } /* Delete the text from point to beg of line. */ DECLARE_INFO_COMMAND (ea_backward_kill_line, _("Kill to the beginning of the line")) { if (count < 0) ea_kill_text (input_line_point, input_line_end); else { ea_kill_text (input_line_point, input_line_beg); input_line_point = input_line_beg; } } /* Delete from point to the end of the current word. */ DECLARE_INFO_COMMAND (ea_kill_word, _("Kill the word following the cursor")) { int orig_point = input_line_point; if (count < 0) ea_backward_kill_word (window, -count, key); else { ea_forward_word (window, count, key); if (input_line_point != orig_point) ea_kill_text (orig_point, input_line_point); input_line_point = orig_point; } } /* Delete from point to the start of the current word. */ DECLARE_INFO_COMMAND (ea_backward_kill_word, _("Kill the word preceding the cursor")) { int orig_point = input_line_point; if (count < 0) ea_kill_word (window, -count, key); else { ea_backward_word (window, count, key); if (input_line_point != orig_point) ea_kill_text (orig_point, input_line_point); } } /* The way to kill something. This appends or prepends to the last kill, if the last command was a kill command. If FROM is less than TO, then the killed text is appended to the most recent kill, otherwise it is prepended. If the last command was not a kill command, then a new slot is made for this kill. */ static void ea_kill_text (from, to) int from, to; { register int i, counter, distance; int killing_backwards, slot; char *killed_text; killing_backwards = (from > to); /* If killing backwards, reverse the values of FROM and TO. */ if (killing_backwards) { int temp = from; from = to; to = temp; } /* Remember the text that we are about to delete. */ distance = to - from; killed_text = (char *)xmalloc (1 + distance); strncpy (killed_text, &input_line[from], distance); killed_text[distance] = '\0'; /* Actually delete the text from the line. */ counter = input_line_end - to; for (i = from; counter; i++, counter--) input_line[i] = input_line[i + distance]; input_line_end -= distance; /* If the last command was a kill, append or prepend the killed text to the last command's killed text. */ if (echo_area_last_command_was_kill) { char *old, *new; slot = kill_ring_loc; old = kill_ring[slot]; new = (char *)xmalloc (1 + strlen (old) + strlen (killed_text)); if (killing_backwards) { /* Prepend TEXT to current kill. */ strcpy (new, killed_text); strcat (new, old); } else { /* Append TEXT to current kill. */ strcpy (new, old); strcat (new, killed_text); } free (old); free (killed_text); kill_ring[slot] = new; } else { /* Try to store the kill in a new slot, unless that would cause there to be too many remembered kills. */ slot = kill_ring_index; if (slot == max_retained_kills) slot = 0; if (slot + 1 > kill_ring_slots) kill_ring = (char **) xrealloc (kill_ring, (kill_ring_slots += max_retained_kills) * sizeof (char *)); if (slot != kill_ring_index) free (kill_ring[slot]); else kill_ring_index++; kill_ring[slot] = killed_text; kill_ring_loc = slot; } /* Notice that the last command was a kill. */ echo_area_last_command_was_kill++; } /* **************************************************************** */ /* */ /* Echo Area Completion */ /* */ /* **************************************************************** */ /* Pointer to an array of REFERENCE to complete over. */ static REFERENCE **echo_area_completion_items = (REFERENCE **)NULL; /* Sorted array of REFERENCE * which is the possible completions found in the variable echo_area_completion_items. If there is only one element, it is the only possible completion. */ static REFERENCE **completions_found = (REFERENCE **)NULL; static int completions_found_index = 0; static int completions_found_slots = 0; /* The lowest common denominator found while completing. */ static REFERENCE *LCD_completion; /* Internal functions used by the user calls. */ static void build_completions (), completions_must_be_rebuilt (); /* Variable which holds the output of completions. */ static NODE *possible_completions_output_node = (NODE *)NULL; static char *compwin_name = "*Completions*"; /* Return non-zero if WINDOW is a window used for completions output. */ static int completions_window_p (window) WINDOW *window; { int result = 0; if (internal_info_node_p (window->node) && (strcmp (window->node->nodename, compwin_name) == 0)) result = 1; return (result); } /* Workhorse for completion readers. If FORCE is non-zero, the user cannot exit unless the line read completes, or is empty. */ char * info_read_completing_internal (window, prompt, completions, force) WINDOW *window; char *prompt; REFERENCE **completions; int force; { char *line; /* If the echo area is already active, remember the current state. */ if (echo_area_is_active) push_echo_area (); echo_area_must_complete_p = force; /* Initialize our local variables. */ initialize_input_line (prompt); /* Initialize the echo area for the first (but maybe not the last) time. */ echo_area_initialize_node (); /* Save away the original node of this window, and the window itself, so echo area commands can temporarily use this window. */ remember_calling_window (window); /* Save away the list of items to complete over. */ echo_area_completion_items = completions; completions_must_be_rebuilt (); active_window = the_echo_area; echo_area_is_active++; /* Read characters in the echo area. */ while (1) { info_read_and_dispatch (); line = echo_area_after_read (); /* Force the completion to take place if the user hasn't accepted a default or aborted, and if FORCE is active. */ if (force && line && *line && completions) { register int i; build_completions (); /* If there is only one completion, then make the line be that completion. */ if (completions_found_index == 1) { free (line); line = xstrdup (completions_found[0]->label); break; } /* If one of the completions matches exactly, then that is okay, so return the current line. */ for (i = 0; i < completions_found_index; i++) if (strcasecmp (completions_found[i]->label, line) == 0) { free (line); line = xstrdup (completions_found[i]->label); break; } /* If no match, go back and try again. */ if (i == completions_found_index) { - inform_in_echo_area (_("Not complete")); + if (!completions_found_index) + inform_in_echo_area (_("No completions")); + else + inform_in_echo_area (_("Not complete")); continue; } } break; } echo_area_is_active--; /* Restore the original active window and show point in it. */ active_window = calling_window; restore_calling_window (); display_cursor_at_point (active_window); fflush (stdout); echo_area_completion_items = (REFERENCE **)NULL; completions_must_be_rebuilt (); /* If there is a previous loop waiting for us, restore it now. */ if (echo_area_is_active) pop_echo_area (); return (line); } /* Read a line in the echo area with completion over COMPLETIONS. */ char * info_read_completing_in_echo_area (window, prompt, completions) WINDOW *window; char *prompt; REFERENCE **completions; { return (info_read_completing_internal (window, prompt, completions, 1)); } /* Read a line in the echo area allowing completion over COMPLETIONS, but not requiring it. */ char * info_read_maybe_completing (window, prompt, completions) WINDOW *window; char *prompt; REFERENCE **completions; { return (info_read_completing_internal (window, prompt, completions, 0)); } DECLARE_INFO_COMMAND (ea_possible_completions, _("List possible completions")) { if (!echo_area_completion_items) { ea_insert (window, count, key); return; } build_completions (); if (!completions_found_index) { terminal_ring_bell (); inform_in_echo_area (_("No completions")); } else if ((completions_found_index == 1) && (key != '?')) { inform_in_echo_area (_("Sole completion")); } else { register int i, l; int limit, count, max_label = 0; initialize_message_buffer (); printf_to_message_buffer (completions_found_index == 1 ? _("One completion:\n") : _("%d completions:\n"), completions_found_index); /* Find the maximum length of a label. */ for (i = 0; i < completions_found_index; i++) { int len = strlen (completions_found[i]->label); if (len > max_label) max_label = len; } max_label += 4; /* Find out how many columns we should print in. */ limit = calling_window->width / max_label; if (limit != 1 && (limit * max_label == calling_window->width)) limit--; /* Avoid a possible floating exception. If max_label > width then the limit will be 0 and a divide-by-zero fault will result. */ if (limit == 0) limit = 1; /* How many iterations of the printing loop? */ count = (completions_found_index + (limit - 1)) / limit; /* Watch out for special case. If the number of completions is less than LIMIT, then just do the inner printing loop. */ if (completions_found_index < limit) count = 1; /* Print the sorted items, up-and-down alphabetically. */ for (i = 0; i < count; i++) { register int j; for (j = 0, l = i; j < limit; j++) { if (l >= completions_found_index) break; else { char *label; int printed_length, k; label = completions_found[l]->label; printed_length = strlen (label); printf_to_message_buffer ("%s", label); if (j + 1 < limit) { for (k = 0; k < max_label - printed_length; k++) printf_to_message_buffer (" "); } } l += count; } printf_to_message_buffer ("\n"); } /* Make a new node to hold onto possible completions. Don't destroy dangling pointers. */ { NODE *temp; temp = message_buffer_to_node (); add_gcable_pointer (temp->contents); name_internal_node (temp, compwin_name); possible_completions_output_node = temp; } /* Find a suitable window for displaying the completions output. First choice is an existing window showing completions output. If there is only one window, and it is large, make another (smaller) window, and use that one. Otherwise, use the caller's window. */ { WINDOW *compwin; compwin = get_internal_info_window (compwin_name); if (!compwin) { /* If we can split the window to display most of the completion items, then do so. */ if (calling_window->height > (count * 2) && calling_window->height / 2 >= WINDOW_MIN_SIZE) { int start, pagetop; #ifdef SPLIT_BEFORE_ACTIVE int end; #endif active_window = calling_window; /* Perhaps we can scroll this window on redisplay. */ start = calling_window->first_row; pagetop = calling_window->pagetop; compwin = window_make_window (possible_completions_output_node); active_window = the_echo_area; window_change_window_height (compwin, -(compwin->height - (count + 2))); window_adjust_pagetop (calling_window); remember_calling_window (calling_window); #if defined (SPLIT_BEFORE_ACTIVE) /* If the pagetop hasn't changed, scrolling the calling window is a reasonable thing to do. */ if (pagetop == calling_window->pagetop) { end = start + calling_window->height; display_scroll_display (start, end, calling_window->prev->height + 1); } #else /* !SPLIT_BEFORE_ACTIVE */ /* If the pagetop has changed, set the new pagetop here. */ if (pagetop != calling_window->pagetop) { int newtop = calling_window->pagetop; calling_window->pagetop = pagetop; set_window_pagetop (calling_window, newtop); } #endif /* !SPLIT_BEFORE_ACTIVE */ echo_area_completions_window = compwin; remember_window_and_node (compwin, compwin->node); } else compwin = calling_window; } if (compwin->node != possible_completions_output_node) { window_set_node_of_window (compwin, possible_completions_output_node); remember_window_and_node (compwin, compwin->node); } display_update_display (windows); } } } DECLARE_INFO_COMMAND (ea_complete, _("Insert completion")) { if (!echo_area_completion_items) { ea_insert (window, count, key); return; } /* If KEY is SPC, and we are not forcing completion to take place, simply insert the key. */ if (!echo_area_must_complete_p && key == SPC) { ea_insert (window, count, key); return; } if (ea_last_executed_command == ea_complete) { /* If the keypress is a SPC character, and we have already tried completing once, and there are several completions, then check the batch of completions to see if any continue with a space. If there are some, insert the space character and continue. */ if (key == SPC && completions_found_index > 1) { register int i, offset; offset = input_line_end - input_line_beg; for (i = 0; i < completions_found_index; i++) if (completions_found[i]->label[offset] == ' ') break; if (completions_found[i]) ea_insert (window, 1, ' '); else { ea_possible_completions (window, count, key); return; } } else { ea_possible_completions (window, count, key); return; } } input_line_point = input_line_end; build_completions (); if (!completions_found_index) terminal_ring_bell (); else if (LCD_completion->label[0] == '\0') ea_possible_completions (window, count, key); else { register int i; input_line_point = input_line_end = input_line_beg; for (i = 0; LCD_completion->label[i]; i++) ea_insert (window, 1, LCD_completion->label[i]); } } /* Utility REFERENCE used to store possible LCD. */ static REFERENCE LCD_reference = { (char *)NULL, (char *)NULL, (char *)NULL }; static void remove_completion_duplicates (); /* Variables which remember the state of the most recent call to build_completions (). */ static char *last_completion_request = (char *)NULL; static REFERENCE **last_completion_items = (REFERENCE **)NULL; /* How to tell the completion builder to reset internal state. */ static void completions_must_be_rebuilt () { maybe_free (last_completion_request); last_completion_request = (char *)NULL; last_completion_items = (REFERENCE **)NULL; } /* Build a list of possible completions from echo_area_completion_items, and the contents of input_line. */ static void build_completions () { register int i, len; register REFERENCE *entry; char *request; int informed_of_lengthy_job = 0; /* If there are no items to complete over, exit immediately. */ if (!echo_area_completion_items) { completions_found_index = 0; LCD_completion = (REFERENCE *)NULL; return; } /* Check to see if this call to build completions is the same as the last call to build completions. */ len = input_line_end - input_line_beg; request = (char *)xmalloc (1 + len); strncpy (request, &input_line[input_line_beg], len); request[len] = '\0'; if (last_completion_request && last_completion_items && last_completion_items == echo_area_completion_items && (strcmp (last_completion_request, request) == 0)) { free (request); return; } maybe_free (last_completion_request); last_completion_request = request; last_completion_items = echo_area_completion_items; /* Always start at the beginning of the list. */ completions_found_index = 0; LCD_completion = (REFERENCE *)NULL; for (i = 0; (entry = echo_area_completion_items[i]); i++) { if (strncasecmp (request, entry->label, len) == 0) add_pointer_to_array (entry, completions_found_index, completions_found, completions_found_slots, 20, REFERENCE *); if (!informed_of_lengthy_job && completions_found_index > 100) { informed_of_lengthy_job = 1; window_message_in_echo_area (_("Building completions...")); } } if (!completions_found_index) return; /* Sort and prune duplicate entries from the completions array. */ remove_completion_duplicates (); /* If there is only one completion, just return that. */ if (completions_found_index == 1) { LCD_completion = completions_found[0]; return; } /* Find the least common denominator. */ { long shortest = 100000; for (i = 1; i < completions_found_index; i++) { register int j; int c1, c2; for (j = 0; (c1 = info_tolower (completions_found[i - 1]->label[j])) && (c2 = info_tolower (completions_found[i]->label[j])); j++) if (c1 != c2) break; if (shortest > j) shortest = j; } maybe_free (LCD_reference.label); LCD_reference.label = (char *)xmalloc (1 + shortest); - strncpy (LCD_reference.label, completions_found[0]->label, shortest); + /* Since both the sorting done inside remove_completion_duplicates + and all the comparisons above are case-insensitive, it's + possible that the completion we are going to return is + identical to what the user typed but for the letter-case. This + is confusing, since the user could type FOOBAR<TAB> and get her + string change letter-case for no good reason. So try to find a + possible completion whose letter-case is identical, and if so, + use that. */ + if (completions_found_index > 1) + { + int req_len = strlen (request); + + for (i = 0; i < completions_found_index; i++) + if (strncmp (request, completions_found[i]->label, req_len) == 0) + break; + /* If none of the candidates match exactly, use the first one. */ + if (i >= completions_found_index) + i = 0; + } + strncpy (LCD_reference.label, completions_found[i]->label, shortest); LCD_reference.label[shortest] = '\0'; LCD_completion = &LCD_reference; } if (informed_of_lengthy_job) echo_area_initialize_node (); } /* Function called by qsort. */ static int compare_references (entry1, entry2) REFERENCE **entry1, **entry2; { return (strcasecmp ((*entry1)->label, (*entry2)->label)); } /* Prune duplicate entries from COMPLETIONS_FOUND. */ static void remove_completion_duplicates () { register int i, j; REFERENCE **temp; int newlen; if (!completions_found_index) return; /* Sort the items. */ qsort (completions_found, completions_found_index, sizeof (REFERENCE *), compare_references); for (i = 0, newlen = 1; i < completions_found_index - 1; i++) { if (strcmp (completions_found[i]->label, completions_found[i + 1]->label) == 0) completions_found[i] = (REFERENCE *)NULL; else newlen++; } /* We have marked all the dead slots. It is faster to copy the live slots twice than to prune the dead slots one by one. */ temp = (REFERENCE **)xmalloc ((1 + newlen) * sizeof (REFERENCE *)); for (i = 0, j = 0; i < completions_found_index; i++) if (completions_found[i]) temp[j++] = completions_found[i]; for (i = 0; i < newlen; i++) completions_found[i] = temp[i]; completions_found[i] = (REFERENCE *)NULL; completions_found_index = newlen; free (temp); } /* Scroll the "other" window. If there is a window showing completions, scroll that one, otherwise scroll the window which was active on entering the read function. */ DECLARE_INFO_COMMAND (ea_scroll_completions_window, _("Scroll the completions window")) { WINDOW *compwin; int old_pagetop; compwin = get_internal_info_window (compwin_name); if (!compwin) compwin = calling_window; old_pagetop = compwin->pagetop; /* Let info_scroll_forward () do the work, and print any messages that need to be displayed. */ info_scroll_forward (compwin, count, key); } /* Function which gets called when an Info window is deleted while the echo area is active. WINDOW is the window which has just been deleted. */ void echo_area_inform_of_deleted_window (window) WINDOW *window; { /* If this is the calling_window, forget what we remembered about it. */ if (window == calling_window) { if (active_window != the_echo_area) remember_calling_window (active_window); else remember_calling_window (windows); } /* If this window was the echo_area_completions_window, then notice that the window has been deleted. */ if (window == echo_area_completions_window) echo_area_completions_window = (WINDOW *)NULL; } /* **************************************************************** */ /* */ /* Pushing and Popping the Echo Area */ /* */ /* **************************************************************** */ /* Push and Pop the echo area. */ typedef struct { char *line; char *prompt; REFERENCE **comp_items; int point, beg, end; int must_complete; NODE node; WINDOW *compwin; } PUSHED_EA; static PUSHED_EA **pushed_echo_areas = (PUSHED_EA **)NULL; static int pushed_echo_areas_index = 0; static int pushed_echo_areas_slots = 0; /* Pushing the echo_area has a side effect of zeroing the completion_items. */ static void push_echo_area () { PUSHED_EA *pushed; pushed = (PUSHED_EA *)xmalloc (sizeof (PUSHED_EA)); pushed->line = xstrdup (input_line); pushed->prompt = input_line_prompt; pushed->point = input_line_point; pushed->beg = input_line_beg; pushed->end = input_line_end; pushed->node = input_line_node; pushed->comp_items = echo_area_completion_items; pushed->must_complete = echo_area_must_complete_p; pushed->compwin = echo_area_completions_window; add_pointer_to_array (pushed, pushed_echo_areas_index, pushed_echo_areas, pushed_echo_areas_slots, 4, PUSHED_EA *); echo_area_completion_items = (REFERENCE **)NULL; } static void pop_echo_area () { PUSHED_EA *popped; popped = pushed_echo_areas[--pushed_echo_areas_index]; strcpy (input_line, popped->line); free (popped->line); input_line_prompt = popped->prompt; input_line_point = popped->point; input_line_beg = popped->beg; input_line_end = popped->end; input_line_node = popped->node; echo_area_completion_items = popped->comp_items; echo_area_must_complete_p = popped->must_complete; echo_area_completions_window = popped->compwin; completions_must_be_rebuilt (); /* If the completion window no longer exists, forget about it. */ if (echo_area_completions_window) { register WINDOW *win; for (win = windows; win; win = win->next) if (echo_area_completions_window == win) break; /* If the window wasn't found, then it has already been deleted. */ if (!win) echo_area_completions_window = (WINDOW *)NULL; } free (popped); } /* Returns non-zero if any of the prior stacked calls to read in the echo area produced a completions window. */ static int echo_area_stack_contains_completions_p () { register int i; for (i = 0; i < pushed_echo_areas_index; i++) if (pushed_echo_areas[i]->compwin) return (1); return (0); } /* **************************************************************** */ /* */ /* Error Messages While Reading in Echo Area */ /* */ /* **************************************************************** */ #if defined (HAVE_SYS_TIME_H) # include <sys/time.h> # define HAVE_STRUCT_TIMEVAL #endif /* HAVE_SYS_TIME_H */ static void pause_or_input () { #ifdef FD_SET struct timeval timer; fd_set readfds; int ready; FD_ZERO (&readfds); FD_SET (fileno (stdin), &readfds); timer.tv_sec = 2; timer.tv_usec = 0; ready = select (fileno (stdin) + 1, &readfds, (fd_set *) NULL, (fd_set *) NULL, &timer); #endif /* FD_SET */ } /* Print MESSAGE right after the end of the current line, and wait for input or a couple of seconds, whichever comes first. Then flush the informational message that was printed. */ void inform_in_echo_area (message) char *message; { register int i; char *text; text = xstrdup (message); for (i = 0; text[i] && text[i] != '\n'; i++) ; text[i] = 0; echo_area_initialize_node (); sprintf (&input_line[input_line_end], "%s[%s]\n", echo_area_is_active ? " ": "", text); free (text); the_echo_area->point = input_line_point; display_update_one_window (the_echo_area); display_cursor_at_point (active_window); fflush (stdout); pause_or_input (); echo_area_initialize_node (); } diff --git a/contrib/texinfo/info/filesys.c b/contrib/texinfo/info/filesys.c index 96f0ed98c9fa..cdf13652b0fc 100644 --- a/contrib/texinfo/info/filesys.c +++ b/contrib/texinfo/info/filesys.c @@ -1,713 +1,727 @@ /* filesys.c -- filesystem specific functions. - $Id: filesys.c,v 1.10 1998/12/06 21:58:30 karl Exp $ + $Id: filesys.c,v 1.14 2002/03/02 15:05:04 karl Exp $ - Copyright (C) 1993, 97, 98 Free Software Foundation, Inc. + Copyright (C) 1993, 97, 98, 2000 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). */ #include "info.h" #include "tilde.h" #include "filesys.h" /* Local to this file. */ static char *info_file_in_path (), *lookup_info_filename (); static char *info_absolute_file (); static void remember_info_filename (), maybe_initialize_infopath (); typedef struct { char *suffix; char *decompressor; } COMPRESSION_ALIST; static char *info_suffixes[] = { ".info", "-info", "/index", ".inf", /* 8+3 file on filesystem which supports long file names */ #ifdef __MSDOS__ /* 8+3 file names strike again... */ ".in", /* for .inz, .igz etc. */ ".i", #endif "", NULL }; static COMPRESSION_ALIST compress_suffixes[] = { { ".gz", "gunzip" }, { ".bz2", "bunzip2" }, { ".z", "gunzip" }, { ".Z", "uncompress" }, { ".Y", "unyabba" }, #ifdef __MSDOS__ { "gz", "gunzip" }, { "z", "gunzip" }, #endif { (char *)NULL, (char *)NULL } }; /* The path on which we look for info files. You can initialize this from the environment variable INFOPATH if there is one, or you can call info_add_path () to add paths to the beginning or end of it. You can call zap_infopath () to make the path go away. */ char *infopath = (char *)NULL; static int infopath_size = 0; /* Expand the filename in PARTIAL to make a real name for this operating system. This looks in INFO_PATHS in order to find the correct file. If it can't find the file, it returns NULL. */ static char *local_temp_filename = (char *)NULL; static int local_temp_filename_size = 0; char * info_find_fullpath (partial) char *partial; { int initial_character; char *temp; filesys_error_number = 0; maybe_initialize_infopath (); if (partial && (initial_character = *partial)) { char *expansion; expansion = lookup_info_filename (partial); if (expansion) return (expansion); /* If we have the full path to this file, we still may have to add various extensions to it. I guess we have to stat this file after all. */ if (IS_ABSOLUTE (partial)) temp = info_absolute_file (partial); else if (initial_character == '~') { expansion = tilde_expand_word (partial); if (IS_ABSOLUTE (expansion)) { temp = info_absolute_file (expansion); free (expansion); } else temp = expansion; } else if (initial_character == '.' && (IS_SLASH (partial[1]) || (partial[1] == '.' && IS_SLASH (partial[2])))) { if (local_temp_filename_size < 1024) local_temp_filename = (char *)xrealloc (local_temp_filename, (local_temp_filename_size = 1024)); #if defined (HAVE_GETCWD) if (!getcwd (local_temp_filename, local_temp_filename_size)) #else /* !HAVE_GETCWD */ if (!getwd (local_temp_filename)) #endif /* !HAVE_GETCWD */ { filesys_error_number = errno; return (partial); } strcat (local_temp_filename, "/"); strcat (local_temp_filename, partial); temp = info_absolute_file (local_temp_filename); /* try extensions */ if (!temp) partial = local_temp_filename; } else temp = info_file_in_path (partial, infopath); if (temp) { remember_info_filename (partial, temp); if (strlen (temp) > local_temp_filename_size) local_temp_filename = (char *) xrealloc (local_temp_filename, (local_temp_filename_size = (50 + strlen (temp)))); strcpy (local_temp_filename, temp); free (temp); return (local_temp_filename); } } return (partial); } /* Scan the list of directories in PATH looking for FILENAME. If we find one that is a regular file, return it as a new string. Otherwise, return a NULL pointer. */ static char * info_file_in_path (filename, path) char *filename, *path; { struct stat finfo; char *temp_dirname; int statable, dirname_index; + /* Reject ridiculous cases up front, to prevent infinite recursion + later on. E.g., someone might say "info '(.)foo'"... */ + if (!*filename || STREQ (filename, ".") || STREQ (filename, "..")) + return NULL; + dirname_index = 0; while ((temp_dirname = extract_colon_unit (path, &dirname_index))) { register int i, pre_suffix_length; char *temp; /* Expand a leading tilde if one is present. */ if (*temp_dirname == '~') { char *expanded_dirname; expanded_dirname = tilde_expand_word (temp_dirname); free (temp_dirname); temp_dirname = expanded_dirname; } temp = (char *)xmalloc (30 + strlen (temp_dirname) + strlen (filename)); strcpy (temp, temp_dirname); if (!IS_SLASH (temp[(strlen (temp)) - 1])) strcat (temp, "/"); strcat (temp, filename); pre_suffix_length = strlen (temp); free (temp_dirname); for (i = 0; info_suffixes[i]; i++) { strcpy (temp + pre_suffix_length, info_suffixes[i]); statable = (stat (temp, &finfo) == 0); /* If we have found a regular file, then use that. Else, if we have found a directory, look in that directory for this file. */ if (statable) { if (S_ISREG (finfo.st_mode)) { return (temp); } else if (S_ISDIR (finfo.st_mode)) { char *newpath, *filename_only, *newtemp; newpath = xstrdup (temp); filename_only = filename_non_directory (filename); newtemp = info_file_in_path (filename_only, newpath); free (newpath); if (newtemp) { free (temp); return (newtemp); } } } else { /* Add various compression suffixes to the name to see if the file is present in compressed format. */ register int j, pre_compress_suffix_length; pre_compress_suffix_length = strlen (temp); for (j = 0; compress_suffixes[j].suffix; j++) { strcpy (temp + pre_compress_suffix_length, compress_suffixes[j].suffix); statable = (stat (temp, &finfo) == 0); if (statable && (S_ISREG (finfo.st_mode))) return (temp); } } } free (temp); } return ((char *)NULL); } /* Assume FNAME is an absolute file name, and check whether it is a regular file. If it is, return it as a new string; otherwise return a NULL pointer. We do it by taking the file name apart into its directory and basename parts, and calling info_file_in_path.*/ static char * info_absolute_file (fname) char *fname; { char *containing_dir = xstrdup (fname); char *base = filename_non_directory (containing_dir); if (base > containing_dir) base[-1] = '\0'; return info_file_in_path (filename_non_directory (fname), containing_dir); } /* Given a string containing units of information separated by the PATH_SEP character, return the next one pointed to by IDX, or NULL if there are no more. Advance IDX to the character after the colon. */ char * extract_colon_unit (string, idx) char *string; int *idx; { register int i, start; i = start = *idx; if ((i >= strlen (string)) || !string) return ((char *) NULL); while (string[i] && string[i] != PATH_SEP[0]) i++; if (i == start) { return ((char *) NULL); } else { char *value; value = (char *) xmalloc (1 + (i - start)); strncpy (value, &string[start], (i - start)); value[i - start] = '\0'; if (string[i]) ++i; *idx = i; return (value); } } /* A structure which associates a filename with its expansion. */ typedef struct { char *filename; char *expansion; } FILENAME_LIST; /* An array of remembered arguments and results. */ static FILENAME_LIST **names_and_files = (FILENAME_LIST **)NULL; static int names_and_files_index = 0; static int names_and_files_slots = 0; /* Find the result for having already called info_find_fullpath () with FILENAME. */ static char * lookup_info_filename (filename) char *filename; { if (filename && names_and_files) { register int i; for (i = 0; names_and_files[i]; i++) { if (FILENAME_CMP (names_and_files[i]->filename, filename) == 0) return (names_and_files[i]->expansion); } } return (char *)NULL;; } /* Add a filename and its expansion to our list. */ static void remember_info_filename (filename, expansion) char *filename, *expansion; { FILENAME_LIST *new; if (names_and_files_index + 2 > names_and_files_slots) { int alloc_size; names_and_files_slots += 10; alloc_size = names_and_files_slots * sizeof (FILENAME_LIST *); names_and_files = (FILENAME_LIST **) xrealloc (names_and_files, alloc_size); } new = (FILENAME_LIST *)xmalloc (sizeof (FILENAME_LIST)); new->filename = xstrdup (filename); new->expansion = expansion ? xstrdup (expansion) : (char *)NULL; names_and_files[names_and_files_index++] = new; names_and_files[names_and_files_index] = (FILENAME_LIST *)NULL; } static void maybe_initialize_infopath () { if (!infopath_size) { infopath = (char *) xmalloc (infopath_size = (1 + strlen (DEFAULT_INFOPATH))); strcpy (infopath, DEFAULT_INFOPATH); } } /* Add PATH to the list of paths found in INFOPATH. 2nd argument says whether to put PATH at the front or end of INFOPATH. */ void info_add_path (path, where) char *path; int where; { int len; if (!infopath) { infopath = (char *)xmalloc (infopath_size = 200 + strlen (path)); infopath[0] = '\0'; } len = strlen (path) + strlen (infopath); if (len + 2 >= infopath_size) infopath = (char *)xrealloc (infopath, (infopath_size += (2 * len) + 2)); if (!*infopath) strcpy (infopath, path); else if (where == INFOPATH_APPEND) { strcat (infopath, PATH_SEP); strcat (infopath, path); } else if (where == INFOPATH_PREPEND) { char *temp = xstrdup (infopath); strcpy (infopath, path); strcat (infopath, PATH_SEP); strcat (infopath, temp); free (temp); } } /* Make INFOPATH have absolutely nothing in it. */ void zap_infopath () { if (infopath) free (infopath); infopath = (char *)NULL; infopath_size = 0; } /* Given a chunk of text and its length, convert all CRLF pairs at every end-of-line into a single Newline character. Return the length of produced text. This is required because the rest of code is too entrenched in having a single newline at each EOL; in particular, searching for various Info headers and cookies can become extremely tricky if that assumption breaks. FIXME: this could also support Mac-style text files with a single CR at the EOL, but what about random CR characters in non-Mac files? Can we afford converting them into newlines as well? Maybe implement some heuristics here, like in Emacs 20. FIXME: is it a good idea to show the EOL type on the modeline? */ long convert_eols (text, textlen) char *text; long textlen; { register char *s = text; register char *d = text; while (textlen--) { if (*s == '\r' && textlen && s[1] == '\n') { s++; textlen--; } *d++ = *s++; } return (long)(d - text); } /* Read the contents of PATHNAME, returning a buffer with the contents of that file in it, and returning the size of that buffer in FILESIZE. FINFO is a stat struct which has already been filled in by the caller. If the file turns out to be compressed, set IS_COMPRESSED to non-zero. If the file cannot be read, return a NULL pointer. */ char * filesys_read_info_file (pathname, filesize, finfo, is_compressed) char *pathname; long *filesize; struct stat *finfo; int *is_compressed; { long st_size; *filesize = filesys_error_number = 0; if (compressed_filename_p (pathname)) { *is_compressed = 1; return (filesys_read_compressed (pathname, filesize, finfo)); } else { int descriptor; char *contents; *is_compressed = 0; descriptor = open (pathname, O_RDONLY | O_BINARY, 0666); /* If the file couldn't be opened, give up. */ if (descriptor < 0) { filesys_error_number = errno; return ((char *)NULL); } /* Try to read the contents of this file. */ st_size = (long) finfo->st_size; contents = (char *)xmalloc (1 + st_size); if ((read (descriptor, contents, st_size)) != st_size) { filesys_error_number = errno; close (descriptor); free (contents); return ((char *)NULL); } close (descriptor); /* Convert any DOS-style CRLF EOLs into Unix-style NL. Seems like a good idea to have even on Unix, in case the Info files are coming from some Windows system across a network. */ *filesize = convert_eols (contents, st_size); /* EOL conversion can shrink the text quite a bit. We don't want to waste storage. */ if (*filesize < st_size) contents = (char *)xrealloc (contents, 1 + *filesize); return (contents); } } /* Typically, pipe buffers are 4k. */ #define BASIC_PIPE_BUFFER (4 * 1024) /* We use some large multiple of that. */ #define FILESYS_PIPE_BUFFER_SIZE (16 * BASIC_PIPE_BUFFER) char * filesys_read_compressed (pathname, filesize, finfo) char *pathname; long *filesize; struct stat *finfo; { FILE *stream; char *command, *decompressor; char *contents = (char *)NULL; *filesize = filesys_error_number = 0; decompressor = filesys_decompressor_for_file (pathname); if (!decompressor) return ((char *)NULL); command = (char *)xmalloc (15 + strlen (pathname) + strlen (decompressor)); /* Explicit .exe suffix makes the diagnostics of `popen' better on systems where COMMAND.COM is the stock shell. */ sprintf (command, "%s%s < %s", decompressor, STRIP_DOT_EXE ? ".exe" : "", pathname); #if !defined (BUILDING_LIBRARY) if (info_windows_initialized_p) { char *temp; temp = (char *)xmalloc (5 + strlen (command)); sprintf (temp, "%s...", command); message_in_echo_area ("%s", temp); free (temp); } #endif /* !BUILDING_LIBRARY */ stream = popen (command, FOPEN_RBIN); free (command); /* Read chunks from this file until there are none left to read. */ if (stream) { - int offset, size; + long offset, size; char *chunk; offset = size = 0; chunk = (char *)xmalloc (FILESYS_PIPE_BUFFER_SIZE); while (1) { int bytes_read; bytes_read = fread (chunk, 1, FILESYS_PIPE_BUFFER_SIZE, stream); if (bytes_read + offset >= size) contents = (char *)xrealloc (contents, size += (2 * FILESYS_PIPE_BUFFER_SIZE)); memcpy (contents + offset, chunk, bytes_read); offset += bytes_read; if (bytes_read != FILESYS_PIPE_BUFFER_SIZE) break; } free (chunk); if (pclose (stream) == -1) { if (contents) free (contents); contents = (char *)NULL; filesys_error_number = errno; } else { *filesize = convert_eols (contents, offset); contents = (char *)xrealloc (contents, 1 + *filesize); } } else { filesys_error_number = errno; } #if !defined (BUILDING_LIBARARY) if (info_windows_initialized_p) unmessage_in_echo_area (); #endif /* !BUILDING_LIBRARY */ return (contents); } /* Return non-zero if FILENAME belongs to a compressed file. */ int compressed_filename_p (filename) char *filename; { char *decompressor; /* Find the final extension of this filename, and see if it matches one of our known ones. */ decompressor = filesys_decompressor_for_file (filename); if (decompressor) return (1); else return (0); } /* Return the command string that would be used to decompress FILENAME. */ char * filesys_decompressor_for_file (filename) char *filename; { register int i; char *extension = (char *)NULL; /* Find the final extension of FILENAME, and see if it appears in our list of known compression extensions. */ for (i = strlen (filename) - 1; i > 0; i--) if (filename[i] == '.') { extension = filename + i; break; } if (!extension) return ((char *)NULL); for (i = 0; compress_suffixes[i].suffix; i++) if (FILENAME_CMP (extension, compress_suffixes[i].suffix) == 0) return (compress_suffixes[i].decompressor); #if defined (__MSDOS__) /* If no other suffix matched, allow any extension which ends with `z' to be decompressed by gunzip. Due to limited 8+3 DOS file namespace, we can expect many such cases, and supporting every weird suffix thus produced would be a pain. */ if (extension[strlen (extension) - 1] == 'z' || extension[strlen (extension) - 1] == 'Z') return "gunzip"; #endif return ((char *)NULL); } /* The number of the most recent file system error. */ int filesys_error_number = 0; /* A function which returns a pointer to a static buffer containing an error message for FILENAME and ERROR_NUM. */ static char *errmsg_buf = (char *)NULL; static int errmsg_buf_size = 0; char * filesys_error_string (filename, error_num) char *filename; int error_num; { int len; char *result; if (error_num == 0) return ((char *)NULL); result = strerror (error_num); len = 4 + strlen (filename) + strlen (result); if (len >= errmsg_buf_size) errmsg_buf = (char *)xrealloc (errmsg_buf, (errmsg_buf_size = 2 + len)); sprintf (errmsg_buf, "%s: %s", filename, result); return (errmsg_buf); } -/* Check for FILENAME eq "dir" first, then all the compression - suffixes. */ +/* Check for "dir" with all the possible info and compression suffixes, + in combination. */ int is_dir_name (filename) char *filename; { unsigned i; - if (strcasecmp (filename, "dir") == 0) - return 1; - - for (i = 0; compress_suffixes[i].suffix; i++) + + for (i = 0; info_suffixes[i]; i++) { - char dir_compressed[50]; /* can be short */ - strcpy (dir_compressed, "dir"); - strcat (dir_compressed, compress_suffixes[i].suffix); - if (strcasecmp (filename, dir_compressed) == 0) + unsigned c; + char trydir[50]; + strcpy (trydir, "dir"); + strcat (trydir, info_suffixes[i]); + + if (strcasecmp (filename, trydir) == 0) return 1; - } - + + for (c = 0; compress_suffixes[c].suffix; c++) + { + char dir_compressed[50]; /* can be short */ + strcpy (dir_compressed, trydir); + strcat (dir_compressed, compress_suffixes[c].suffix); + if (strcasecmp (filename, dir_compressed) == 0) + return 1; + } + } + return 0; } diff --git a/contrib/texinfo/info/info.c b/contrib/texinfo/info/info.c index 4f4999c85b16..33aacdf09a44 100644 --- a/contrib/texinfo/info/info.c +++ b/contrib/texinfo/info/info.c @@ -1,620 +1,646 @@ /* info.c -- Display nodes of Info files in multiple windows. - $Id: info.c,v 1.41 1999/09/25 16:10:04 karl Exp $ + $Id: info.c,v 1.53 2002/03/02 15:18:58 karl Exp $ - Copyright (C) 1993, 96, 97, 98, 99 Free Software Foundation, Inc. + Copyright (C) 1993, 96, 97, 98, 99, 2000, 01, 02 + 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). */ #include "info.h" #include "indices.h" #include "dribble.h" #include "getopt.h" #if defined (HANDLE_MAN_PAGES) # include "man.h" #endif /* HANDLE_MAN_PAGES */ static char *program_name = "info"; /* Non-zero means search all indices for APROPOS_SEARCH_STRING. */ static int apropos_p = 0; /* Variable containing the string to search for when apropos_p is non-zero. */ static char *apropos_search_string = (char *)NULL; /* Non-zero means search all indices for INDEX_SEARCH_STRING. Unlike apropos, this puts the user at the node, running info. */ static int index_search_p = 0; /* Non-zero means look for the node which describes the invocation and command-line options of the program, and start the info session at that node. */ static int goto_invocation_p = 0; /* Variable containing the string to search for when index_search_p is non-zero. */ static char *index_search_string = (char *)NULL; /* Non-zero means print version info only. */ static int print_version_p = 0; /* Non-zero means print a short description of the options. */ static int print_help_p = 0; /* Array of the names of nodes that the user specified with "--node" on the command line. */ static char **user_nodenames = (char **)NULL; static int user_nodenames_index = 0; static int user_nodenames_slots = 0; /* String specifying the first file to load. This string can only be set by the user specifying "--file" on the command line. */ static char *user_filename = (char *)NULL; /* String specifying the name of the file to dump nodes to. This value is filled if the user speficies "--output" on the command line. */ static char *user_output_filename = (char *)NULL; /* Non-zero indicates that when "--output" is specified, all of the menu items of the specified nodes (and their subnodes as well) should be dumped in the order encountered. This basically can print a book. */ int dump_subnodes = 0; /* Non-zero means make default keybindings be loosely modeled on vi(1). */ int vi_keys_p = 0; +/* Non-zero means don't remove ANSI escape sequences from man pages. */ +int raw_escapes_p = 0; + #ifdef __MSDOS__ /* Non-zero indicates that screen output should be made 'speech-friendly'. Since on MSDOS the usual behavior is to write directly to the video memory, speech synthesizer software cannot grab the output. Therefore, we provide a user option which tells us to avoid direct screen output and use stdout instead (which loses the color output). */ int speech_friendly = 0; #endif /* Structure describing the options that Info accepts. We pass this structure to getopt_long (). If you add or otherwise change this structure, you must also change the string which follows it. */ #define APROPOS_OPTION 1 #define DRIBBLE_OPTION 2 #define RESTORE_OPTION 3 #define IDXSRCH_OPTION 4 static struct option long_options[] = { { "apropos", 1, 0, APROPOS_OPTION }, { "directory", 1, 0, 'd' }, { "node", 1, 0, 'n' }, { "file", 1, 0, 'f' }, { "subnodes", 0, &dump_subnodes, 1 }, { "output", 1, 0, 'o' }, + { "raw-escapes", 0, &raw_escapes_p, 1 }, { "show-options", 0, 0, 'O' }, { "usage", 0, 0, 'O' }, { "vi-keys", 0, &vi_keys_p, 1 }, { "help", 0, &print_help_p, 1 }, { "version", 0, &print_version_p, 1 }, { "dribble", 1, 0, DRIBBLE_OPTION }, { "restore", 1, 0, RESTORE_OPTION }, #ifdef __MSDOS__ { "speech-friendly", 0, &speech_friendly, 1 }, #endif { "index-search", 1, 0, IDXSRCH_OPTION }, {NULL, 0, NULL, 0} }; /* String describing the shorthand versions of the long options found above. */ #ifdef __MSDOS__ -static char *short_options = "d:n:f:o:Osb"; +static char *short_options = "d:n:f:o:ORsb"; #else -static char *short_options = "d:n:f:o:Os"; +static char *short_options = "d:n:f:o:ORs"; #endif /* When non-zero, the Info window system has been initialized. */ int info_windows_initialized_p = 0; /* Some "forward" declarations. */ static void info_short_help (), remember_info_program_name (); static void init_messages (); +extern void add_file_directory_to_path (); /* **************************************************************** */ /* */ /* Main Entry Point to the Info Program */ /* */ /* **************************************************************** */ int main (argc, argv) int argc; char **argv; { int getopt_long_index; /* Index returned by getopt_long (). */ NODE *initial_node; /* First node loaded by Info. */ #ifdef HAVE_SETLOCALE /* Set locale via LC_ALL. */ setlocale (LC_ALL, ""); #endif /* Set the text message domain. */ bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); init_messages (); while (1) { int option_character; option_character = getopt_long (argc, argv, short_options, long_options, &getopt_long_index); /* getopt_long () returns EOF when there are no more long options. */ if (option_character == EOF) break; /* If this is a long option, then get the short version of it. */ if (option_character == 0 && long_options[getopt_long_index].flag == 0) option_character = long_options[getopt_long_index].val; /* Case on the option that we have received. */ switch (option_character) { case 0: break; /* User wants to add a directory. */ case 'd': info_add_path (optarg, INFOPATH_PREPEND); break; /* User is specifying a particular node. */ case 'n': add_pointer_to_array (optarg, user_nodenames_index, user_nodenames, user_nodenames_slots, 10, char *); break; /* User is specifying a particular Info file. */ case 'f': if (user_filename) free (user_filename); user_filename = xstrdup (optarg); break; /* User is specifying the name of a file to output to. */ case 'o': if (user_output_filename) free (user_output_filename); user_output_filename = xstrdup (optarg); break; /* User has specified that she wants to find the "Options" or "Invocation" node for the program. */ case 'O': goto_invocation_p = 1; break; + /* User has specified that she wants the escape sequences + in man pages to be passed thru unaltered. */ + case 'R': + raw_escapes_p = 1; + break; + /* User is specifying that she wishes to dump the subnodes of the node that she is dumping. */ case 's': dump_subnodes = 1; break; #ifdef __MSDOS__ - /* User specifies that she wants speech-friendly output. */ + /* User wants speech-friendly output. */ case 'b': speech_friendly = 1; break; #endif /* __MSDOS__ */ /* User has specified a string to search all indices for. */ case APROPOS_OPTION: apropos_p = 1; maybe_free (apropos_search_string); apropos_search_string = xstrdup (optarg); break; /* User has specified a dribble file to receive keystrokes. */ case DRIBBLE_OPTION: close_dribble_file (); open_dribble_file (optarg); break; /* User has specified an alternate input stream. */ case RESTORE_OPTION: info_set_input_from_file (optarg); break; /* User has specified a string to search all indices for. */ case IDXSRCH_OPTION: index_search_p = 1; maybe_free (index_search_string); index_search_string = xstrdup (optarg); break; default: fprintf (stderr, _("Try --help for more information.\n")); xexit (1); } } /* If the output device is not a terminal, and no output filename has been specified, make user_output_filename be "-", so that the info is written to stdout, and turn on the dumping of subnodes. */ if ((!isatty (fileno (stdout))) && (user_output_filename == (char *)NULL)) { user_output_filename = xstrdup ("-"); dump_subnodes = 1; } /* If the user specified --version, then show the version and exit. */ if (print_version_p) { printf ("%s (GNU %s) %s\n", program_name, PACKAGE, VERSION); puts (""); printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\ There is NO warranty. You may redistribute this software\n\ under the terms of the GNU General Public License.\n\ For more information about these matters, see the files named COPYING.\n"), - "1999"); + "2002"); xexit (0); } /* If the `--help' option was present, show the help and exit. */ if (print_help_p) { info_short_help (); xexit (0); } /* If the user hasn't specified a path for Info files, default it. Lowest priority is our messy hardwired list in filesys.h. Then comes the user's INFODIR from the Makefile. Highest priority is the environment variable, if set. */ if (!infopath) { char *path_from_env = getenv ("INFOPATH"); if (path_from_env) { unsigned len = strlen (path_from_env); /* Trailing : on INFOPATH means insert the default path. */ if (len && path_from_env[len - 1] == PATH_SEP[0]) { path_from_env[len - 1] = 0; info_add_path (DEFAULT_INFOPATH, INFOPATH_PREPEND); } #ifdef INFODIR /* from the Makefile */ info_add_path (INFODIR, INFOPATH_PREPEND); #endif info_add_path (path_from_env, INFOPATH_PREPEND); } else { info_add_path (DEFAULT_INFOPATH, INFOPATH_PREPEND); #ifdef INFODIR /* from the Makefile */ info_add_path (INFODIR, INFOPATH_PREPEND); #endif } } /* If the user specified a particular filename, add the path of that file to the contents of INFOPATH. */ if (user_filename) - { - char *directory_name = xstrdup (user_filename); - char *temp = filename_non_directory (directory_name); - - if (temp != directory_name) - { - if (HAVE_DRIVE (directory_name) && temp == directory_name + 2) - { - /* The directory of "d:foo" is stored as "d:.", to avoid - mixing it with "d:/" when a slash is appended. */ - *temp = '.'; - temp += 2; - } - temp[-1] = 0; - info_add_path (directory_name, INFOPATH_PREPEND); - } - - free (directory_name); - } + add_file_directory_to_path (user_filename); /* If the user wants to search every known index for a given string, do that now, and report the results. */ if (apropos_p) { info_apropos (apropos_search_string); xexit (0); } /* Get the initial Info node. It is either "(dir)Top", or what the user specifed with values in user_filename and user_nodenames. */ initial_node = info_get_node (user_filename, user_nodenames ? user_nodenames[0] : 0); /* If we couldn't get the initial node, this user is in trouble. */ if (!initial_node) { if (info_recent_file_error) info_error (info_recent_file_error); else info_error (msg_cant_find_node, user_nodenames ? user_nodenames[0] : "Top"); xexit (1); } /* Special cases for when the user specifies multiple nodes. If we are dumping to an output file, dump all of the nodes specified. Otherwise, attempt to create enough windows to handle the nodes that this user wants displayed. */ if (user_nodenames_index > 1) { free (initial_node); if (user_output_filename) dump_nodes_to_file (user_filename, user_nodenames, user_output_filename, dump_subnodes); else begin_multiple_window_info_session (user_filename, user_nodenames); xexit (0); } /* If there are arguments remaining, they are the names of menu items in sequential info files starting from the first one loaded. That file name is either "dir", or the contents of user_filename if one was specified. */ { char *errstr, *errarg1, *errarg2; NODE *new_initial_node = info_follow_menus (initial_node, argv + optind, &errstr, &errarg1, &errarg2); + if (new_initial_node && new_initial_node != initial_node) initial_node = new_initial_node; /* If the user specified that this node should be output, then do that now. Otherwise, start the Info session with this node. Or act accordingly if the initial node was not found. */ - if (user_output_filename) + if (user_output_filename && !goto_invocation_p) { if (!errstr) dump_node_to_file (initial_node, user_output_filename, dump_subnodes); else info_error (errstr, errarg1, errarg2); } else { if (errstr) begin_info_session_with_error (initial_node, errstr, errarg1, errarg2); /* If the user specified `--index-search=STRING' or --show-options, start the info session in the node corresponding to what they want. */ else if (index_search_p || goto_invocation_p) { int status = 0; initialize_info_session (initial_node, 0); if (goto_invocation_p || index_entry_exists (windows, index_search_string)) { terminal_prep_terminal (); terminal_clear_screen (); info_last_executed_command = (VFunction *)NULL; if (index_search_p) do_info_index_search (windows, 0, index_search_string); else { /* If they said "info --show-options foo bar baz", the last of the arguments is the program whose options they want to see. */ char **p = argv + optind; char *program; if (*p) { while (p[1]) p++; program = xstrdup (*p); } else if (user_filename) /* If there's no command-line arguments to supply the program name, use the Info file name (sans extension and leading directories) instead. */ program = program_name_from_file_name (user_filename); else program = xstrdup (""); info_intuit_options_node (windows, initial_node, program); free (program); } - info_read_and_dispatch (); + if (user_output_filename) + { + dump_node_to_file (windows->node, user_output_filename, + dump_subnodes); + } + else + info_read_and_dispatch (); /* On program exit, leave the cursor at the bottom of the window, and restore the terminal IO. */ terminal_goto_xy (0, screenheight - 1); terminal_clear_to_eol (); fflush (stdout); terminal_unprep_terminal (); } else { fprintf (stderr, _("no index entries found for `%s'\n"), index_search_string); status = 2; } close_dribble_file (); xexit (status); } else begin_info_session (initial_node); } xexit (0); } } +void +add_file_directory_to_path (filename) + char *filename; +{ + char *directory_name = xstrdup (filename); + char *temp = filename_non_directory (directory_name); + + if (temp != directory_name) + { + if (HAVE_DRIVE (directory_name) && temp == directory_name + 2) + { + /* The directory of "d:foo" is stored as "d:.", to avoid + mixing it with "d:/" when a slash is appended. */ + *temp = '.'; + temp += 2; + } + temp[-1] = 0; + info_add_path (directory_name, INFOPATH_PREPEND); + } + + free (directory_name); +} + /* Error handling. */ /* Non-zero if an error has been signalled. */ int info_error_was_printed = 0; /* Non-zero means ring terminal bell on errors. */ int info_error_rings_bell_p = 1; /* Print FORMAT with ARG1 and ARG2. If the window system was initialized, then the message is printed in the echo area. Otherwise, a message is output to stderr. */ void info_error (format, arg1, arg2) char *format; void *arg1, *arg2; { info_error_was_printed = 1; if (!info_windows_initialized_p || display_inhibited) { fprintf (stderr, "%s: ", program_name); fprintf (stderr, format, arg1, arg2); fprintf (stderr, "\n"); fflush (stderr); } else { if (!echo_area_is_active) { if (info_error_rings_bell_p) terminal_ring_bell (); window_message_in_echo_area (format, arg1, arg2); } else { NODE *temp; temp = build_message_node (format, arg1, arg2); if (info_error_rings_bell_p) terminal_ring_bell (); inform_in_echo_area (temp->contents); free (temp->contents); free (temp); } } } /* Produce a scaled down description of the available options to Info. */ static void info_short_help () { +#ifdef __MSDOS__ + static const char speech_friendly_string[] = N_("\ + --speech-friendly be friendly to speech synthesizers.\n"); +#else + static const char speech_friendly_string[] = ""; +#endif + + printf (_("\ Usage: %s [OPTION]... [MENU-ITEM...]\n\ \n\ Read documentation in Info format.\n\ \n\ Options:\n\ --apropos=SUBJECT look up SUBJECT in all indices of all manuals.\n\ --directory=DIR add DIR to INFOPATH.\n\ --dribble=FILENAME remember user keystrokes in FILENAME.\n\ --file=FILENAME specify Info file to visit.\n\ --help display this help and exit.\n\ --index-search=STRING go to node pointed by index entry STRING.\n\ --node=NODENAME specify nodes in first visited Info file.\n\ --output=FILENAME output selected nodes to FILENAME.\n\ + --raw-escapes don't remove ANSI escapes from man pages.\n\ --restore=FILENAME read initial keystrokes from FILENAME.\n\ - --show-options, --usage go to command-line options node.\n\ - --subnodes recursively output menu items.\n%s\ + --show-options, --usage go to command-line options node.\n%s\ + --subnodes recursively output menu items.\n\ --vi-keys use vi-like and less-like key bindings.\n\ --version display version information and exit.\n\ \n\ The first non-option argument, if present, is the menu entry to start from;\n\ it is searched for in all `dir' files along INFOPATH.\n\ If it is not present, info merges all `dir' files and shows the result.\n\ Any remaining arguments are treated as the names of menu\n\ items relative to the initial node visited.\n\ \n\ Examples:\n\ info show top-level dir menu\n\ info emacs start at emacs node from top-level dir\n\ info emacs buffers start at buffers node within emacs manual\n\ info --show-options emacs start at node with emacs' command line options\n\ info -f ./foo.info show file ./foo.info, not searching dir\n\ \n\ Email bug reports to bug-texinfo@gnu.org,\n\ general questions and discussion to help-texinfo@gnu.org.\n\ "), - program_name, -#ifdef __MSDOS__ -"\ - --speech-friendly be friendly to speech synthesizers.\n" -#else -"" -#endif - ); + program_name, speech_friendly_string); xexit (0); } /* Initialize strings for gettext. Because gettext doesn't handle N_ or _ within macro definitions, we put shared messages into variables and use them that way. This also has the advantage that there's only one copy of the strings. */ char *msg_cant_find_node; char *msg_cant_file_node; char *msg_cant_find_window; char *msg_cant_find_point; char *msg_cant_kill_last; char *msg_no_menu_node; char *msg_no_foot_node; char *msg_no_xref_node; char *msg_no_pointer; char *msg_unknown_command; char *msg_term_too_dumb; char *msg_at_node_bottom; char *msg_at_node_top; char *msg_one_window; char *msg_win_too_small; char *msg_cant_make_help; static void init_messages () { msg_cant_find_node = _("Cannot find node `%s'."); msg_cant_file_node = _("Cannot find node `(%s)%s'."); msg_cant_find_window = _("Cannot find a window!"); msg_cant_find_point = _("Point doesn't appear within this window's node!"); msg_cant_kill_last = _("Cannot delete the last window."); msg_no_menu_node = _("No menu in this node."); msg_no_foot_node = _("No footnotes in this node."); msg_no_xref_node = _("No cross references in this node."); msg_no_pointer = _("No `%s' pointer for this node."); msg_unknown_command = _("Unknown Info command `%c'; try `?' for help."); msg_term_too_dumb = _("Terminal type `%s' is not smart enough to run Info."); msg_at_node_bottom = _("You are already at the last page of this node."); msg_at_node_top = _("You are already at the first page of this node."); msg_one_window = _("Only one window."); msg_win_too_small = _("Resulting window would be too small."); msg_cant_make_help = _("Not enough room for a help window, please delete a window."); } diff --git a/contrib/texinfo/info/info.h b/contrib/texinfo/info/info.h index 2f85d807bdbc..1746660548d2 100644 --- a/contrib/texinfo/info/info.h +++ b/contrib/texinfo/info/info.h @@ -1,160 +1,161 @@ /* info.h -- Header file which includes all of the other headers. - $Id: info.h,v 1.14 1999/09/25 16:10:04 karl Exp $ + $Id: info.h,v 1.16 2002/02/23 19:12:02 karl Exp $ - Copyright (C) 1993, 97, 98, 99 Free Software Foundation, Inc. + Copyright (C) 1993, 97, 98, 99, 2001 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). */ #ifndef INFO_H #define INFO_H /* We always want these, so why clutter up the compile command? */ #define HANDLE_MAN_PAGES #define NAMED_FUNCTIONS +#define INFOKEY /* System dependencies. */ #include "system.h" /* Some of our other include files use these. */ typedef int Function (); typedef void VFunction (); typedef char *CFunction (); - #include "filesys.h" +#include "doc.h" #include "display.h" #include "session.h" #include "echo-area.h" -#include "doc.h" #include "footnotes.h" #include "gc.h" #define info_toupper(x) (islower (x) ? toupper (x) : x) #define info_tolower(x) (isupper (x) ? tolower (x) : x) #if !defined (whitespace) # define whitespace(c) ((c == ' ') || (c == '\t')) #endif /* !whitespace */ #if !defined (whitespace_or_newline) # define whitespace_or_newline(c) (whitespace (c) || (c == '\n')) #endif /* !whitespace_or_newline */ /* Add POINTER to the list of pointers found in ARRAY. SLOTS is the number of slots that have already been allocated. INDEX is the index into the array where POINTER should be added. GROW is the number of slots to grow ARRAY by, in the case that it needs growing. TYPE is a cast of the type of object stored in ARRAY (e.g., NODE_ENTRY *. */ #define add_pointer_to_array(pointer, idx, array, slots, grow, type) \ do { \ if (idx + 2 >= slots) \ array = (type *)(xrealloc (array, (slots += grow) * sizeof (type))); \ array[idx++] = (type)pointer; \ array[idx] = (type)NULL; \ } while (0) #define maybe_free(x) do { if (x) free (x); } while (0) #if !defined (zero_mem) && defined (HAVE_MEMSET) # define zero_mem(mem, length) memset (mem, 0, length) #endif /* !zero_mem && HAVE_MEMSET */ #if !defined (zero_mem) && defined (HAVE_BZERO) # define zero_mem(mem, length) bzero (mem, length) #endif /* !zero_mem && HAVE_BZERO */ #if !defined (zero_mem) # define zero_mem(mem, length) \ do { \ register int zi; \ register unsigned char *place; \ \ place = (unsigned char *)mem; \ for (zi = 0; zi < length; zi++) \ place[zi] = 0; \ } while (0) #endif /* !zero_mem */ /* A structure associating the nodes visited in a particular window. */ typedef struct { WINDOW *window; /* The window that this list is attached to. */ NODE **nodes; /* Array of nodes visited in this window. */ int *pagetops; /* For each node in NODES, the pagetop. */ long *points; /* For each node in NODES, the point. */ int current; /* Index in NODES of the current node. */ int nodes_index; /* Index where to add the next node. */ int nodes_slots; /* Number of slots allocated to NODES. */ } INFO_WINDOW; /* Array of structures describing for each window which nodes have been visited in that window. */ extern INFO_WINDOW **info_windows; /* For handling errors. If you initialize the window system, you should also set info_windows_initialized_p to non-zero. It is used by the info_error () function to determine how to format and output errors. */ extern int info_windows_initialized_p; /* Non-zero if an error message has been printed. */ extern int info_error_was_printed; /* Non-zero means ring terminal bell on errors. */ extern int info_error_rings_bell_p; /* Non-zero means default keybindings are loosely modeled on vi(1). */ extern int vi_keys_p; +/* Non-zero means don't remove ANSI escape sequences from man pages. */ +extern int raw_escapes_p; + /* Print FORMAT with ARG1 and ARG2. If the window system was initialized, then the message is printed in the echo area. Otherwise, a message is output to stderr. */ extern void info_error (); -/* The version numbers of Info. */ -extern int info_major_version, info_minor_version; - /* Error message defines. */ extern char *msg_cant_find_node; extern char *msg_cant_file_node; extern char *msg_cant_find_window; extern char *msg_cant_find_point; extern char *msg_cant_kill_last; extern char *msg_no_menu_node; extern char *msg_no_foot_node; extern char *msg_no_xref_node; extern char *msg_no_pointer; extern char *msg_unknown_command; extern char *msg_term_too_dumb; extern char *msg_at_node_bottom; extern char *msg_at_node_top; extern char *msg_one_window; extern char *msg_win_too_small; extern char *msg_cant_make_help; -/* Found in info-utils.c. */ -extern char *filename_non_directory (); +extern char *filename_non_directory (); /* Found in info-utils.c. */ -#if !defined (BUILDING_LIBRARY) -/* Found in session.c */ -extern int info_windows_initialized_p; +#if defined(INFOKEY) +extern void set_variable_to_value (); /* Found in variables.c. */ +#endif /* INFOKEY */ +#if !defined (BUILDING_LIBRARY) +extern int info_windows_initialized_p; /* Found in session.c */ /* Found in window.c. */ extern void message_in_echo_area (), unmessage_in_echo_area (); #endif /* !BUILDING_LIBRARY */ #endif /* !INFO_H */ diff --git a/contrib/texinfo/info/infodoc.c b/contrib/texinfo/info/infodoc.c index 2b70918092a2..731cb481552f 100644 --- a/contrib/texinfo/info/infodoc.c +++ b/contrib/texinfo/info/infodoc.c @@ -1,855 +1,1194 @@ /* infodoc.c -- Functions which build documentation nodes. - $Id: infodoc.c,v 1.23 1999/09/25 16:10:04 karl Exp $ + $Id: infodoc.c,v 1.28 2002/02/27 13:37:33 karl Exp $ - Copyright (C) 1993, 97, 98, 99 Free Software Foundation, Inc. + Copyright (C) 1993, 97, 98, 99, 2001, 02 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). */ #include "info.h" +#include "funs.h" /* HELP_NODE_GETS_REGENERATED is always defined now that keys may get rebound, or other changes in the help text may occur. */ #define HELP_NODE_GETS_REGENERATED 1 -/* **************************************************************** */ -/* */ -/* Info Help Windows */ -/* */ -/* **************************************************************** */ - /* The name of the node used in the help window. */ static char *info_help_nodename = "*Info Help*"; /* A node containing printed key bindings and their documentation. */ static NODE *internal_info_help_node = (NODE *)NULL; /* A pointer to the contents of the help node. */ static char *internal_info_help_node_contents = (char *)NULL; -/* The static text which appears in the internal info help node. */ +/* The (more or less) static text which appears in the internal info + help node. The actual key bindings are inserted. Keep the + underlines (****, etc.) in the same N_ call as the text lines they + refer to, so translations can make the number of *'s or -'s match. */ +#if defined(INFOKEY) + +static char *info_internal_help_text[] = { + N_("Basic Commands in Info Windows\n\ +******************************\n"), + "\n", + N_("\\%-10[quit-help] Quit this help.\n"), + N_("\\%-10[quit] Quit Info altogether.\n"), + N_("\\%-10[get-info-help-node] Invoke the Info tutorial.\n"), + "\n", + N_("Selecting other nodes:\n\ +----------------------\n"), + N_("\\%-10[next-node] Move to the \"next\" node of this node.\n"), + N_("\\%-10[prev-node] Move to the \"previous\" node of this node.\n"), + N_("\\%-10[up-node] Move \"up\" from this node.\n"), + N_("\\%-10[menu-item] Pick menu item specified by name.\n\ + Picking a menu item causes another node to be selected.\n"), + N_("\\%-10[xref-item] Follow a cross reference. Reads name of reference.\n"), + N_("\\%-10[history-node] Move to the last node seen in this window.\n"), + N_("\\%-10[move-to-next-xref] Skip to next hypertext link within this node.\n"), + N_("\\%-10[move-to-prev-xref] Skip to previous hypertext link within this node.\n"), + N_("\\%-10[select-reference-this-line] Follow the hypertext link under cursor.\n"), + N_("\\%-10[dir-node] Move to the `directory' node. Equivalent to `\\[goto-node] (DIR)'.\n"), + N_("\\%-10[top-node] Move to the Top node. Equivalent to `\\[goto-node] Top'.\n"), + "\n", + N_("Moving within a node:\n\ +---------------------\n"), + N_("\\%-10[scroll-forward] Scroll forward a page.\n"), + N_("\\%-10[scroll-backward] Scroll backward a page.\n"), + N_("\\%-10[beginning-of-node] Go to the beginning of this node.\n"), + N_("\\%-10[end-of-node] Go to the end of this node.\n"), + N_("\\%-10[scroll-forward] Scroll forward 1 line.\n"), + N_("\\%-10[scroll-backward] Scroll backward 1 line.\n"), + "\n", + N_("Other commands:\n\ +---------------\n"), + N_("\\%-10[menu-digit] Pick first ... ninth item in node's menu.\n"), + N_("\\%-10[last-menu-item] Pick last item in node's menu.\n"), + N_("\\%-10[index-search] Search for a specified string in the index entries of this Info\n\ + file, and select the node referenced by the first entry found.\n"), + N_("\\%-10[goto-node] Move to node specified by name.\n\ + You may include a filename as well, as in (FILENAME)NODENAME.\n"), + N_("\\%-10[search] Search forward for a specified string\n\ + and select the node in which the next occurrence is found.\n"), + N_("\\%-10[search-backward] Search backward for a specified string\n\ + and select the node in which the previous occurrence is found.\n"), + NULL +}; + +#else /* !INFOKEY */ + static char *info_internal_help_text[] = { - N_("Basic Commands in Info Windows\n"), - N_("******************************\n"), + N_("Basic Commands in Info Windows\n\ +******************************\n"), "\n", N_(" %-10s Quit this help.\n"), N_(" %-10s Quit Info altogether.\n"), N_(" %-10s Invoke the Info tutorial.\n"), "\n", - N_("Moving within a node:\n"), - N_("---------------------\n"), - N_(" %-10s Scroll forward a page.\n"), - N_(" %-10s Scroll backward a page.\n"), - N_(" %-10s Go to the beginning of this node.\n"), - N_(" %-10s Go to the end of this node.\n"), - N_(" %-10s Scroll forward 1 line.\n"), - N_(" %-10s Scroll backward 1 line.\n"), - "\n", - N_("Selecting other nodes:\n"), - N_("----------------------\n"), + N_("Selecting other nodes:\n\ +----------------------\n", N_(" %-10s Move to the `next' node of this node.\n"), N_(" %-10s Move to the `previous' node of this node.\n"), N_(" %-10s Move `up' from this node.\n"), N_(" %-10s Pick menu item specified by name.\n"), N_(" Picking a menu item causes another node to be selected.\n"), N_(" %-10s Follow a cross reference. Reads name of reference.\n"), N_(" %-10s Move to the last node seen in this window.\n"), N_(" %-10s Skip to next hypertext link within this node.\n"), N_(" %-10s Follow the hypertext link under cursor.\n"), N_(" %-10s Move to the `directory' node. Equivalent to `g (DIR)'.\n"), N_(" %-10s Move to the Top node. Equivalent to `g Top'.\n"), "\n", - N_("Other commands:\n"), - N_("---------------\n"), + N_("Moving within a node:\n\ +---------------------\n"), + N_(" %-10s Scroll forward a page.\n"), + N_(" %-10s Scroll backward a page.\n"), + N_(" %-10s Go to the beginning of this node.\n"), + N_(" %-10s Go to the end of this node.\n"), + N_(" %-10s Scroll forward 1 line.\n"), + N_(" %-10s Scroll backward 1 line.\n"), + "\n", + N_("Other commands:\n\ +---------------\n"), N_(" %-10s Pick first ... ninth item in node's menu.\n"), N_(" %-10s Pick last item in node's menu.\n"), N_(" %-10s Search for a specified string in the index entries of this Info\n"), N_(" file, and select the node referenced by the first entry found.\n"), N_(" %-10s Move to node specified by name.\n"), N_(" You may include a filename as well, as in (FILENAME)NODENAME.\n"), - N_(" %-10s Search forward through this Info file for a specified string,\n"), + N_(" %-10s Search forward for a specified string,\n"), N_(" and select the node in which the next occurrence is found.\n"), - N_(" %-10s Search backward in this Info file for a specified string,\n"), + N_(" %-10s Search backward for a specified string\n"), N_(" and select the node in which the next occurrence is found.\n"), NULL }; static char *info_help_keys_text[][2] = { { "", "" }, { "", "" }, { "", "" }, { "CTRL-x 0", "CTRL-x 0" }, { "q", "q" }, { "h", "ESC h" }, { "", "" }, { "", "" }, { "", "" }, { "SPC", "SPC" }, { "DEL", "b" }, { "b", "ESC b" }, { "e", "ESC e" }, { "ESC 1 SPC", "RET" }, { "ESC 1 DEL", "y" }, { "", "" }, { "", "" }, { "", "" }, { "n", "CTRL-x n" }, { "p", "CTRL-x p" }, { "u", "CTRL-x u" }, { "m", "ESC m" }, { "", "" }, { "f", "ESC f" }, { "l", "l" }, { "TAB", "TAB" }, { "RET", "CTRL-x RET" }, { "d", "ESC d" }, { "t", "ESC t" }, { "", "" }, { "", "" }, { "", "" }, { "1-9", "ESC 1-9" }, { "0", "ESC 0" }, { "i", "CTRL-x i" }, { "", "" }, { "g", "CTRL-x g" }, { "", "" }, { "s", "/" }, { "", "" }, { "ESC - s", "?" }, { "", "" }, NULL }; -static char *where_is (), *where_is_internal (); +#endif /* !INFOKEY */ + +static char *where_is_internal (); void dump_map_to_message_buffer (prefix, map) char *prefix; Keymap map; { register int i; + unsigned prefix_len = strlen (prefix); + char *new_prefix = (char *)xmalloc (prefix_len + 2); + + strncpy (new_prefix, prefix, prefix_len); + new_prefix[prefix_len + 1] = '\0'; for (i = 0; i < 256; i++) { + new_prefix[prefix_len] = i; if (map[i].type == ISKMAP) { - char *new_prefix, *keyname; - - keyname = pretty_keyname (i); - new_prefix = (char *) - xmalloc (3 + strlen (prefix) + strlen (keyname)); - sprintf (new_prefix, "%s%s%s ", prefix, *prefix ? " " : "", keyname); - dump_map_to_message_buffer (new_prefix, (Keymap)map[i].function); - free (new_prefix); } else if (map[i].function) { register int last; char *doc, *name; doc = function_documentation (map[i].function); name = function_name (map[i].function); if (!*doc) continue; /* Find out if there is a series of identical functions, as in ea_insert (). */ for (last = i + 1; last < 256; last++) if ((map[last].type != ISFUNC) || (map[last].function != map[i].function)) break; if (last - 1 != i) { - printf_to_message_buffer - ("%s%s .. ", prefix, pretty_keyname (i)); - printf_to_message_buffer - ("%s%s\t", prefix, pretty_keyname (last - 1)); + printf_to_message_buffer ("%s .. ", pretty_keyseq (new_prefix)); + new_prefix[prefix_len] = last - 1; + printf_to_message_buffer ("%s\t", pretty_keyseq (new_prefix)); i = last - 1; } else - printf_to_message_buffer ("%s%s\t", prefix, pretty_keyname (i)); + printf_to_message_buffer ("%s\t", pretty_keyseq (new_prefix)); #if defined (NAMED_FUNCTIONS) /* Print the name of the function, and some padding before the documentation string is printed. */ { int length_so_far; int desired_doc_start = 40; /* Must be multiple of 8. */ printf_to_message_buffer ("(%s)", name); length_so_far = message_buffer_length_this_line (); if ((desired_doc_start + strlen (doc)) >= the_screen->width) printf_to_message_buffer ("\n "); else { while (length_so_far < desired_doc_start) { printf_to_message_buffer ("\t"); length_so_far += character_width ('\t', length_so_far); } } } #endif /* NAMED_FUNCTIONS */ printf_to_message_buffer ("%s\n", doc); } } + free (new_prefix); } /* How to create internal_info_help_node. HELP_IS_ONLY_WINDOW_P says whether we're going to end up in a second (or more) window of our own, or whether there's only one window and we're going to usurp it. This determines how to quit the help window. Maybe we should just make q do the right thing in both cases. */ static void create_internal_info_help_node (help_is_only_window_p) int help_is_only_window_p; { register int i; NODE *node; char *contents = NULL; + char *exec_keys; #ifndef HELP_NODE_GETS_REGENERATED if (internal_info_help_node_contents) contents = internal_info_help_node_contents; #endif /* !HELP_NODE_GETS_REGENERATED */ if (!contents) { int printed_one_mx = 0; initialize_message_buffer (); for (i = 0; info_internal_help_text[i]; i++) { +#ifdef INFOKEY + printf_to_message_buffer (replace_in_documentation ( + _(info_internal_help_text[i]), help_is_only_window_p)); +#else /* Don't translate blank lines, gettext outputs the po file header in that case. We want a blank line. */ char *msg = *(info_internal_help_text[i]) ? _(info_internal_help_text[i]) : info_internal_help_text[i]; char *key = info_help_keys_text[i][vi_keys_p]; /* If we have only one window (because the window size was too small to split it), CTRL-x 0 doesn't work to `quit' help. */ if (STREQ (key, "CTRL-x 0") && help_is_only_window_p) key = "l"; printf_to_message_buffer (msg, key); +#endif /* !INFOKEY */ } printf_to_message_buffer ("---------------------\n\n"); printf_to_message_buffer (_("The current search path is:\n")); printf_to_message_buffer (" %s\n", infopath); printf_to_message_buffer ("---------------------\n\n"); printf_to_message_buffer (_("Commands available in Info windows:\n\n")); dump_map_to_message_buffer ("", info_keymap); printf_to_message_buffer ("---------------------\n\n"); printf_to_message_buffer (_("Commands available in the echo area:\n\n")); dump_map_to_message_buffer ("", echo_area_keymap); #if defined (NAMED_FUNCTIONS) - /* Get a list of the M-x commands which have no keystroke equivs. */ + /* Get a list of commands which have no keystroke equivs. */ + exec_keys = where_is (info_keymap, InfoCmd(info_execute_command)); + if (exec_keys) + exec_keys = xstrdup (exec_keys); for (i = 0; function_doc_array[i].func; i++) { - VFunction *func = function_doc_array[i].func; + InfoCommand *cmd = DocInfoCmd(&function_doc_array[i]); - if ((!where_is_internal (info_keymap, func)) && - (!where_is_internal (echo_area_keymap, func))) + if (InfoFunction(cmd) != info_do_lowercase_version + && !where_is_internal (info_keymap, cmd) + && !where_is_internal (echo_area_keymap, cmd)) { if (!printed_one_mx) { printf_to_message_buffer ("---------------------\n\n"); - printf_to_message_buffer - (_("The following commands can only be invoked via M-x:\n\n")); + if (exec_keys && exec_keys[0]) + printf_to_message_buffer + (_("The following commands can only be invoked via %s:\n\n"), exec_keys); + else + printf_to_message_buffer + (_("The following commands cannot be invoked at all:\n\n")); printed_one_mx = 1; } printf_to_message_buffer - ("M-x %s\n %s\n", + ("%s %s\n %s\n", + exec_keys, function_doc_array[i].func_name, replace_in_documentation (strlen (function_doc_array[i].doc) - == 0 - ? function_doc_array[i].doc - : _(function_doc_array[i].doc))); + ? _(function_doc_array[i].doc) + : "") + ); } } if (printed_one_mx) printf_to_message_buffer ("\n"); + + maybe_free (exec_keys); #endif /* NAMED_FUNCTIONS */ printf_to_message_buffer ("%s", replace_in_documentation (_("--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n"))); node = message_buffer_to_node (); internal_info_help_node_contents = node->contents; } else { /* We already had the right contents, so simply use them. */ node = build_message_node ("", 0, 0); free (node->contents); node->contents = contents; node->nodelen = 1 + strlen (contents); } internal_info_help_node = node; /* Do not GC this node's contents. It never changes, and we never need to delete it once it is made. If you change some things (such as placing information about dynamic variables in the help text) then you will need to allow the contents to be gc'd, and you will have to arrange to always regenerate the help node. */ #if defined (HELP_NODE_GETS_REGENERATED) add_gcable_pointer (internal_info_help_node->contents); #endif name_internal_node (internal_info_help_node, info_help_nodename); /* Even though this is an internal node, we don't want the window system to treat it specially. So we turn off the internalness of it here. */ internal_info_help_node->flags &= ~N_IsInternal; } /* Return a window which is the window showing help in this Info. */ /* If the eligible window's height is >= this, split it to make the help window. Otherwise display the help window in the current window. */ #define HELP_SPLIT_SIZE 24 static WINDOW * info_find_or_create_help_window () { int help_is_only_window_p; WINDOW *eligible = NULL; WINDOW *help_window = get_window_of_node (internal_info_help_node); /* If we couldn't find the help window, then make it. */ if (!help_window) { WINDOW *window; int max = 0; for (window = windows; window; window = window->next) { if (window->height > max) { max = window->height; eligible = window; } } if (!eligible) return NULL; } #ifndef HELP_NODE_GETS_REGENERATED else /* help window is static, just return it. */ return help_window; #endif /* not HELP_NODE_GETS_REGENERATED */ /* Make sure that we have a node containing the help text. The argument is false if help will be the only window (so l must be used to quit help), true if help will be one of several visible windows (so CTRL-x 0 must be used to quit help). */ help_is_only_window_p = (help_window && !windows->next || !help_window && eligible->height < HELP_SPLIT_SIZE); create_internal_info_help_node (help_is_only_window_p); /* Either use the existing window to display the help node, or create a new window if there was no existing help window. */ if (!help_window) { /* Split the largest window into 2 windows, and show the help text in that window. */ if (eligible->height >= HELP_SPLIT_SIZE) { active_window = eligible; help_window = window_make_window (internal_info_help_node); } else { set_remembered_pagetop_and_point (active_window); window_set_node_of_window (active_window, internal_info_help_node); help_window = active_window; } } else { /* Case where help node always gets regenerated, and we have an existing window in which to place the node. */ if (active_window != help_window) { set_remembered_pagetop_and_point (active_window); active_window = help_window; } window_set_node_of_window (active_window, internal_info_help_node); } remember_window_and_node (help_window, help_window->node); return help_window; } /* Create or move to the help window. */ DECLARE_INFO_COMMAND (info_get_help_window, _("Display help message")) { WINDOW *help_window; help_window = info_find_or_create_help_window (); if (help_window) { active_window = help_window; active_window->flags |= W_UpdateWindow; } else { info_error (msg_cant_make_help); } } /* Show the Info help node. This means that the "info" file is installed where it can easily be found on your system. */ DECLARE_INFO_COMMAND (info_get_info_help_node, _("Visit Info node `(info)Help'")) { NODE *node; char *nodename; /* If there is a window on the screen showing the node "(info)Help" or the node "(info)Help-Small-Screen", simply select that window. */ { WINDOW *win; for (win = windows; win; win = win->next) { if (win->node && win->node->filename && (strcasecmp (filename_non_directory (win->node->filename), "info") == 0) && ((strcmp (win->node->nodename, "Help") == 0) || (strcmp (win->node->nodename, "Help-Small-Screen") == 0))) { active_window = win; return; } } } /* If the current window is small, show the small screen help. */ if (active_window->height < 24) nodename = "Help-Small-Screen"; else nodename = "Help"; /* Try to get the info file for Info. */ node = info_get_node ("Info", nodename); if (!node) { if (info_recent_file_error) info_error (info_recent_file_error); else info_error (msg_cant_file_node, "Info", nodename); } else { /* If the current window is very large (greater than 45 lines), then split it and show the help node in another window. Otherwise, use the current window. */ if (active_window->height > 45) active_window = window_make_window (node); else { set_remembered_pagetop_and_point (active_window); window_set_node_of_window (active_window, node); } remember_window_and_node (active_window, node); } } /* **************************************************************** */ /* */ /* Groveling Info Keymaps and Docs */ /* */ /* **************************************************************** */ /* Return the documentation associated with the Info command FUNCTION. */ char * -function_documentation (function) - VFunction *function; +function_documentation (cmd) + InfoCommand *cmd; { + char *doc; + +#if defined (INFOKEY) + + doc = cmd->doc; + +#else /* !INFOKEY */ + register int i; for (i = 0; function_doc_array[i].func; i++) - if (function == function_doc_array[i].func) + if (InfoFunction(cmd) == function_doc_array[i].func) break; - return replace_in_documentation ((strlen (function_doc_array[i].doc) == 0) - ? function_doc_array[i].doc - : _(function_doc_array[i].doc)); + doc = function_doc_array[i].func ? function_doc_array[i].doc : ""; + +#endif /* !INFOKEY */ + + return replace_in_documentation ((strlen (doc) == 0) ? doc : _(doc)); } #if defined (NAMED_FUNCTIONS) /* Return the user-visible name of the function associated with the Info command FUNCTION. */ char * -function_name (function) - - VFunction *function; +function_name (cmd) + InfoCommand *cmd; { +#if defined (INFOKEY) + + return cmd->func_name; + +#else /* !INFOKEY */ + register int i; for (i = 0; function_doc_array[i].func; i++) - if (function == function_doc_array[i].func) + if (InfoFunction(cmd) == function_doc_array[i].func) break; return (function_doc_array[i].func_name); + +#endif /* !INFOKEY */ } -/* Return a pointer to the function named NAME. */ -VFunction * +/* Return a pointer to the info command for function NAME. */ +InfoCommand * named_function (name) char *name; { register int i; for (i = 0; function_doc_array[i].func; i++) if (strcmp (function_doc_array[i].func_name, name) == 0) break; - return (function_doc_array[i].func); + return (DocInfoCmd(&function_doc_array[i])); } #endif /* NAMED_FUNCTIONS */ /* Return the documentation associated with KEY in MAP. */ char * key_documentation (key, map) char key; Keymap map; { - VFunction *function = map[key].function; + InfoCommand *function = map[key].function; if (function) return (function_documentation (function)); else return ((char *)NULL); } DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY")) { - char keyname[50]; - int keyname_index = 0; + char keys[50]; unsigned char keystroke; - char *rep; + char *k = keys; Keymap map; - keyname[0] = 0; + *k = '\0'; map = window->keymap; for (;;) { - message_in_echo_area (_("Describe key: %s"), keyname); + message_in_echo_area (_("Describe key: %s"), pretty_keyseq (keys)); keystroke = info_get_input_char (); unmessage_in_echo_area (); +#if !defined (INFOKEY) if (Meta_p (keystroke)) { if (map[ESC].type != ISKMAP) { window_message_in_echo_area (_("ESC %s is undefined."), pretty_keyname (UnMeta (keystroke))); return; } - strcpy (keyname + keyname_index, "ESC "); - keyname_index = strlen (keyname); + *k++ = '\e'; keystroke = UnMeta (keystroke); map = (Keymap)map[ESC].function; } +#endif /* !INFOKEY */ - /* Add the printed representation of KEYSTROKE to our keyname. */ - rep = pretty_keyname (keystroke); - strcpy (keyname + keyname_index, rep); - keyname_index = strlen (keyname); + /* Add the KEYSTROKE to our list. */ + *k++ = keystroke; + *k = '\0'; - if (map[keystroke].function == (VFunction *)NULL) + if (map[keystroke].function == (InfoCommand *)NULL) { - message_in_echo_area (_("%s is undefined."), keyname); + message_in_echo_area (_("%s is undefined."), pretty_keyseq (keys)); return; } else if (map[keystroke].type == ISKMAP) { map = (Keymap)map[keystroke].function; - strcat (keyname, " "); - keyname_index = strlen (keyname); continue; } else { - char *message, *fundoc, *funname = ""; + char *keyname, *message, *fundoc, *funname = ""; + +#if defined (INFOKEY) + /* If the key is bound to do-lowercase-version, but its + lower-case variant is undefined, say that this key is + also undefined. This is especially important for unbound + edit keys that emit an escape sequence: it's terribly + confusing to see a message "Home (do-lowercase-version)" + or some such when Home is unbound. */ + if (InfoFunction(map[keystroke].function) == info_do_lowercase_version) + { + unsigned char lowerkey = Meta_p(keystroke) + ? Meta (tolower (UnMeta (keystroke))) + : tolower (keystroke); + + if (map[lowerkey].function == (InfoCommand *)NULL) + { + message_in_echo_area (_("%s is undefined."), + pretty_keyseq (keys)); + return; + } + } +#endif + + keyname = pretty_keyseq (keys); #if defined (NAMED_FUNCTIONS) funname = function_name (map[keystroke].function); #endif /* NAMED_FUNCTIONS */ fundoc = function_documentation (map[keystroke].function); message = (char *)xmalloc (10 + strlen (keyname) + strlen (fundoc) + strlen (funname)); #if defined (NAMED_FUNCTIONS) sprintf (message, "%s (%s): %s.", keyname, funname, fundoc); #else sprintf (message, _("%s is defined to %s."), keyname, fundoc); #endif /* !NAMED_FUNCTIONS */ window_message_in_echo_area ("%s", message); free (message); break; } } } -/* How to get the pretty printable name of a character. */ -static char rep_buffer[30]; - +/* Return the pretty printable name of a single character. */ char * pretty_keyname (key) unsigned char key; { + static char rep_buffer[30]; char *rep; if (Meta_p (key)) { char temp[20]; rep = pretty_keyname (UnMeta (key)); +#if defined (INFOKEY) + sprintf (temp, "M-%s", rep); +#else /* !INFOKEY */ sprintf (temp, "ESC %s", rep); +#endif /* !INFOKEY */ strcpy (rep_buffer, temp); rep = rep_buffer; } else if (Control_p (key)) { switch (key) { case '\n': rep = "LFD"; break; case '\t': rep = "TAB"; break; case '\r': rep = "RET"; break; case ESC: rep = "ESC"; break; default: sprintf (rep_buffer, "C-%c", UnControl (key)); rep = rep_buffer; } } else { switch (key) { case ' ': rep = "SPC"; break; case DEL: rep = "DEL"; break; default: rep_buffer[0] = key; rep_buffer[1] = '\0'; rep = rep_buffer; } } return (rep); } +/* Return the pretty printable string which represents KEYSEQ. */ + +static void pretty_keyseq_internal (); + +char * +pretty_keyseq (keyseq) + char *keyseq; +{ + static char keyseq_rep[200]; + + keyseq_rep[0] = '\0'; + if (*keyseq) + pretty_keyseq_internal (keyseq, keyseq_rep); + return (keyseq_rep); +} + +static void +pretty_keyseq_internal (keyseq, rep) + char *keyseq, *rep; +{ + if (term_kP && strncmp(keyseq, term_kP, strlen(term_kP)) == 0) + { + strcpy(rep, "PgUp"); + keyseq += strlen(term_kP); + } + else if (term_kN && strncmp(keyseq, term_kN, strlen(term_kN)) == 0) + { + strcpy(rep, "PgDn"); + keyseq += strlen(term_kN); + } +#if defined(INFOKEY) + else if (term_kh && strncmp(keyseq, term_kh, strlen(term_kh)) == 0) + { + strcpy(rep, "Home"); + keyseq += strlen(term_kh); + } + else if (term_ke && strncmp(keyseq, term_ke, strlen(term_ke)) == 0) + { + strcpy(rep, "End"); + keyseq += strlen(term_ke); + } + else if (term_ki && strncmp(keyseq, term_ki, strlen(term_ki)) == 0) + { + strcpy(rep, "INS"); + keyseq += strlen(term_ki); + } + else if (term_kx && strncmp(keyseq, term_kx, strlen(term_kx)) == 0) + { + strcpy(rep, "DEL"); + keyseq += strlen(term_kx); + } +#endif /* INFOKEY */ + else if (term_ku && strncmp(keyseq, term_ku, strlen(term_ku)) == 0) + { + strcpy(rep, "Up"); + keyseq += strlen(term_ku); + } + else if (term_kd && strncmp(keyseq, term_kd, strlen(term_kd)) == 0) + { + strcpy(rep, "Down"); + keyseq += strlen(term_kd); + } + else if (term_kl && strncmp(keyseq, term_kl, strlen(term_kl)) == 0) + { + strcpy(rep, "Left"); + keyseq += strlen(term_kl); + } + else if (term_kr && strncmp(keyseq, term_kr, strlen(term_kr)) == 0) + { + strcpy(rep, "Right"); + keyseq += strlen(term_kr); + } + else + { + strcpy (rep, pretty_keyname (keyseq[0])); + keyseq++; + } + if (*keyseq) + { + strcat (rep, " "); + pretty_keyseq_internal (keyseq, rep + strlen(rep)); + } +} + +/* Return a pointer to the last character in s that is found in f. */ +static char * +strrpbrk (s, f) + const char *s, *f; +{ + register const char *e = s + strlen(s); + register const char *t; + + while (e-- != s) + { + for (t = f; *t; t++) + if (*e == *t) + return (char *)e; + } + return NULL; +} + /* Replace the names of functions with the key that invokes them. */ char * -replace_in_documentation (string) +replace_in_documentation (string, help_is_only_window_p) char *string; + int help_is_only_window_p; { + unsigned reslen = strlen (string); register int i, start, next; static char *result = (char *)NULL; maybe_free (result); - result = (char *)xmalloc (1 + strlen (string)); + result = (char *)xmalloc (1 + reslen); i = next = start = 0; /* Skip to the beginning of a replaceable function. */ for (i = start; string[i]; i++) { - /* Is this the start of a replaceable function name? */ - if (string[i] == '\\' && string[i + 1] == '[') - { - char *fun_name, *rep; - VFunction *function; - - /* Copy in the old text. */ - strncpy (result + next, string + start, i - start); - next += (i - start); - start = i + 2; - - /* Move to the end of the function name. */ - for (i = start; string[i] && (string[i] != ']'); i++); - - fun_name = (char *)xmalloc (1 + i - start); - strncpy (fun_name, string + start, i - start); - fun_name[i - start] = '\0'; - - /* Find a key which invokes this function in the info_keymap. */ - function = named_function (fun_name); + int j = i + 1; - /* If the internal documentation string fails, there is a - serious problem with the associated command's documentation. - We croak so that it can be fixed immediately. */ - if (!function) - abort (); - - rep = where_is (info_keymap, function); - strcpy (result + next, rep); - next = strlen (result); - - start = i; - if (string[i]) - start++; - } + /* Is this the start of a replaceable function name? */ + if (string[i] == '\\') + { + char *fmt = NULL; + unsigned min = 0; + unsigned max = 0; + + if(string[j] == '%') + { + if (string[++j] == '-') + j++; + if (isdigit(string[j])) + { + min = atoi(string + j); + while (isdigit(string[j])) + j++; + if (string[j] == '.' && isdigit(string[j + 1])) + { + j += 1; + max = atoi(string + j); + while (isdigit(string[j])) + j++; + } + fmt = (char *)xmalloc (j - i + 2); + strncpy (fmt, string + i + 1, j - i); + fmt[j - i - 1] = 's'; + fmt[j - i] = '\0'; + } + else + j = i + 1; + } + if (string[j] == '[') + { + unsigned arg = 0; + char *argstr = NULL; + char *rep_name, *fun_name, *rep; + InfoCommand *command; + char *repstr = NULL; + unsigned replen; + + /* Copy in the old text. */ + strncpy (result + next, string + start, i - start); + next += (i - start); + start = j + 1; + + /* Look for an optional numeric arg. */ + i = start; + if (isdigit(string[i]) + || (string[i] == '-' && isdigit(string[i + 1])) ) + { + arg = atoi(string + i); + if (string[i] == '-') + i++; + while (isdigit(string[i])) + i++; + } + start = i; + + /* Move to the end of the function name. */ + for (i = start; string[i] && (string[i] != ']'); i++); + + rep_name = (char *)xmalloc (1 + i - start); + strncpy (rep_name, string + start, i - start); + rep_name[i - start] = '\0'; + + /* If we have only one window (because the window size was too + small to split it), we have to quit help by going back one + noew in the history list, not deleting the window. */ + if (strcmp (rep_name, "quit-help") == 0) + fun_name = help_is_only_window_p ? "history-node" + : "delete-window"; + else + fun_name = rep_name; + + /* Find a key which invokes this function in the info_keymap. */ + command = named_function (fun_name); + + free (rep_name); + + /* If the internal documentation string fails, there is a + serious problem with the associated command's documentation. + We croak so that it can be fixed immediately. */ + if (!command) + abort (); + + if (arg) + { + char *argrep, *p; + + argrep = where_is (info_keymap, InfoCmd(info_add_digit_to_numeric_arg)); + p = argrep ? strrpbrk (argrep, "0123456789-") : NULL; + if (p) + { + argstr = (char *)xmalloc (p - argrep + 21); + strncpy (argstr, argrep, p - argrep); + sprintf (argstr + (p - argrep), "%d", arg); + } + else + command = NULL; + } + rep = command ? where_is (info_keymap, command) : NULL; + if (!rep) + rep = "N/A"; + replen = (argstr ? strlen (argstr) + 1 : 0) + strlen (rep); + repstr = (char *)xmalloc (replen); + repstr[0] = '\0'; + if (argstr) + { + strcat(repstr, argstr); + strcat(repstr, " "); + free (argstr); + } + strcat(repstr, rep); + + if (fmt) + { + if (replen > max) + replen = max; + if (replen < min) + replen = min; + } + if (next + replen > reslen) + { + reslen = next + replen + 1; + result = (char *)xrealloc (result, reslen + 1); + } + + if (fmt) + sprintf (result + next, fmt, repstr); + else + strcpy (result + next, repstr); + + next = strlen (result); + free (repstr); + + start = i; + if (string[i]) + start++; + } + + maybe_free (fmt); + } } strcpy (result + next, string + start); return (result); } /* Return a string of characters which could be typed from the keymap MAP to invoke FUNCTION. */ static char *where_is_rep = (char *)NULL; static int where_is_rep_index = 0; static int where_is_rep_size = 0; -static char * -where_is (map, function) +char * +where_is (map, cmd) Keymap map; - VFunction *function; + InfoCommand *cmd; { char *rep; if (!where_is_rep_size) where_is_rep = (char *)xmalloc (where_is_rep_size = 100); where_is_rep_index = 0; - rep = where_is_internal (map, function); + rep = where_is_internal (map, cmd); - /* If it couldn't be found, return "M-x Foo". */ + /* If it couldn't be found, return "M-x Foo" (or equivalent). */ if (!rep) { char *name; - name = function_name (function); + name = function_name (cmd); + if (!name) + return NULL; /* no such function */ + + rep = where_is_internal (map, InfoCmd(info_execute_command)); + if (!rep) + return ""; /* function exists but can't be got to by user */ - if (name) - sprintf (where_is_rep, "M-x %s", name); + sprintf (where_is_rep, "%s %s", rep, name); rep = where_is_rep; } return (rep); } -/* Return the printed rep of FUNCTION as found in MAP, or NULL. */ +/* Return the printed rep of the keystrokes that invoke FUNCTION, + as found in MAP, or NULL. */ static char * -where_is_internal (map, function) +where_is_internal (map, cmd) Keymap map; - VFunction *function; + InfoCommand *cmd; { +#if defined(INFOKEY) + + register FUNCTION_KEYSEQ *k; + + for (k = cmd->keys; k; k = k->next) + if (k->map == map) + return pretty_keyseq (k->keyseq); + + return NULL; + +#else /* !INFOKEY */ + register int i; /* If the function is directly invokable in MAP, return the representation of that keystroke. */ for (i = 0; i < 256; i++) - if ((map[i].type == ISFUNC) && map[i].function == function) + if ((map[i].type == ISFUNC) && map[i].function == cmd) { sprintf (where_is_rep + where_is_rep_index, "%s", pretty_keyname (i)); return (where_is_rep); } /* Okay, search subsequent maps for this function. */ for (i = 0; i < 256; i++) { if (map[i].type == ISKMAP) { int saved_index = where_is_rep_index; char *rep; sprintf (where_is_rep + where_is_rep_index, "%s ", pretty_keyname (i)); where_is_rep_index = strlen (where_is_rep); - rep = where_is_internal ((Keymap)map[i].function, function); + rep = where_is_internal ((Keymap)map[i].function, cmd); if (rep) return (where_is_rep); where_is_rep_index = saved_index; } } return NULL; + +#endif /* INFOKEY */ } extern char *read_function_name (); DECLARE_INFO_COMMAND (info_where_is, _("Show what to type to execute a given command")) { char *command_name; command_name = read_function_name (_("Where is command: "), window); if (!command_name) { info_abort_key (active_window, count, key); return; } if (*command_name) { - VFunction *function; + InfoCommand *command; - function = named_function (command_name); + command = named_function (command_name); - if (function) + if (command) { char *location; - location = where_is (active_window->keymap, function); + location = where_is (active_window->keymap, command); - if (!location) + if (!location || !location[0]) { info_error (_("`%s' is not on any keys"), command_name); } else { - if (strncmp (location, "M-x ", 4) == 0) + if (strstr (location, function_name (command))) window_message_in_echo_area (_("%s can only be invoked via %s."), command_name, location); else window_message_in_echo_area (_("%s can be invoked via %s."), command_name, location); } } else info_error (_("There is no function named `%s'"), command_name); } free (command_name); } diff --git a/contrib/texinfo/info/infokey.c b/contrib/texinfo/info/infokey.c new file mode 100644 index 000000000000..e84a2d775364 --- /dev/null +++ b/contrib/texinfo/info/infokey.c @@ -0,0 +1,908 @@ +/* infokey.c -- compile ~/.infokey to ~/.info. + $Id: infokey.c,v 1.5 2002/02/26 16:17:57 karl Exp $ + + Copyright (C) 1999, 2001, 02 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 Andrew Bettison <andrewb@zip.com.au>. */ + +#include "info.h" +#include "infomap.h" +#include "infokey.h" +#include "key.h" +#include "getopt.h" + +static char *program_name = "infokey"; + +/* Non-zero means print version info only. */ +static int print_version_p = 0; + +/* Non-zero means print a short description of the options. */ +static int print_help_p = 0; + +/* String specifying the source file. This is set by the user on the + command line, or a default is used. */ +static char *input_filename = (char *) NULL; + +/* String specifying the name of the file to output to. This is + set by the user on the command line, or a default is used. */ +static char *output_filename = (char *) NULL; + +/* Structure describing the options that Infokey accepts. We pass this + structure to getopt_long (). If you add or otherwise change this + structure, you must also change the string which follows it. */ +static struct option long_options[] = +{ + {"output", 1, 0, 'o'}, + {"help", 0, &print_help_p, 1}, + {"version", 0, &print_version_p, 1}, + {NULL, 0, NULL, 0} +}; + +/* String describing the shorthand versions of the long options found above. */ +static char *short_options = "o:"; + +/* Structure for holding the compiled sections. */ +enum sect_e + { + info = 0, + ea = 1, + var = 2, + }; +struct sect + { + unsigned int cur; + unsigned char data[INFOKEY_MAX_SECTIONLEN]; + }; + +/* Some "forward" declarations. */ +static char *mkpath (); +static int compile (), write_infokey_file (); +static void syntax_error (), error_message (), suggest_help (), short_help (); + + +/* **************************************************************** */ +/* */ +/* Main Entry Point to the Infokey Program */ +/* */ +/* **************************************************************** */ + +int +main (argc, argv) + int argc; + char **argv; +{ + int getopt_long_index; /* Index returned by getopt_long (). */ + NODE *initial_node; /* First node loaded by Info. */ + +#ifdef HAVE_SETLOCALE + /* Set locale via LC_ALL. */ + setlocale (LC_ALL, ""); +#endif + + /* Set the text message domain. */ + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + while (1) + { + int option_character; + + option_character = getopt_long + (argc, argv, short_options, long_options, &getopt_long_index); + + /* getopt_long () returns EOF when there are no more long options. */ + if (option_character == EOF) + break; + + /* If this is a long option, then get the short version of it. */ + if (option_character == 0 && long_options[getopt_long_index].flag == 0) + option_character = long_options[getopt_long_index].val; + + /* Case on the option that we have received. */ + switch (option_character) + { + case 0: + break; + + /* User is specifying the name of a file to output to. */ + case 'o': + if (output_filename) + free (output_filename); + output_filename = xstrdup (optarg); + break; + + default: + suggest_help (); + xexit (1); + } + } + + /* If the user specified --version, then show the version and exit. */ + if (print_version_p) + { + printf ("%s (GNU %s) %s\n", program_name, PACKAGE, VERSION); + puts (""); + printf (_ ("Copyright (C) %s Free Software Foundation, Inc.\n\ +There is NO warranty. You may redistribute this software\n\ +under the terms of the GNU General Public License.\n\ +For more information about these matters, see the files named COPYING.\n"), + "1999"); + xexit (0); + } + + /* If the `--help' option was present, show the help and exit. */ + if (print_help_p) + { + short_help (); + xexit (0); + } + + /* If there is one argument remaining, it is the name of the input + file. */ + if (optind == argc - 1) + { + if (input_filename) + free (input_filename); + input_filename = xstrdup (argv[optind]); + } + else if (optind != argc) + { + error_message (0, _("incorrect number of arguments")); + suggest_help (); + xexit (1); + } + + /* Use default filenames where none given. */ + { + char *homedir; + + homedir = getenv ("HOME"); +#ifdef __MSDOS__ + if (!homedir) + homedir = "."; +#endif + if (!input_filename) + input_filename = mkpath (homedir, INFOKEY_SRCFILE); + if (!output_filename) + output_filename = mkpath (homedir, INFOKEY_FILE); + } + + { + FILE *inf; + FILE *outf; + int write_error; + static struct sect sections[3]; + + /* Open the input file. */ + inf = fopen (input_filename, "r"); + if (!inf) + { + error_message (errno, _("cannot open input file `%s'"), input_filename); + xexit (1); + } + + /* Compile the input file to its verious sections, then write the + section data to the output file. */ + + if (compile (inf, input_filename, sections)) + { + /* Open the output file. */ + outf = fopen (output_filename, FOPEN_WBIN); + if (!outf) + { + error_message (errno, _("cannot create output file `%s'"), output_filename); + xexit (1); + } + + /* Write the contents of the output file and close it. If there is + an error writing to the file, delete it and exit with a failure + status. */ + write_error = 0; + if (!write_infokey_file (outf, sections)) + { + error_message (errno, _("error writing to `%s'"), output_filename); + write_error = 1; + } + if (fclose (outf) == EOF) + { + error_message (errno, _("error closing output file `%s'"), output_filename); + write_error = 1; + } + if (write_error) + { + unlink (output_filename); + xexit (1); + } + } + + /* Close the input file. */ + fclose (inf); + } + + xexit (0); +} + +static char * +mkpath (dir, file) + const char *dir; + const char *file; +{ + char *p; + + p = xmalloc (strlen (dir) + 1 + strlen (file) + 2); + strcpy (p, dir); + strcat (p, "/"); + strcat (p, file); + return p; +} + + +/* Compilation - the real work. + + Source file syntax + ------------------ + The source file is a line-based text file with the following + structure: + + # comments + # more comments + + #info + u prev-line + d next-line + ^a invalid # just beep + \ku prev-line + #stop + \kd next-line + q quit # of course! + + #echo-area + ^a echo-area-beg-of-line + ^e echo-area-end-of-line + \kr echo-area-forward + \kl echo-area-backward + \kh echo-area-beg-of-line + \ke echo-area-end-of-line + + #var + scroll-step=1 + ISO-Latin=Off + + Lines starting with '#' are comments, and are ignored. Blank + lines are ignored. Each section is introduced by one of the + following lines: + + #info + #echo-area + #var + + The sections may occur in any order. Each section may be + omitted completely. If the 'info' section is the first in the + file, its '#info' line may be omitted. + + The 'info' and 'echo-area' sections + ----------------------------------- + Each line in the 'info' or 'echo-area' sections has the + following syntax: + + key-sequence SPACE action-name [ SPACE [ # comment ] ] \n + + Where SPACE is one or more white space characters excluding + newline, "action-name" is the name of a GNU Info command, + "comment" is any sequence of characters excluding newline, and + "key-sequence" is a concatenation of one or more key definitions + using the following syntax: + + 1. A carat ^ followed by one character indicates a single + control character; + + 2. A backslash \ followed by one, two, or three octal + digits indicates a single character having that ASCII + code; + + 3. \n indicates a single NEWLINE; + \e indicates a single ESC; + \r indicates a single CR; + \t indicates a single TAB; + \b indicates a single BACKSPACE; + + 4. \ku indicates the Up Arrow key; + \kd indicates the Down Arrow key; + \kl indicates the Left Arrow key; + \kr indicates the Right Arrow key; + \kP indicates the Page Up (PRIOR) key; + \kN indicates the Page Down (NEXT) key; + \kh indicates the Home key; + \ke indicates the End key; + \kx indicates the DEL key; + \k followed by any other character indicates a single + control-K, and the following character is interpreted + as in rules 1, 2, 3, 5 and 6. + + 5. \m followed by any sequence defined in rules 1, 2, 3, 4 + or 6 indicates the "Meta" modification of that key. + + 6. A backslash \ followed by any character not described + above indicates that character itself. In particular: + \\ indicates a single backslash \, + \ (backslash-space) indicates a single space, + \^ indicates a single caret ^, + + If the following line: + + #stop + + occurs anywhere in an 'info' or 'echo-area' section, that + indicates to GNU Info to suppress all of its default key + bindings in that context. + + The 'var' section + ----------------- + Each line in the 'var' section has the following syntax: + + variable-name = value \n + + Where "variable-name" is the name of a GNU Info variable and + "value" is the value that GNU Info will assign to that variable + when commencing execution. There must be no white space in the + variable name, nor between the variable name and the '='. All + characters immediately following the '=', up to but not + including the terminating newline, are considered to be the + value that will be assigned. In other words, white space + following the '=' is not ignored. + */ + +static int add_to_section (), lookup_action (); + +/* Compile the input file into its various sections. Return true if no + error was encountered. + */ +static int +compile (fp, filename, sections) + FILE *fp; + const char *filename; + struct sect sections[]; +{ + int error = 0; + char rescan = 0; + unsigned int lnum = 0; + int c; + + /* This parser is a true state machine, with no sneaky fetching + of input characters inside the main loop. In other words, all + state is fully represented by the following variables: + */ + enum + { + start_of_line, + start_of_comment, + in_line_comment, + in_trailing_comment, + get_keyseq, + got_keyseq, + get_action, + got_action, + get_varname, + got_varname, + get_equals, + got_equals, + get_value, + } + state = start_of_line; + enum sect_e section = info; + enum + { + normal, + slosh, + control, + octal, + special_key, + } + seqstate; /* used if state == get_keyseq */ + char meta = 0; + char ocnt; /* used if state == get_keyseq && seqstate == octal */ + + /* Data is accumulated in the following variables. The code + avoids overflowing these strings, and throws an error + where appropriate if a string limit is exceeded. These string + lengths are arbitrary (and should be large enough) and their + lengths are not hard-coded anywhere else, so increasing them + here will not break anything. */ + char oval; + char comment[10]; + unsigned int clen; + char seq[20]; + unsigned int slen; + char act[80]; + unsigned int alen; + char varn[80]; + unsigned int varlen; + char val[80]; + unsigned int vallen; + +#define To_seq(c) \ + do { \ + if (slen < sizeof seq) \ + seq[slen++] = meta ? Meta(c) : (c); \ + else \ + { \ + syntax_error(filename, lnum, _("key sequence too long")); \ + error = 1; \ + } \ + meta = 0; \ + } while (0) + + sections[info].cur = 1; + sections[info].data[0] = 0; + sections[ea].cur = 1; + sections[ea].data[0] = 0; + sections[var].cur = 0; + + while (!error && (rescan || (c = fgetc (fp)) != EOF)) + { + rescan = 0; + switch (state) + { + case start_of_line: + lnum++; + if (c == '#') + state = start_of_comment; + else if (c != '\n') + { + switch (section) + { + case info: + case ea: + state = get_keyseq; + seqstate = normal; + slen = 0; + break; + case var: + state = get_varname; + varlen = 0; + break; + } + rescan = 1; + } + break; + + case start_of_comment: + clen = 0; + state = in_line_comment; + /* fall through */ + case in_line_comment: + if (c == '\n') + { + state = start_of_line; + comment[clen] = '\0'; + if (strcmp (comment, "info") == 0) + section = info; + else if (strcmp (comment, "echo-area") == 0) + section = ea; + else if (strcmp (comment, "var") == 0) + section = var; + else if (strcmp (comment, "stop") == 0 + && (section == info || section == ea)) + sections[section].data[0] = 1; + } + else if (clen < sizeof comment - 1) + comment[clen++] = c; + break; + + case in_trailing_comment: + if (c == '\n') + state = start_of_line; + break; + + case get_keyseq: + switch (seqstate) + { + case normal: + if (c == '\n' || isspace (c)) + { + state = got_keyseq; + rescan = 1; + if (slen == 0) + { + syntax_error (filename, lnum, _("missing key sequence")); + error = 1; + } + } + else if (c == '\\') + seqstate = slosh; + else if (c == '^') + seqstate = control; + else + To_seq (c); + break; + + case slosh: + switch (c) + { + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + seqstate = octal; + oval = c - '0'; + ocnt = 1; + break; + case 'b': + To_seq ('\b'); + seqstate = normal; + break; + case 'e': + To_seq ('\033'); + seqstate = normal; + break; + case 'n': + To_seq ('\n'); + seqstate = normal; + break; + case 'r': + To_seq ('\r'); + seqstate = normal; + break; + case 't': + To_seq ('\t'); + seqstate = normal; + break; + case 'm': + meta = 1; + seqstate = normal; + break; + case 'k': + seqstate = special_key; + break; + default: + /* Backslash followed by any other char + just means that char. */ + To_seq (c); + seqstate = normal; + break; + } + break; + + case octal: + switch (c) + { + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + if (++ocnt <= 3) + oval = oval * 8 + c - '0'; + if (ocnt == 3) + seqstate = normal; + break; + default: + ocnt = 4; + seqstate = normal; + rescan = 1; + break; + } + if (seqstate != octal) + { + if (oval) + To_seq (oval); + else + { + syntax_error (filename, lnum, _("NUL character (\\000) not permitted")); + error = 1; + } + } + break; + + case special_key: + To_seq (SK_ESCAPE); + switch (c) + { + case 'u': To_seq (SK_UP_ARROW); break; + case 'd': To_seq (SK_DOWN_ARROW); break; + case 'r': To_seq (SK_RIGHT_ARROW); break; + case 'l': To_seq (SK_LEFT_ARROW); break; + case 'U': To_seq (SK_PAGE_UP); break; + case 'D': To_seq (SK_PAGE_DOWN); break; + case 'h': To_seq (SK_HOME); break; + case 'e': To_seq (SK_END); break; + case 'x': To_seq (SK_DELETE); break; + default: To_seq (SK_LITERAL); rescan = 1; break; + } + seqstate = normal; + break; + + case control: + if (CONTROL (c)) + To_seq (CONTROL (c)); + else + { + syntax_error (filename, lnum, _("NUL character (^%c) not permitted"), c); + error = 1; + } + seqstate = normal; + break; + } + break; + + case got_keyseq: + if (isspace (c) && c != '\n') + break; + state = get_action; + alen = 0; + /* fall through */ + case get_action: + if (c == '\n' || isspace (c)) + { + int a; + + state = got_action; + rescan = 1; + if (alen == 0) + { + syntax_error (filename, lnum, _("missing action name"), c); + error = 1; + } + else + { + act[alen] = '\0'; + a = lookup_action (act); + if (a != -1) + { + char av = a; + + if (!(add_to_section (§ions[section], seq, slen) + && add_to_section (§ions[section], "", 1) + && add_to_section (§ions[section], &av, 1))) + { + syntax_error (filename, lnum, _("section too long")); + error = 1; + } + } + else + { + syntax_error (filename, lnum, _("unknown action `%s'"), act); + error = 1; + } + } + } + else if (alen < sizeof act - 1) + act[alen++] = c; + else + { + syntax_error (filename, lnum, _("action name too long")); + error = 1; + } + break; + + case got_action: + if (c == '#') + state = in_trailing_comment; + else if (c == '\n') + state = start_of_line; + else if (!isspace (c)) + { + syntax_error (filename, lnum, _("extra characters following action `%s'"), act); + error = 1; + } + break; + + case get_varname: + if (c == '=') + { + if (varlen == 0) + { + syntax_error (filename, lnum, _("missing variable name")); + error = 1; + } + state = get_value; + vallen = 0; + } + else if (c == '\n' || isspace (c)) + { + syntax_error (filename, lnum, _("missing `=' immediately after variable name")); + error = 1; + } + else if (varlen < sizeof varn) + varn[varlen++] = c; + else + { + syntax_error (filename, lnum, _("variable name too long")); + error = 1; + } + break; + + case get_value: + if (c == '\n') + { + state = start_of_line; + if (!(add_to_section (§ions[section], varn, varlen) + && add_to_section (§ions[section], "", 1) + && add_to_section (§ions[section], val, vallen) + && add_to_section (§ions[section], "", 1))) + { + syntax_error (filename, lnum, _("section too long")); + error = 1; + } + } + else if (vallen < sizeof val) + val[vallen++] = c; + else + { + syntax_error (filename, lnum, _("value too long")); + error = 1; + } + break; + } + } + +#undef To_seq + + return !error; +} + +/* Add some characters to a section's data. Return true if all the + characters fit, or false if the section's size limit was exceeded. + */ +static int +add_to_section (s, str, len) + struct sect *s; + const char *str; + unsigned int len; +{ + if (s->cur + len > sizeof s->data) + return 0; + strncpy (s->data + s->cur, str, len); + s->cur += len; + return 1; +} + +/* Translate from an action name to its numeric code. This uses the + auto-generated array in key.c. + */ +static int +lookup_action (actname) + const char *actname; +{ + int i; + + if (strcmp ("invalid", actname) == 0) + return A_INVALID; + for (i = 0; function_key_array[i].name != NULL; i++) + if (strcmp (function_key_array[i].name, actname) == 0) + return function_key_array[i].code; + return -1; +} + +/* Put an integer to an infokey file. + Integers are stored as two bytes, low order first, + in radix INFOKEY_RADIX. + */ +static int +putint (i, fp) + int i; + FILE *fp; +{ + return fputc (i % INFOKEY_RADIX, fp) != EOF + && fputc ((i / INFOKEY_RADIX) % INFOKEY_RADIX, fp) != EOF; +} + +/* Write an entire section to an infokey file. If the section is + empty, simply omit it. + */ +static int +putsect (s, code, fp) + struct sect *s; + int code; + FILE *fp; +{ + if (s->cur == 0) + return 1; + return fputc (code, fp) != EOF + && putint (s->cur, fp) + && fwrite (s->data, s->cur, 1, fp) == 1; +} + +/* Write an entire infokey file, given an array containing its sections. + */ +static int +write_infokey_file (fp, sections) + FILE *fp; + struct sect sections[]; +{ + /* Get rid of sections with no effect. */ + if (sections[info].cur == 1 && sections[info].data[0] == 0) + sections[info].cur = 0; + if (sections[ea].cur == 1 && sections[ea].data[0] == 0) + sections[ea].cur = 0; + + /* Write all parts of the file out in order (no lseeks), + checking for errors all the way. */ + return fputc (INFOKEY_MAGIC_S0, fp) != EOF + && fputc (INFOKEY_MAGIC_S1, fp) != EOF + && fputc (INFOKEY_MAGIC_S2, fp) != EOF + && fputc (INFOKEY_MAGIC_S3, fp) != EOF + && fputs (VERSION, fp) != EOF + && fputc ('\0', fp) != EOF + && putsect (§ions[info], INFOKEY_SECTION_INFO, fp) + && putsect (§ions[ea], INFOKEY_SECTION_EA, fp) + && putsect (§ions[var], INFOKEY_SECTION_VAR, fp) + && fputc (INFOKEY_MAGIC_E0, fp) != EOF + && fputc (INFOKEY_MAGIC_E1, fp) != EOF + && fputc (INFOKEY_MAGIC_E2, fp) != EOF + && fputc (INFOKEY_MAGIC_E3, fp) != EOF; +} + + +/* Error handling. */ + +/* Give the user a "syntax error" message in the form + progname: "filename", line N: message + */ +static void +error_message (error_code, fmt, a1, a2, a3, a4) + int error_code; + const char *fmt; + const void *a1, *a2, *a3, *a4; +{ + fprintf (stderr, "%s: ", program_name); + fprintf (stderr, fmt, a1, a2, a3, a4); + if (error_code) + fprintf (stderr, " - %s", strerror (error_code)); + fprintf (stderr, "\n"); +} + +/* Give the user a generic error message in the form + progname: message + */ +static void +syntax_error (filename, linenum, fmt, a1, a2, a3, a4) + const char *filename; + unsigned int linenum; + const char *fmt; + const void *a1, *a2, *a3, *a4; +{ + fprintf (stderr, "%s: ", program_name); + fprintf (stderr, _("\"%s\", line %u: "), filename, linenum); + fprintf (stderr, fmt, a1, a2, a3, a4); + fprintf (stderr, "\n"); +} + +/* Produce a gentle rtfm. */ +static void +suggest_help () +{ + fprintf (stderr, _("Try --help for more information.\n")); +} + +/* Produce a scaled down description of the available options to Info. */ +static void +short_help () +{ + printf (_ ("\ +Usage: %s [OPTION]... [INPUT-FILE]\n\ +\n\ +Compile infokey source file to infokey file. Reads INPUT-FILE (default\n\ +$HOME/.infokey) and writes compiled key file to (by default) $HOME/.info.\n\ +\n\ +Options:\n\ + --output FILE output to FILE instead of $HOME/.info\n\ + --help display this help and exit.\n\ + --version display version information and exit.\n\ +\n\ +Email bug reports to bug-texinfo@gnu.org,\n\ +general questions and discussion to help-texinfo@gnu.org.\n\ +"), + program_name + ); + xexit (0); +} diff --git a/contrib/texinfo/info/infokey.h b/contrib/texinfo/info/infokey.h new file mode 100644 index 000000000000..0babea9541f9 --- /dev/null +++ b/contrib/texinfo/info/infokey.h @@ -0,0 +1,128 @@ +/* infokey.h -- Custom keystroke definition support. + $Id: $ + + Copyright (C) 1999 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 Andrew Bettison <andrewb@zip.com.au>. + + This design was derived from the "lesskey" system in less 3.4.0. by + Mark Nudelman. + + The following terminology is confusing: + source file = $HOME/.infokey + infokey file = $HOME/.info + Oh, well. + */ + + +/* Default source file, where user writes text definitions to be + compiled to the infokey file. MS-DOS doesn't allow leading + dots in file names. */ +#ifdef __MSDOS__ +#define INFOKEY_SRCFILE "_infokey" +#else +#define INFOKEY_SRCFILE ".infokey" +#endif + +/* Default "infokey file", where compiled user defs are kept and + read by Info. MS-DOS doesn't allow leading dots in file names. */ +#ifdef __MSDOS__ +#define INFOKEY_FILE "_info" +#else +#define INFOKEY_FILE ".info" +#endif + +/* +Format of entire infokey file: + + 4 bytes magic number S + X bytes version string + 1 byte '\0' terminator + + any number of sections: + 1 byte section id + 2 bytes section length (N) + N bytes section definitions: format depends on section + + 4 bytes magic number E + +Format of INFO and EA sections: + + 1 byte flag: 1 == suppress default key bindings + Repeat: + X bytes key sequence + 1 byte '\0' terminator + 1 byte action code (A_xxx) + +Format of VAR section: + + Repeat: + X bytes variable name + 1 byte '\0' terminator + Y bytes value + 1 byte '\0' terminator + +*/ + +#define INFOKEY_NMAGIC 8 + +#define INFOKEY_MAGIC_S0 '\001' +#define INFOKEY_MAGIC_S1 'I' +#define INFOKEY_MAGIC_S2 'n' +#define INFOKEY_MAGIC_S3 'f' + +#define INFOKEY_SECTION_INFO 'i' +#define INFOKEY_SECTION_EA 'e' +#define INFOKEY_SECTION_VAR 'v' + +#define INFOKEY_MAGIC_E0 'A' +#define INFOKEY_MAGIC_E1 'l' +#define INFOKEY_MAGIC_E2 'f' +#define INFOKEY_MAGIC_E3 'n' + +#define INFOKEY_RADIX 64 +#define INFOKEY_MAX_SECTIONLEN 500 +#define INFOKEY_MAX_DEFLEN 16 + +#define A_MAX_COMMAND 120 +#define A_INVALID 121 + +/* Character transformations (independent of info's own) */ + +#define CONTROL(c) ((c) & 0x1f) +#define ISCONTROL(c) (((c) & ~0x1f) == 0) +#define META(c) ((c) | 0x80) +#define UNMETA(c) ((c) & ~0x80) +#define ISMETA(c) (((c) & 0x80) != 0) + +/* Special keys (keys which output different strings on different terminals) */ + +#define SK_ESCAPE CONTROL('k') +#define SK_RIGHT_ARROW 1 +#define SK_LEFT_ARROW 2 +#define SK_UP_ARROW 3 +#define SK_DOWN_ARROW 4 +#define SK_PAGE_UP 5 +#define SK_PAGE_DOWN 6 +#define SK_HOME 7 +#define SK_END 8 +#define SK_DELETE 9 +#define SK_INSERT 10 +#define SK_CTL_LEFT_ARROW 11 +#define SK_CTL_RIGHT_ARROW 12 +#define SK_CTL_DELETE 13 +#define SK_LITERAL 40 diff --git a/contrib/texinfo/info/infomap.h b/contrib/texinfo/info/infomap.h index 65968cbdff47..bf46399eea4a 100644 --- a/contrib/texinfo/info/infomap.h +++ b/contrib/texinfo/info/infomap.h @@ -1,82 +1,81 @@ -/* infomap.h -- Description of a keymap in Info and related functions. */ +/* infomap.h -- description of a keymap in Info and related functions. + $Id: infomap.h,v 1.6 2001/11/16 23:16:59 karl Exp $ -/* 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, 2001 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). */ #ifndef INFOMAP_H #define INFOMAP_H #include "info.h" #define ESC '\033' #define DEL '\177' #define TAB '\011' #define RET '\r' #define LFD '\n' #define SPC ' ' #define meta_character_threshold (DEL + 1) #define control_character_threshold (SPC) #define meta_character_bit 0x80 #define control_character_bit 0x40 #define Meta_p(c) (((c) > meta_character_threshold)) #define Control_p(c) ((c) < control_character_threshold) #define Meta(c) ((c) | (meta_character_bit)) #define UnMeta(c) ((c) & (~meta_character_bit)) #define Control(c) ((toupper (c)) & (~control_character_bit)) #define UnControl(c) (tolower ((c) | control_character_bit)) /* A keymap contains one entry for each key in the ASCII set. Each entry consists of a type and a pointer. FUNCTION is the address of a function to run, or the address of a keymap to indirect through. TYPE says which kind of thing FUNCTION is. */ -typedef struct { +typedef struct keymap_entry +{ char type; - VFunction *function; + InfoCommand *function; } KEYMAP_ENTRY; typedef KEYMAP_ENTRY *Keymap; /* The values that TYPE can have in a keymap entry. */ #define ISFUNC 0 #define ISKMAP 1 extern Keymap info_keymap; extern Keymap echo_area_keymap; /* Return a new keymap which has all the uppercase letters mapped to run the function info_do_lowercase_version (). */ extern Keymap keymap_make_keymap (); /* Return a new keymap which is a copy of MAP. */ extern Keymap keymap_copy_keymap (); /* Free MAP and it's descendents. */ extern void keymap_discard_keymap (); /* Initialize the info keymaps. */ extern void initialize_info_keymaps (); #endif /* not INFOMAP_H */ diff --git a/contrib/texinfo/info/key.c b/contrib/texinfo/info/key.c new file mode 100644 index 000000000000..06be6fa30f6c --- /dev/null +++ b/contrib/texinfo/info/key.c @@ -0,0 +1,146 @@ +/* key.c -- Generated array containing function names. + + This file was automatically made from various source files with the + command "./makedoc". DO NOT EDIT THIS FILE, only "./makedoc.c". + + Source files groveled to make this file include: + + ./session.c + ./echo-area.c + ./infodoc.c + ./m-x.c + ./indices.c + ./nodemenu.c + ./footnotes.c + ./variables.c + + An entry in the array FUNCTION_KEY_ARRAY is made for each command + found in the above files; each entry consists of + a string which is the user-visible name of the function. */ + +#include "key.h" +#include "funs.h" + +FUNCTION_KEY function_key_array[] = { + +/* Commands found in "./session.c". */ + { "next-line", A_info_next_line }, + { "prev-line", A_info_prev_line }, + { "end-of-line", A_info_end_of_line }, + { "beginning-of-line", A_info_beginning_of_line }, + { "forward-char", A_info_forward_char }, + { "backward-char", A_info_backward_char }, + { "forward-word", A_info_forward_word }, + { "backward-word", A_info_backward_word }, + { "global-next-node", A_info_global_next_node }, + { "global-prev-node", A_info_global_prev_node }, + { "scroll-forward", A_info_scroll_forward }, + { "scroll-forward-set-window", A_info_scroll_forward_set_window }, + { "scroll-forward-page-only", A_info_scroll_forward_page_only }, + { "scroll-forward-page-only-set-window", A_info_scroll_forward_page_only_set_window }, + { "scroll-backward", A_info_scroll_backward }, + { "scroll-backward-set-window", A_info_scroll_backward_set_window }, + { "scroll-backward-page-only", A_info_scroll_backward_page_only }, + { "scroll-backward-page-only-set-window", A_info_scroll_backward_page_only_set_window }, + { "beginning-of-node", A_info_beginning_of_node }, + { "end-of-node", A_info_end_of_node }, + { "down-line", A_info_down_line }, + { "up-line", A_info_up_line }, + { "scroll-half-screen-down", A_info_scroll_half_screen_down }, + { "scroll-half-screen-up", A_info_scroll_half_screen_up }, + { "next-window", A_info_next_window }, + { "prev-window", A_info_prev_window }, + { "split-window", A_info_split_window }, + { "delete-window", A_info_delete_window }, + { "keep-one-window", A_info_keep_one_window }, + { "scroll-other-window", A_info_scroll_other_window }, + { "scroll-other-window-backward", A_info_scroll_other_window_backward }, + { "grow-window", A_info_grow_window }, + { "tile-windows", A_info_tile_windows }, + { "toggle-wrap", A_info_toggle_wrap }, + { "next-node", A_info_next_node }, + { "prev-node", A_info_prev_node }, + { "up-node", A_info_up_node }, + { "last-node", A_info_last_node }, + { "first-node", A_info_first_node }, + { "last-menu-item", A_info_last_menu_item }, + { "menu-digit", A_info_menu_digit }, + { "menu-item", A_info_menu_item }, + { "xref-item", A_info_xref_item }, + { "find-menu", A_info_find_menu }, + { "visit-menu", A_info_visit_menu }, + { "goto-node", A_info_goto_node }, + { "menu-sequence", A_info_menu_sequence }, + { "goto-invocation-node", A_info_goto_invocation_node }, + { "man", A_info_man }, + { "top-node", A_info_top_node }, + { "dir-node", A_info_dir_node }, + { "history-node", A_info_history_node }, + { "kill-node", A_info_kill_node }, + { "view-file", A_info_view_file }, + { "print-node", A_info_print_node }, + { "search-case-sensitively", A_info_search_case_sensitively }, + { "search", A_info_search }, + { "search-backward", A_info_search_backward }, + { "search-next", A_info_search_next }, + { "search-previous", A_info_search_previous }, + { "isearch-forward", A_isearch_forward }, + { "isearch-backward", A_isearch_backward }, + { "move-to-prev-xref", A_info_move_to_prev_xref }, + { "move-to-next-xref", A_info_move_to_next_xref }, + { "select-reference-this-line", A_info_select_reference_this_line }, + { "abort-key", A_info_abort_key }, + { "move-to-window-line", A_info_move_to_window_line }, + { "redraw-display", A_info_redraw_display }, + { "quit", A_info_quit }, + { "do-lowercase-version", A_info_do_lowercase_version }, + { "add-digit-to-numeric-arg", A_info_add_digit_to_numeric_arg }, + { "universal-argument", A_info_universal_argument }, + { "numeric-arg-digit-loop", A_info_numeric_arg_digit_loop }, +/* Commands found in "./echo-area.c". */ + { "echo-area-forward", A_ea_forward }, + { "echo-area-backward", A_ea_backward }, + { "echo-area-beg-of-line", A_ea_beg_of_line }, + { "echo-area-end-of-line", A_ea_end_of_line }, + { "echo-area-forward-word", A_ea_forward_word }, + { "echo-area-backward-word", A_ea_backward_word }, + { "echo-area-delete", A_ea_delete }, + { "echo-area-rubout", A_ea_rubout }, + { "echo-area-abort", A_ea_abort }, + { "echo-area-newline", A_ea_newline }, + { "echo-area-quoted-insert", A_ea_quoted_insert }, + { "echo-area-insert", A_ea_insert }, + { "echo-area-tab-insert", A_ea_tab_insert }, + { "echo-area-transpose-chars", A_ea_transpose_chars }, + { "echo-area-yank", A_ea_yank }, + { "echo-area-yank-pop", A_ea_yank_pop }, + { "echo-area-kill-line", A_ea_kill_line }, + { "echo-area-backward-kill-line", A_ea_backward_kill_line }, + { "echo-area-kill-word", A_ea_kill_word }, + { "echo-area-backward-kill-word", A_ea_backward_kill_word }, + { "echo-area-possible-completions", A_ea_possible_completions }, + { "echo-area-complete", A_ea_complete }, + { "echo-area-scroll-completions-window", A_ea_scroll_completions_window }, +/* Commands found in "./infodoc.c". */ + { "get-help-window", A_info_get_help_window }, + { "get-info-help-node", A_info_get_info_help_node }, + { "describe-key", A_describe_key }, + { "where-is", A_info_where_is }, +/* Commands found in "./m-x.c". */ + { "describe-command", A_describe_command }, + { "execute-command", A_info_execute_command }, + { "set-screen-height", A_set_screen_height }, +/* Commands found in "./indices.c". */ + { "index-search", A_info_index_search }, + { "next-index-match", A_info_next_index_match }, + { "index-apropos", A_info_index_apropos }, +/* Commands found in "./nodemenu.c". */ + { "list-visited-nodes", A_list_visited_nodes }, + { "select-visited-node", A_select_visited_node }, +/* Commands found in "./footnotes.c". */ + { "show-footnotes", A_info_show_footnotes }, +/* Commands found in "./variables.c". */ + { "describe-variable", A_describe_variable }, + { "set-variable", A_set_variable }, + (char *)0 +}; diff --git a/contrib/texinfo/info/doc.h b/contrib/texinfo/info/key.h similarity index 53% copy from contrib/texinfo/info/doc.h copy to contrib/texinfo/info/key.h index 423998e37c88..35d2762211f6 100644 --- a/contrib/texinfo/info/doc.h +++ b/contrib/texinfo/info/key.h @@ -1,50 +1,35 @@ -/* doc.h -- Structure associating function pointers with documentation. */ +/* key.h -- Structure associating function names with numeric codes. */ /* This file is part of GNU Info, a program for reading online documentation stored in Info format. Copyright (C) 1993 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). */ + Written by Andrew Bettison <andrewb@zip.com.au> */ -#if !defined (DOC_H) -#define DOC_H - -#include "info.h" /* for NAMED_FUNCTIONS, VFunction, etc. */ +#if !defined (KEY_H) +#define KEY_H typedef struct { - VFunction *func; -#if defined (NAMED_FUNCTIONS) - char *func_name; -#endif /* NAMED_FUNCTIONS */ - char *doc; -} FUNCTION_DOC; - -extern FUNCTION_DOC function_doc_array[]; - -extern char *function_documentation (); -extern char *key_documentation (); -extern char *pretty_keyname (); -extern char *replace_in_documentation (); -extern void info_document_key (); -extern void dump_map_to_message_buffer (); - -#if defined (NAMED_FUNCTIONS) -extern char *function_name (); -extern VFunction *named_function (); -#endif /* NAMED_FUNCTIONS */ -#endif /* !DOC_H */ + char *name; + unsigned char code; +} + FUNCTION_KEY; + +extern FUNCTION_KEY function_key_array[]; + +#endif /* !KEY_H */ diff --git a/contrib/texinfo/info/m-x.c b/contrib/texinfo/info/m-x.c index 2fc5a60561a6..5085235b4032 100644 --- a/contrib/texinfo/info/m-x.c +++ b/contrib/texinfo/info/m-x.c @@ -1,204 +1,211 @@ /* m-x.c -- Meta-x minibuffer reader. - $Id: m-x.c,v 1.8 1999/06/25 21:57:40 karl Exp $ + $Id: m-x.c,v 1.9 2001/11/16 23:14:33 karl Exp $ - Copyright (C) 1993, 97, 98 Free Software Foundation, Inc. + Copyright (C) 1993, 97, 98, 2001 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). */ #include "info.h" +#include "funs.h" /* **************************************************************** */ /* */ /* Reading Named Commands */ /* */ /* **************************************************************** */ /* Read the name of an Info function in the echo area and return the name. A return value of NULL indicates that no function name could be read. */ char * read_function_name (prompt, window) char *prompt; WINDOW *window; { register int i; char *line; REFERENCE **array = (REFERENCE **)NULL; int array_index = 0, array_slots = 0; /* Make an array of REFERENCE which actually contains the names of the functions available in Info. */ for (i = 0; function_doc_array[i].func; i++) { REFERENCE *entry; entry = (REFERENCE *)xmalloc (sizeof (REFERENCE)); entry->label = xstrdup (function_doc_array[i].func_name); entry->nodename = (char *)NULL; entry->filename = (char *)NULL; add_pointer_to_array (entry, array_index, array, array_slots, 200, REFERENCE *); } line = info_read_completing_in_echo_area (window, prompt, array); info_free_references (array); if (!echo_area_is_active) window_clear_echo_area (); return (line); } DECLARE_INFO_COMMAND (describe_command, _("Read the name of an Info command and describe it")) { char *line; line = read_function_name (_("Describe command: "), window); if (!line) { info_abort_key (active_window, count, key); return; } /* Describe the function named in "LINE". */ if (*line) { - VFunction *fun = named_function (line); + InfoCommand *cmd = named_function (line); - if (!fun) + if (!cmd) return; window_message_in_echo_area ("%s: %s.", - line, function_documentation (fun)); + line, function_documentation (cmd)); } free (line); } DECLARE_INFO_COMMAND (info_execute_command, _("Read a command name in the echo area and execute it")) { char *line; + char *keys; + char *prompt; - /* Ask the completer to read a reference for us. */ - if (info_explicit_arg || count != 1) - { - char *prompt; + prompt = (char *)xmalloc (20); - prompt = (char *)xmalloc (20); - sprintf (prompt, "%d M-x ", count); - line = read_function_name (prompt, window); - } + keys = where_is (info_keymap, InfoCmd(info_execute_command)); + /* If the where_is () function thinks that this command doesn't exist, + there's something very wrong! */ + if (!keys) + abort(); + + if (info_explicit_arg || count != 1) + sprintf (prompt, "%d %s ", count, keys); else - line = read_function_name ("M-x ", window); + sprintf (prompt, "%s ", keys); + + /* Ask the completer to read a reference for us. */ + line = read_function_name (prompt, window); /* User aborted? */ if (!line) { info_abort_key (active_window, count, key); return; } /* User accepted "default"? (There is none.) */ if (!*line) { free (line); return; } /* User wants to execute a named command. Do it. */ { - VFunction *function; + InfoCommand *command; if ((active_window != the_echo_area) && (strncmp (line, "echo-area-", 10) == 0)) { free (line); info_error (_("Cannot execute an `echo-area' command here.")); return; } - function = named_function (line); + command = named_function (line); free (line); - if (!function) + if (!command) return; - (*function) (active_window, count, 0); + (*InfoFunction(command)) (active_window, count, 0); } } /* Okay, now that we have M-x, let the user set the screen height. */ DECLARE_INFO_COMMAND (set_screen_height, _("Set the height of the displayed window")) { int new_height, old_height = screenheight; if (info_explicit_arg || count != 1) new_height = count; else { char prompt[80]; char *line; new_height = screenheight; sprintf (prompt, _("Set screen height to (%d): "), new_height); line = info_read_in_echo_area (window, prompt); /* If the user aborted, do that now. */ if (!line) { info_abort_key (active_window, count, 0); return; } /* Find out what the new height is supposed to be. */ if (*line) new_height = atoi (line); /* Clear the echo area if it isn't active. */ if (!echo_area_is_active) window_clear_echo_area (); free (line); } terminal_clear_screen (); display_clear_display (the_display); screenheight = new_height; #ifdef SET_SCREEN_SIZE_HELPER SET_SCREEN_SIZE_HELPER; #endif if (screenheight == old_height) { /* Display dimensions didn't actually change, so window_new_screen_size won't do anything, but we've already cleared the display above. Undo the damage. */ window_mark_chain (windows, W_UpdateWindow); display_update_display (windows); } else { display_initialize_display (screenwidth, screenheight); window_new_screen_size (screenwidth, screenheight); } } diff --git a/contrib/texinfo/info/man.c b/contrib/texinfo/info/man.c index ee68cbb6320f..1332cc59f906 100644 --- a/contrib/texinfo/info/man.c +++ b/contrib/texinfo/info/man.c @@ -1,723 +1,748 @@ /* man.c: How to read and format man files. - $Id: man.c,v 1.13 1999/07/05 20:43:23 karl Exp $ + $Id: man.c,v 1.16 2002/02/23 19:12:02 karl Exp $ - Copyright (C) 1995, 97, 98, 99 Free Software Foundation, Inc. + Copyright (C) 1995, 97, 98, 99, 2000 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 Thu May 4 09:17:52 1995 (bfox@ai.mit.edu). */ #include "info.h" #include <sys/ioctl.h> #include "signals.h" #if defined (HAVE_SYS_TIME_H) #include <sys/time.h> #endif #if defined (HAVE_SYS_WAIT_H) #include <sys/wait.h> #endif #include "tilde.h" #include "man.h" #if !defined (_POSIX_VERSION) #define pid_t int #endif #if defined (FD_SET) # if defined (hpux) # define fd_set_cast(x) (int *)(x) # else # define fd_set_cast(x) (fd_set *)(x) # endif /* !hpux */ #endif /* FD_SET */ #if STRIP_DOT_EXE static char const * const exec_extensions[] = { ".exe", ".com", ".bat", ".btm", ".sh", ".ksh", ".pl", ".sed", "", NULL }; #else static char const * const exec_extensions[] = { "", NULL }; #endif static char *read_from_fd (); static void clean_manpage (); static NODE *manpage_node_of_file_buffer (); static char *get_manpage_contents (); NODE * make_manpage_node (pagename) char *pagename; { return (info_get_node (MANPAGE_FILE_BUFFER_NAME, pagename)); } NODE * get_manpage_node (file_buffer, pagename) FILE_BUFFER *file_buffer; char *pagename; { NODE *node; node = manpage_node_of_file_buffer (file_buffer, pagename); if (!node) { char *page; page = get_manpage_contents (pagename); if (page) { char header[1024]; long oldsize, newsize; int hlen, plen; char *old_contents = file_buffer->contents; sprintf (header, "\n\n%c\n%s %s, %s %s, %s (dir)\n\n", INFO_COOKIE, INFO_FILE_LABEL, file_buffer->filename, INFO_NODE_LABEL, pagename, INFO_UP_LABEL); oldsize = file_buffer->filesize; hlen = strlen (header); plen = strlen (page); newsize = (oldsize + hlen + plen); file_buffer->contents = (char *)xrealloc (file_buffer->contents, 1 + newsize); memcpy (file_buffer->contents + oldsize, header, hlen); memcpy (file_buffer->contents + oldsize + hlen, page, plen); file_buffer->contents[newsize] = '\0'; file_buffer->filesize = newsize; file_buffer->finfo.st_size = newsize; build_tags_and_nodes (file_buffer); free (page); /* We have just relocated file_buffer->contents from under the feet of info_windows[] array. Therefore, all the nodes on that list which are showing man pages have their contents member pointing into the blue. Undo that harm. */ if (old_contents && oldsize && old_contents != file_buffer->contents) { int iw; INFO_WINDOW *info_win; char *old_contents_end = old_contents + oldsize; for (iw = 0; (info_win = info_windows[iw]); iw++) { int in; for (in = 0; in < info_win->nodes_index; in++) { NODE *node = info_win->nodes[in]; /* It really only suffices to see that node->filename is "*manpages*". But after several hours of debugging this, would you blame me for being a bit paranoid? */ if (node && node->filename && node->contents && strcmp (node->filename, MANPAGE_FILE_BUFFER_NAME) == 0 && node->contents >= old_contents && node->contents + node->nodelen <= old_contents_end) { info_win->nodes[in] = manpage_node_of_file_buffer (file_buffer, node->nodename); free (node->nodename); free (node); } } } } } node = manpage_node_of_file_buffer (file_buffer, pagename); } return (node); } FILE_BUFFER * create_manpage_file_buffer () { FILE_BUFFER *file_buffer = make_file_buffer (); file_buffer->filename = xstrdup (MANPAGE_FILE_BUFFER_NAME); file_buffer->fullpath = xstrdup (MANPAGE_FILE_BUFFER_NAME); file_buffer->finfo.st_size = 0; file_buffer->filesize = 0; file_buffer->contents = (char *)NULL; file_buffer->flags = (N_IsInternal | N_CannotGC | N_IsManPage); return (file_buffer); } /* Scan the list of directories in PATH looking for FILENAME. If we find one that is an executable file, return it as a new string. Otherwise, return a NULL pointer. */ static char * executable_file_in_path (filename, path) char *filename, *path; { struct stat finfo; char *temp_dirname; int statable, dirname_index; dirname_index = 0; while ((temp_dirname = extract_colon_unit (path, &dirname_index))) { char *temp; char *temp_end; int i; /* Expand a leading tilde if one is present. */ if (*temp_dirname == '~') { char *expanded_dirname; expanded_dirname = tilde_expand_word (temp_dirname); free (temp_dirname); temp_dirname = expanded_dirname; } temp = (char *)xmalloc (34 + strlen (temp_dirname) + strlen (filename)); strcpy (temp, temp_dirname); if (!IS_SLASH (temp[(strlen (temp)) - 1])) strcat (temp, "/"); strcat (temp, filename); temp_end = temp + strlen (temp); free (temp_dirname); /* Look for FILENAME, possibly with any of the extensions in EXEC_EXTENSIONS[]. */ for (i = 0; exec_extensions[i]; i++) { if (exec_extensions[i][0]) strcpy (temp_end, exec_extensions[i]); statable = (stat (temp, &finfo) == 0); /* If we have found a regular executable file, then use it. */ if ((statable) && (S_ISREG (finfo.st_mode)) && (access (temp, X_OK) == 0)) return (temp); } free (temp); } return ((char *)NULL); } /* Return the full pathname of the system man page formatter. */ static char * find_man_formatter () { return (executable_file_in_path ("man", (char *)getenv ("PATH"))); } static char *manpage_pagename = (char *)NULL; static char *manpage_section = (char *)NULL; static void get_page_and_section (pagename) char *pagename; { register int i; if (manpage_pagename) free (manpage_pagename); if (manpage_section) free (manpage_section); manpage_pagename = (char *)NULL; manpage_section = (char *)NULL; for (i = 0; pagename[i] != '\0' && pagename[i] != '('; i++); manpage_pagename = (char *)xmalloc (1 + i); strncpy (manpage_pagename, pagename, i); manpage_pagename[i] = '\0'; if (pagename[i] == '(') { int start; start = i + 1; for (i = start; pagename[i] != '\0' && pagename[i] != ')'; i++); manpage_section = (char *)xmalloc (1 + (i - start)); strncpy (manpage_section, pagename + start, (i - start)); manpage_section[i - start] = '\0'; } } #if PIPE_USE_FORK static void reap_children (sig) int sig; { wait (NULL); } #endif static char * get_manpage_contents (pagename) char *pagename; { static char *formatter_args[4] = { (char *)NULL }; int pipes[2]; pid_t child; RETSIGTYPE (*sigsave) (); char *formatted_page = NULL; int arg_index = 1; if (formatter_args[0] == (char *)NULL) formatter_args[0] = find_man_formatter (); if (formatter_args[0] == (char *)NULL) return ((char *)NULL); get_page_and_section (pagename); if (manpage_section != (char *)NULL) formatter_args[arg_index++] = manpage_section; formatter_args[arg_index++] = manpage_pagename; formatter_args[arg_index] = (char *)NULL; /* Open a pipe to this program, read the output, and save it away in FORMATTED_PAGE. The reader end of the pipe is pipes[0]; the writer end is pipes[1]. */ #if PIPE_USE_FORK pipe (pipes); sigsave = signal (SIGCHLD, reap_children); child = fork (); if (child == -1) return ((char *)NULL); if (child != 0) { /* In the parent, close the writing end of the pipe, and read from the exec'd child. */ close (pipes[1]); formatted_page = read_from_fd (pipes[0]); close (pipes[0]); signal (SIGCHLD, sigsave); } else { /* In the child, close the read end of the pipe, make the write end of the pipe be stdout, and execute the man page formatter. */ close (pipes[0]); freopen (NULL_DEVICE, "w", stderr); freopen (NULL_DEVICE, "r", stdin); dup2 (pipes[1], fileno (stdout)); execv (formatter_args[0], formatter_args); /* If we get here, we couldn't exec, so close out the pipe and exit. */ close (pipes[1]); xexit (0); } #else /* !PIPE_USE_FORK */ /* Cannot fork/exec, but can popen/pclose. */ { FILE *fpipe; char *cmdline = xmalloc (strlen (formatter_args[0]) + strlen (manpage_pagename) + (arg_index > 2 ? strlen (manpage_section) : 0) + 3); int save_stderr = dup (fileno (stderr)); int fd_err = open (NULL_DEVICE, O_WRONLY, 0666); if (fd_err > 2) dup2 (fd_err, fileno (stderr)); /* Don't print errors. */ sprintf (cmdline, "%s %s %s", formatter_args[0], manpage_pagename, arg_index > 2 ? manpage_section : ""); fpipe = popen (cmdline, "r"); free (cmdline); if (fd_err > 2) close (fd_err); dup2 (save_stderr, fileno (stderr)); if (fpipe == 0) return ((char *)NULL); formatted_page = read_from_fd (fileno (fpipe)); if (pclose (fpipe) == -1) { if (formatted_page) free (formatted_page); return ((char *)NULL); } } #endif /* !PIPE_USE_FORK */ /* If we have the page, then clean it up. */ if (formatted_page) clean_manpage (formatted_page); return (formatted_page); } static void clean_manpage (manpage) char *manpage; { register int i, j; int newline_count = 0; char *newpage; newpage = (char *)xmalloc (1 + strlen (manpage)); for (i = 0, j = 0; (newpage[j] = manpage[i]); i++, j++) { if (manpage[i] == '\n') newline_count++; else newline_count = 0; if (newline_count == 3) { j--; newline_count--; } - if (manpage[i] == '\b' || manpage[i] == '\f') + /* A malformed man page could have a \b as its first character, + in which case decrementing j by 2 will cause us to write into + newpage[-1], smashing the hidden info stored there by malloc. */ + if (manpage[i] == '\b' || manpage[i] == '\f' && j > 0) j -= 2; + else if (!raw_escapes_p) + { + /* Remove the ANSI escape sequences for color, boldface, + underlining, and italics, generated by some versions of + Groff. */ + if (manpage[i] == '\033' && manpage[i + 1] == '[' + && isdigit (manpage[i + 2])) + { + if (isdigit (manpage[i + 3]) && manpage[i + 4] == 'm') + { + i += 4; + j--; + } + else if (manpage[i + 3] == 'm') + { + i += 3; + j--; + } + /* Else do nothing: it's some unknown escape sequence, + so let's leave it alone. */ + } + } } - newpage[j++] = '\0'; + newpage[j++] = 0; strcpy (manpage, newpage); free (newpage); } static NODE * manpage_node_of_file_buffer (file_buffer, pagename) FILE_BUFFER *file_buffer; char *pagename; { NODE *node = (NODE *)NULL; TAG *tag = (TAG *)NULL; if (file_buffer->contents) { register int i; for (i = 0; (tag = file_buffer->tags[i]); i++) { if (strcasecmp (pagename, tag->nodename) == 0) break; } } if (tag) { node = (NODE *)xmalloc (sizeof (NODE)); node->filename = file_buffer->filename; node->nodename = xstrdup (tag->nodename); node->contents = file_buffer->contents + tag->nodestart; node->nodelen = tag->nodelen; node->flags = 0; node->display_pos = 0; node->parent = (char *)NULL; node->flags = (N_HasTagsTable | N_IsManPage); node->contents += skip_node_separator (node->contents); } return (node); } static char * read_from_fd (fd) int fd; { struct timeval timeout; char *buffer = (char *)NULL; int bsize = 0; int bindex = 0; int select_result; #if defined (FD_SET) fd_set read_fds; timeout.tv_sec = 15; timeout.tv_usec = 0; FD_ZERO (&read_fds); FD_SET (fd, &read_fds); select_result = select (fd + 1, fd_set_cast (&read_fds), 0, 0, &timeout); #else /* !FD_SET */ select_result = 1; #endif /* !FD_SET */ switch (select_result) { case 0: case -1: break; default: { int amount_read; int done = 0; while (!done) { while ((bindex + 1024) > (bsize)) buffer = (char *)xrealloc (buffer, (bsize += 1024)); buffer[bindex] = '\0'; amount_read = read (fd, buffer + bindex, 1023); if (amount_read < 0) { done = 1; } else { bindex += amount_read; buffer[bindex] = '\0'; if (amount_read == 0) done = 1; } } } } if ((buffer != (char *)NULL) && (*buffer == '\0')) { free (buffer); buffer = (char *)NULL; } return (buffer); } static char *reference_section_starters[] = { "\nRELATED INFORMATION", "\nRELATED\tINFORMATION", "RELATED INFORMATION\n", "RELATED\tINFORMATION\n", "\nSEE ALSO", "\nSEE\tALSO", "SEE ALSO\n", "SEE\tALSO\n", (char *)NULL }; static SEARCH_BINDING frs_binding; static SEARCH_BINDING * find_reference_section (node) NODE *node; { register int i; long position = -1; frs_binding.buffer = node->contents; frs_binding.start = 0; frs_binding.end = node->nodelen; frs_binding.flags = S_SkipDest; for (i = 0; reference_section_starters[i] != (char *)NULL; i++) { position = search_forward (reference_section_starters[i], &frs_binding); if (position != -1) break; } if (position == -1) return ((SEARCH_BINDING *)NULL); /* We found the start of the reference section, and point is right after the string which starts it. The text from here to the next header (or end of buffer) contains the only references in this manpage. */ frs_binding.start = position; for (i = frs_binding.start; i < frs_binding.end - 2; i++) { if ((frs_binding.buffer[i] == '\n') && (!whitespace (frs_binding.buffer[i + 1]))) { frs_binding.end = i; break; } } return (&frs_binding); } REFERENCE ** xrefs_of_manpage (node) NODE *node; { SEARCH_BINDING *reference_section; REFERENCE **refs = (REFERENCE **)NULL; int refs_index = 0; int refs_slots = 0; long position; reference_section = find_reference_section (node); if (reference_section == (SEARCH_BINDING *)NULL) return ((REFERENCE **)NULL); /* Grovel the reference section building a list of references found there. A reference is alphabetic characters followed by non-whitespace text within parenthesis. */ reference_section->flags = 0; while ((position = search_forward ("(", reference_section)) != -1) { register int start, end; for (start = position; start > reference_section->start; start--) if (whitespace (reference_section->buffer[start])) break; start++; for (end = position; end < reference_section->end; end++) { if (whitespace (reference_section->buffer[end])) { end = start; break; } if (reference_section->buffer[end] == ')') { end++; break; } } if (end != start) { REFERENCE *entry; int len = end - start; entry = (REFERENCE *)xmalloc (sizeof (REFERENCE)); entry->label = (char *)xmalloc (1 + len); strncpy (entry->label, (reference_section->buffer) + start, len); entry->label[len] = '\0'; entry->filename = xstrdup (node->filename); entry->nodename = xstrdup (entry->label); entry->start = start; entry->end = end; add_pointer_to_array (entry, refs_index, refs, refs_slots, 10, REFERENCE *); } reference_section->start = position + 1; } return (refs); } long locate_manpage_xref (node, start, dir) NODE *node; long start; int dir; { REFERENCE **refs; long position = -1; refs = xrefs_of_manpage (node); if (refs) { register int i, count; REFERENCE *entry; for (i = 0; refs[i]; i++); count = i; if (dir > 0) { for (i = 0; (entry = refs[i]); i++) if (entry->start > start) { position = entry->start; break; } } else { for (i = count - 1; i > -1; i--) { entry = refs[i]; if (entry->start < start) { position = entry->start; break; } } } info_free_references (refs); } return (position); } /* This one was a little tricky. The binding buffer that is passed in has a START and END value of 0 -- strlen (window-line-containing-point). The BUFFER is a pointer to the start of that line. */ REFERENCE ** manpage_xrefs_in_binding (node, binding) NODE *node; SEARCH_BINDING *binding; { register int i; REFERENCE **all_refs = xrefs_of_manpage (node); REFERENCE **brefs = (REFERENCE **)NULL; REFERENCE *entry; int brefs_index = 0; int brefs_slots = 0; int start, end; if (!all_refs) return ((REFERENCE **)NULL); start = binding->start + (binding->buffer - node->contents); end = binding->end + (binding->buffer - node->contents); for (i = 0; (entry = all_refs[i]); i++) { if ((entry->start > start) && (entry->end < end)) { add_pointer_to_array (entry, brefs_index, brefs, brefs_slots, 10, REFERENCE *); } else { maybe_free (entry->label); maybe_free (entry->filename); maybe_free (entry->nodename); free (entry); } } free (all_refs); return (brefs); } diff --git a/contrib/texinfo/info/nodes.c b/contrib/texinfo/info/nodes.c index 0aaee525013d..7f0bf0f343bd 100644 --- a/contrib/texinfo/info/nodes.c +++ b/contrib/texinfo/info/nodes.c @@ -1,1277 +1,1279 @@ /* nodes.c -- how to get an Info file and node. - $Id: nodes.c,v 1.14 1999/08/15 10:18:09 karl Exp $ + $Id: nodes.c,v 1.15 2000/11/11 00:40:37 karl Exp $ - Copyright (C) 1993, 98, 99 Free Software Foundation, Inc. + Copyright (C) 1993, 98, 99, 2000 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). */ #include "info.h" #include "nodes.h" #include "search.h" #include "filesys.h" #include "info-utils.h" #if defined (HANDLE_MAN_PAGES) # include "man.h" #endif /* HANDLE_MAN_PAGES */ static void forget_info_file (), remember_info_file (); static void free_file_buffer_tags (), free_info_tag (); static void get_nodes_of_tags_table (), get_nodes_of_info_file (); static void get_tags_of_indirect_tags_table (); static void info_reload_file_buffer_contents (); static char *adjust_nodestart (); static FILE_BUFFER *info_load_file_internal (), *info_find_file_internal (); static NODE *info_node_of_file_buffer_tags (); static long get_node_length (); /* Magic number that RMS used to decide how much a tags table pointer could be off by. I feel that it should be much smaller, like 4. */ #define DEFAULT_INFO_FUDGE 1000 /* Passed to *_internal functions. INFO_GET_TAGS says to do what is neccessary to fill in the nodes or tags arrays in FILE_BUFFER. */ #define INFO_NO_TAGS 0 #define INFO_GET_TAGS 1 /* Global variables. */ /* When non-zero, this is a string describing the recent file error. */ char *info_recent_file_error = NULL; /* The list of already loaded nodes. */ FILE_BUFFER **info_loaded_files = NULL; /* The number of slots currently allocated to LOADED_FILES. */ int info_loaded_files_slots = 0; /* Public functions for node manipulation. */ /* Used to build `dir' menu from `localdir' files found in INFOPATH. */ extern void maybe_build_dir_node (); /* Return a pointer to a NODE structure for the Info node (FILENAME)NODENAME. If FILENAME is NULL, `dir' is used. IF NODENAME is NULL, `Top' is used. If the node cannot be found, return NULL. */ NODE * info_get_node (filename, nodename) char *filename, *nodename; { NODE *node; FILE_BUFFER *file_buffer = NULL; info_recent_file_error = NULL; info_parse_node (nodename, DONT_SKIP_NEWLINES); nodename = NULL; if (info_parsed_filename) filename = info_parsed_filename; if (info_parsed_nodename) nodename = info_parsed_nodename; /* If FILENAME is not specified, it defaults to "dir". */ if (!filename) filename = "dir"; /* If the file to be looked up is "dir", build the contents from all of the "dir"s and "localdir"s found in INFOPATH. */ if (is_dir_name (filename)) maybe_build_dir_node (filename); /* Find the correct info file, or give up. */ file_buffer = info_find_file (filename); if (!file_buffer) { if (filesys_error_number) info_recent_file_error = filesys_error_string (filename, filesys_error_number); return NULL; } /* Look for the node. */ node = info_get_node_of_file_buffer (nodename, file_buffer); /* If the node not found was "Top", try again with different case. */ if (!node && (nodename == NULL || strcasecmp (nodename, "Top") == 0)) { node = info_get_node_of_file_buffer ("Top", file_buffer); if (!node) node = info_get_node_of_file_buffer ("top", file_buffer); if (!node) node = info_get_node_of_file_buffer ("TOP", file_buffer); } return node; } /* Return a pointer to a NODE structure for the Info node NODENAME in FILE_BUFFER. NODENAME can be passed as NULL, in which case the nodename of "Top" is used. If the node cannot be found, return a NULL pointer. */ NODE * info_get_node_of_file_buffer (nodename, file_buffer) char *nodename; FILE_BUFFER *file_buffer; { NODE *node = NULL; /* If we are unable to find the file, we have to give up. There isn't anything else we can do. */ if (!file_buffer) return NULL; /* If the file buffer was gc'ed, reload the contents now. */ if (!file_buffer->contents) info_reload_file_buffer_contents (file_buffer); /* If NODENAME is not specified, it defaults to "Top". */ if (!nodename) nodename = "Top"; /* If the name of the node that we wish to find is exactly "*", then the node body is the contents of the entire file. Create and return such a node. */ if (strcmp (nodename, "*") == 0) { node = (NODE *)xmalloc (sizeof (NODE)); node->filename = file_buffer->fullpath; node->parent = NULL; node->nodename = xstrdup ("*"); node->contents = file_buffer->contents; node->nodelen = file_buffer->filesize; node->flags = 0; node->display_pos = 0; } #if defined (HANDLE_MAN_PAGES) /* If the file buffer is the magic one associated with manpages, call the manpage node finding function instead. */ else if (file_buffer->flags & N_IsManPage) { node = get_manpage_node (file_buffer, nodename); } #endif /* HANDLE_MAN_PAGES */ /* If this is the "main" info file, it might contain a tags table. Search the tags table for an entry which matches the node that we want. If there is a tags table, get the file which contains this node, but don't bother building a node list for it. */ else if (file_buffer->tags) { node = info_node_of_file_buffer_tags (file_buffer, nodename); } /* Return the results of our node search. */ return node; } /* Locate the file named by FILENAME, and return the information structure describing this file. The file may appear in our list of loaded files already, or it may not. If it does not already appear, find the file, and add it to the list of loaded files. If the file cannot be found, return a NULL FILE_BUFFER *. */ FILE_BUFFER * info_find_file (filename) char *filename; { return info_find_file_internal (filename, INFO_GET_TAGS); } /* Load the info file FILENAME, remembering information about it in a file buffer. */ FILE_BUFFER * info_load_file (filename) char *filename; { return info_load_file_internal (filename, INFO_GET_TAGS); } /* Private functions implementation. */ /* The workhorse for info_find_file (). Non-zero 2nd argument says to try to build a tags table (or otherwise glean the nodes) for this file once found. By default, we build the tags table, but when this function is called by info_get_node () when we already have a valid tags table describing the nodes, it is unnecessary. */ static FILE_BUFFER * info_find_file_internal (filename, get_tags) char *filename; int get_tags; { int i; FILE_BUFFER *file_buffer; /* First try to find the file in our list of already loaded files. */ if (info_loaded_files) { for (i = 0; (file_buffer = info_loaded_files[i]); i++) - if ((FILENAME_CMP (filename, file_buffer->filename) == 0) || - (FILENAME_CMP (filename, file_buffer->fullpath) == 0) || - (!IS_ABSOLUTE (filename) && - FILENAME_CMP (filename, - filename_non_directory (file_buffer->fullpath)) == 0)) + if ((FILENAME_CMP (filename, file_buffer->filename) == 0) + || (FILENAME_CMP (filename, file_buffer->fullpath) == 0) + || (!IS_ABSOLUTE (filename) + && FILENAME_CMP (filename, + filename_non_directory (file_buffer->fullpath)) + == 0)) { struct stat new_info, *old_info; /* This file is loaded. If the filename that we want is specifically "dir", then simply return the file buffer. */ if (is_dir_name (filename_non_directory (filename))) return file_buffer; #if defined (HANDLE_MAN_PAGES) /* Do the same for the magic MANPAGE file. */ if (file_buffer->flags & N_IsManPage) return file_buffer; #endif /* HANDLE_MAN_PAGES */ - /* The file appears to be already loaded, and it is not "dir". - Check to see if it has changed since the last time it was - loaded. */ + /* The file appears to be already loaded, and is not "dir". Check + to see if it's changed since the last time it was loaded. */ if (stat (file_buffer->fullpath, &new_info) == -1) { filesys_error_number = errno; return NULL; } old_info = &file_buffer->finfo; - if ((new_info.st_size != old_info->st_size) || - (new_info.st_mtime != old_info->st_mtime)) + if (new_info.st_size != old_info->st_size + || new_info.st_mtime != old_info->st_mtime) { /* The file has changed. Forget that we ever had loaded it in the first place. */ forget_info_file (filename); break; } else { /* The info file exists, and has not changed since the last time it was loaded. If the caller requested a nodes list for this file, and there isn't one here, build the nodes for this file_buffer. In any case, return the file_buffer object. */ - if (!file_buffer->contents) - { - /* The file's contents have been gc'ed. Reload it. */ - info_reload_file_buffer_contents (file_buffer); - if (!file_buffer->contents) - return NULL; - } + if (!file_buffer->contents) + { + /* The file's contents have been gc'ed. Reload it. */ + info_reload_file_buffer_contents (file_buffer); + if (!file_buffer->contents) + return NULL; + } if (get_tags && !file_buffer->tags) build_tags_and_nodes (file_buffer); return file_buffer; } } } /* The file wasn't loaded. Try to load it now. */ #if defined (HANDLE_MAN_PAGES) /* If the name of the file that we want is our special file buffer for Unix manual pages, then create the file buffer, and return it now. */ if (strcasecmp (filename, MANPAGE_FILE_BUFFER_NAME) == 0) file_buffer = create_manpage_file_buffer (); else #endif /* HANDLE_MAN_PAGES */ file_buffer = info_load_file_internal (filename, get_tags); /* If the file was loaded, remember the name under which it was found. */ if (file_buffer) remember_info_file (file_buffer); return file_buffer; } /* The workhorse function for info_load_file (). Non-zero second argument says to build a list of tags (or nodes) for this file. This is the default behaviour when info_load_file () is called, but it is not necessary when loading a subfile for which we already have tags. */ static FILE_BUFFER * info_load_file_internal (filename, get_tags) char *filename; int get_tags; { char *fullpath, *contents; long filesize; struct stat finfo; int retcode, compressed; FILE_BUFFER *file_buffer = NULL; /* Get the full pathname of this file, as known by the info system. That is to say, search along INFOPATH and expand tildes, etc. */ fullpath = info_find_fullpath (filename); /* Did we actually find the file? */ retcode = stat (fullpath, &finfo); /* If the file referenced by the name returned from info_find_fullpath () doesn't exist, then try again with the last part of the filename appearing in lowercase. */ /* This is probably not needed at all on those systems which define FILENAME_CMP to be strcasecmp. But let's do it anyway, lest some network redirector supports case sensitivity. */ if (retcode < 0) { char *lowered_name; char *basename; lowered_name = xstrdup (filename); basename = filename_non_directory (lowered_name); while (*basename) { if (isupper (*basename)) *basename = tolower (*basename); basename++; } fullpath = info_find_fullpath (lowered_name); free (lowered_name); retcode = stat (fullpath, &finfo); } /* If the file wasn't found, give up, returning a NULL pointer. */ if (retcode < 0) { filesys_error_number = errno; return NULL; } /* Otherwise, try to load the file. */ contents = filesys_read_info_file (fullpath, &filesize, &finfo, &compressed); if (!contents) return NULL; /* The file was found, and can be read. Allocate FILE_BUFFER and fill in the various members. */ file_buffer = make_file_buffer (); file_buffer->filename = xstrdup (filename); file_buffer->fullpath = xstrdup (fullpath); file_buffer->finfo = finfo; file_buffer->filesize = filesize; file_buffer->contents = contents; if (compressed) file_buffer->flags |= N_IsCompressed; /* If requested, build the tags and nodes for this file buffer. */ if (get_tags) build_tags_and_nodes (file_buffer); return file_buffer; } /* Grovel FILE_BUFFER->contents finding tags and nodes, and filling in the various slots. This can also be used to rebuild a tag or node table. */ void build_tags_and_nodes (file_buffer) FILE_BUFFER *file_buffer; { SEARCH_BINDING binding; long position; free_file_buffer_tags (file_buffer); file_buffer->flags &= ~N_HasTagsTable; /* See if there is a tags table in this info file. */ binding.buffer = file_buffer->contents; binding.start = file_buffer->filesize; binding.end = binding.start - 1000; if (binding.end < 0) binding.end = 0; binding.flags = S_FoldCase; position = search_backward (TAGS_TABLE_END_LABEL, &binding); /* If there is a tag table, find the start of it, and grovel over it extracting tag information. */ if (position != -1) while (1) { long tags_table_begin, tags_table_end; binding.end = position; binding.start = binding.end - 5 - strlen (TAGS_TABLE_END_LABEL); if (binding.start < 0) binding.start = 0; position = find_node_separator (&binding); /* For this test, (and all others here) failure indicates a bogus tags table. Grovel the file. */ if (position == -1) break; /* Remember the end of the tags table. */ binding.start = position; tags_table_end = binding.start; binding.end = 0; /* Locate the start of the tags table. */ position = search_backward (TAGS_TABLE_BEG_LABEL, &binding); if (position == -1) break; binding.end = position; binding.start = binding.end - 5 - strlen (TAGS_TABLE_BEG_LABEL); position = find_node_separator (&binding); if (position == -1) break; /* The file contains a valid tags table. Fill the FILE_BUFFER's tags member. */ file_buffer->flags |= N_HasTagsTable; tags_table_begin = position; /* If this isn't an indirect tags table, just remember the nodes described locally in this tags table. Note that binding.end is pointing to just after the beginning label. */ binding.start = binding.end; binding.end = file_buffer->filesize; if (!looking_at (TAGS_TABLE_IS_INDIRECT_LABEL, &binding)) { binding.start = tags_table_begin; binding.end = tags_table_end; get_nodes_of_tags_table (file_buffer, &binding); return; } else { /* This is an indirect tags table. Build TAGS member. */ SEARCH_BINDING indirect; indirect.start = tags_table_begin; indirect.end = 0; indirect.buffer = binding.buffer; indirect.flags = S_FoldCase; position = search_backward (INDIRECT_TAGS_TABLE_LABEL, &indirect); if (position == -1) { /* This file is malformed. Give up. */ return; } indirect.start = position; indirect.end = tags_table_begin; binding.start = tags_table_begin; binding.end = tags_table_end; get_tags_of_indirect_tags_table (file_buffer, &indirect, &binding); return; } } /* This file doesn't contain any kind of tags table. Grovel the file and build node entries for it. */ get_nodes_of_info_file (file_buffer); } /* Search through FILE_BUFFER->contents building an array of TAG *, one entry per each node present in the file. Store the tags in FILE_BUFFER->tags, and the number of allocated slots in FILE_BUFFER->tags_slots. */ static void get_nodes_of_info_file (file_buffer) FILE_BUFFER *file_buffer; { long nodestart; int tags_index = 0; SEARCH_BINDING binding; binding.buffer = file_buffer->contents; binding.start = 0; binding.end = file_buffer->filesize; binding.flags = S_FoldCase; while ((nodestart = find_node_separator (&binding)) != -1) { int start, end; char *nodeline; TAG *entry; int anchor = 0; /* Skip past the characters just found. */ binding.start = nodestart; binding.start += skip_node_separator (binding.buffer + binding.start); /* Move to the start of the line defining the node. */ nodeline = binding.buffer + binding.start; /* Find "Node:" */ start = string_in_line (INFO_NODE_LABEL, nodeline); /* No Node:. Maybe it's a Ref:. */ if (start == -1) { start = string_in_line (INFO_REF_LABEL, nodeline); if (start != -1) anchor = 1; } /* If not there, this is not the start of a node. */ if (start == -1) continue; /* Find the start of the nodename. */ start += skip_whitespace (nodeline + start); /* Find the end of the nodename. */ end = start + skip_node_characters (nodeline + start, DONT_SKIP_NEWLINES); /* Okay, we have isolated the node name, and we know where the node starts. Remember this information. */ entry = xmalloc (sizeof (TAG)); entry->nodename = xmalloc (1 + (end - start)); strncpy (entry->nodename, nodeline + start, end - start); entry->nodename[end - start] = 0; entry->nodestart = nodestart; if (anchor) entry->nodelen = 0; else { SEARCH_BINDING node_body; node_body.buffer = binding.buffer + binding.start; node_body.start = 0; node_body.end = binding.end - binding.start; node_body.flags = S_FoldCase; entry->nodelen = get_node_length (&node_body); } entry->filename = file_buffer->fullpath; /* Add this tag to the array of tag structures in this FILE_BUFFER. */ add_pointer_to_array (entry, tags_index, file_buffer->tags, file_buffer->tags_slots, 100, TAG *); } } /* Return the length of the node which starts at BINDING. */ static long get_node_length (binding) SEARCH_BINDING *binding; { int i; char *body; /* [A node] ends with either a ^_, a ^L, or end of file. */ for (i = binding->start, body = binding->buffer; i < binding->end; i++) { if (body[i] == INFO_FF || body[i] == INFO_COOKIE) break; } return i - binding->start; } /* Build and save the array of nodes in FILE_BUFFER by searching through the contents of BUFFER_BINDING for a tags table, and groveling the contents. */ static void get_nodes_of_tags_table (file_buffer, buffer_binding) FILE_BUFFER *file_buffer; SEARCH_BINDING *buffer_binding; { int name_offset; SEARCH_BINDING *search; long position; int tags_index = 0; search = copy_binding (buffer_binding); /* Find the start of the tags table. */ position = find_tags_table (search); /* If none, we're all done. */ if (position == -1) return; /* Move to one character before the start of the actual table. */ search->start = position; search->start += skip_node_separator (search->buffer + search->start); search->start += strlen (TAGS_TABLE_BEG_LABEL); search->start--; /* The tag table consists of lines containing node names and positions. Do each line until we find one that doesn't contain a node name. */ while ((position = search_forward ("\n", search)) != -1) { TAG *entry; char *nodedef; unsigned p; int anchor = 0; /* Prepare to skip this line. */ search->start = position; search->start++; /* Skip past informative "(Indirect)" tags table line. */ if (!tags_index && looking_at (TAGS_TABLE_IS_INDIRECT_LABEL, search)) continue; /* Find the label preceding the node name. */ name_offset = string_in_line (INFO_NODE_LABEL, search->buffer + search->start); /* If no node label, maybe it's an anchor. */ if (name_offset == -1) { name_offset = string_in_line (INFO_REF_LABEL, search->buffer + search->start); if (name_offset != -1) anchor = 1; } /* If not there, not a defining line, so we must be out of the tags table. */ if (name_offset == -1) break; entry = xmalloc (sizeof (TAG)); /* Find the beginning of the node definition. */ search->start += name_offset; nodedef = search->buffer + search->start; nodedef += skip_whitespace (nodedef); /* Move past the node's name in this tag to the TAGSEP character. */ for (p = 0; nodedef[p] && nodedef[p] != INFO_TAGSEP; p++) ; if (nodedef[p] != INFO_TAGSEP) continue; entry->nodename = xmalloc (p + 1); strncpy (entry->nodename, nodedef, p); entry->nodename[p] = 0; p++; entry->nodestart = atol (nodedef + p); /* If a node, we don't know the length yet, but if it's an anchor, the length is 0. */ entry->nodelen = anchor ? 0 : -1; /* The filename of this node is currently known as the same as the name of this file. */ entry->filename = file_buffer->fullpath; /* Add this node structure to the array of node structures in this FILE_BUFFER. */ add_pointer_to_array (entry, tags_index, file_buffer->tags, file_buffer->tags_slots, 100, TAG *); } free (search); } /* A structure used only in `get_tags_of_indirect_tags_table' to hold onto an intermediate value. */ typedef struct { char *filename; long first_byte; } SUBFILE; /* Remember in FILE_BUFFER the nodenames, subfilenames, and offsets within the subfiles of every node which appears in TAGS_BINDING. The 2nd argument is a binding surrounding the indirect files list. */ static void get_tags_of_indirect_tags_table (file_buffer, indirect_binding, tags_binding) FILE_BUFFER *file_buffer; SEARCH_BINDING *indirect_binding, *tags_binding; { int i; SUBFILE **subfiles = NULL; int subfiles_index = 0, subfiles_slots = 0; TAG *entry; /* First get the list of tags from the tags table. Then lookup the associated file in the indirect list for each tag, and update it. */ get_nodes_of_tags_table (file_buffer, tags_binding); /* We have the list of tags in file_buffer->tags. Get the list of subfiles from the indirect table. */ { char *start, *end, *line; SUBFILE *subfile; start = indirect_binding->buffer + indirect_binding->start; end = indirect_binding->buffer + indirect_binding->end; line = start; while (line < end) { int colon; colon = string_in_line (":", line); if (colon == -1) break; subfile = (SUBFILE *)xmalloc (sizeof (SUBFILE)); subfile->filename = (char *)xmalloc (colon); strncpy (subfile->filename, line, colon - 1); subfile->filename[colon - 1] = 0; subfile->first_byte = (long) atol (line + colon); add_pointer_to_array (subfile, subfiles_index, subfiles, subfiles_slots, 10, SUBFILE *); while (*line++ != '\n'); } } /* If we have successfully built the indirect files table, then merge the information in the two tables. */ if (!subfiles) { free_file_buffer_tags (file_buffer); return; } else { int tags_index; long header_length; SEARCH_BINDING binding; /* Find the length of the header of the file containing the indirect tags table. This header appears at the start of every file. We want the absolute position of each node within each subfile, so we subtract the start of the containing subfile from the logical position of the node, and then add the length of the header in. */ binding.buffer = file_buffer->contents; binding.start = 0; binding.end = file_buffer->filesize; binding.flags = S_FoldCase; header_length = find_node_separator (&binding); if (header_length == -1) header_length = 0; /* Build the file buffer's list of subfiles. */ { char *containing_dir = xstrdup (file_buffer->fullpath); - char *temp = filename_non_directory (containing_dir); + char *temp = filename_non_directory (containing_dir); int len_containing_dir; - if (temp > containing_dir) - { - if (HAVE_DRIVE (file_buffer->fullpath) && - temp == containing_dir + 2) - { - /* Avoid converting "d:foo" into "d:/foo" below. */ - *temp = '.'; - temp += 2; - } - temp[-1] = 0; - } + if (temp > containing_dir) + { + if (HAVE_DRIVE (file_buffer->fullpath) && + temp == containing_dir + 2) + { + /* Avoid converting "d:foo" into "d:/foo" below. */ + *temp = '.'; + temp += 2; + } + temp[-1] = 0; + } len_containing_dir = strlen (containing_dir); for (i = 0; subfiles[i]; i++); file_buffer->subfiles = (char **) xmalloc ((1 + i) * sizeof (char *)); for (i = 0; subfiles[i]; i++) { char *fullpath; fullpath = (char *) xmalloc (2 + strlen (subfiles[i]->filename) + len_containing_dir); sprintf (fullpath, "%s/%s", containing_dir, subfiles[i]->filename); file_buffer->subfiles[i] = fullpath; } file_buffer->subfiles[i] = NULL; free (containing_dir); } /* For each node in the file's tags table, remember the starting position. */ for (tags_index = 0; (entry = file_buffer->tags[tags_index]); tags_index++) { for (i = 0; subfiles[i] && entry->nodestart >= subfiles[i]->first_byte; i++); /* If the Info file containing the indirect tags table is malformed, then give up. */ if (!i) { /* The Info file containing the indirect tags table is malformed. Give up. */ for (i = 0; subfiles[i]; i++) { free (subfiles[i]->filename); free (subfiles[i]); free (file_buffer->subfiles[i]); } file_buffer->subfiles = NULL; free_file_buffer_tags (file_buffer); return; } /* SUBFILES[i] is the index of the first subfile whose logical first byte is greater than the logical offset of this node's starting position. This means that the subfile directly preceding this one is the one containing the node. */ entry->filename = file_buffer->subfiles[i - 1]; entry->nodestart -= subfiles[i - 1]->first_byte; entry->nodestart += header_length; } /* We have successfully built the tags table. Remember that it was indirect. */ file_buffer->flags |= N_TagsIndirect; } /* Free the structures assigned to SUBFILES. Free the names as well as the structures themselves, then finally, the array. */ for (i = 0; subfiles[i]; i++) { free (subfiles[i]->filename); free (subfiles[i]); } free (subfiles); } /* Return the node that contains TAG in FILE_BUFFER, else (pathologically) NULL. Called from info_node_of_file_buffer_tags. */ static NODE * find_node_of_anchor (file_buffer, tag) FILE_BUFFER *file_buffer; TAG *tag; { int anchor_pos, node_pos; TAG *node_tag; NODE *node; /* Look through the tag list for the anchor. */ for (anchor_pos = 0; file_buffer->tags[anchor_pos]; anchor_pos++) { TAG *t = file_buffer->tags[anchor_pos]; if (t->nodestart == tag->nodestart) break; } /* Should not happen, because we should always find the anchor. */ if (!file_buffer->tags[anchor_pos]) return NULL; /* We've found the anchor. Look backwards in the tag table for the preceding node (we're assuming the tags are given in order), skipping over any preceding anchors. */ for (node_pos = anchor_pos - 1; node_pos >= 0 && file_buffer->tags[node_pos]->nodelen == 0; node_pos--) ; /* An info file with an anchor before any nodes is pathological, but it's possible, so don't crash. */ if (node_pos < 0) return NULL; /* We have the tag for the node that contained the anchor tag. */ node_tag = file_buffer->tags[node_pos]; /* Look up the node name in the tag table to get the actual node. This is a recursive call, but it can't recurse again, because we call it with a real node. */ node = info_node_of_file_buffer_tags (file_buffer, node_tag->nodename); /* Start displaying the node at the anchor position. */ if (node) { /* The nodestart for real nodes is three characters before the `F' in the `File:' line (a newline, the CTRL-_, and another newline). The nodestart for anchors is the actual position. But we offset by only 2, rather than 3, because if an anchor is at the beginning of a paragraph, it's nicer for it to end up on the beginning of the first line of the paragraph rather than the blank line before it. (makeinfo has no way of knowing that a paragraph is going to start, so we can't fix it there.) */ node->display_pos = file_buffer->tags[anchor_pos]->nodestart - (node_tag->nodestart + 2); /* Otherwise an anchor at the end of a node ends up displaying at the end of the last line of the node (way over on the right of the screen), which looks wrong. */ if (node->display_pos >= node->nodelen) node->display_pos = node->nodelen - 1; /* Don't search in the node for the xref text, it's not there. */ node->flags |= N_FromAnchor; } return node; } /* Return the node from FILE_BUFFER which matches NODENAME by searching the tags table in FILE_BUFFER, or NULL. */ static NODE * info_node_of_file_buffer_tags (file_buffer, nodename) FILE_BUFFER *file_buffer; char *nodename; { TAG *tag; int i; + /* If no tags at all (possibly a misformatted info file), quit. */ + if (!file_buffer->tags) { + return NULL; + } + for (i = 0; (tag = file_buffer->tags[i]); i++) if (strcmp (nodename, tag->nodename) == 0) { - FILE_BUFFER *subfile; - - subfile = info_find_file_internal (tag->filename, INFO_NO_TAGS); - + FILE_BUFFER *subfile = info_find_file_internal (tag->filename, + INFO_NO_TAGS); if (!subfile) return NULL; if (!subfile->contents) { info_reload_file_buffer_contents (subfile); - if (!subfile->contents) return NULL; } /* If we were able to find this file and load it, then return the node within it. */ { NODE *node = xmalloc (sizeof (NODE)); node->filename = subfile->fullpath; node->parent = NULL; node->nodename = tag->nodename; node->contents = subfile->contents + tag->nodestart; node->display_pos = 0; node->flags = 0; if (file_buffer->flags & N_HasTagsTable) { node->flags |= N_HasTagsTable; if (file_buffer->flags & N_TagsIndirect) { node->flags |= N_TagsIndirect; node->parent = file_buffer->fullpath; } } if (subfile->flags & N_IsCompressed) node->flags |= N_IsCompressed; /* If TAG->nodelen hasn't been calculated yet, then we aren't in a position to trust the entry pointer. Adjust things so that ENTRY->nodestart gets the exact address of the start of the node separator which starts this node, and NODE->contents gets the address of the line defining this node. If we cannot do that, the node isn't really here. */ if (tag->nodelen == -1) { int min, max; char *node_sep; SEARCH_BINDING node_body; char *buff_end; min = max = DEFAULT_INFO_FUDGE; if (tag->nodestart < DEFAULT_INFO_FUDGE) min = tag->nodestart; if (DEFAULT_INFO_FUDGE > (subfile->filesize - tag->nodestart)) max = subfile->filesize - tag->nodestart; /* NODE_SEP gets the address of the separator which defines this node, or NULL if the node wasn't found. NODE->contents is side-effected to point to right after the separator. */ node_sep = adjust_nodestart (node, min, max); if (node_sep == NULL) { free (node); return NULL; } /* Readjust tag->nodestart. */ tag->nodestart = node_sep - subfile->contents; /* Calculate the length of the current node. */ buff_end = subfile->contents + subfile->filesize; node_body.buffer = node->contents; node_body.start = 0; node_body.end = buff_end - node_body.buffer; node_body.flags = 0; tag->nodelen = get_node_length (&node_body); node->nodelen = tag->nodelen; } else if (tag->nodelen == 0) /* anchor, return containing node */ { free (node); node = find_node_of_anchor (file_buffer, tag); } else { /* Since we know the length of this node, we have already adjusted tag->nodestart to point to the exact start of it. Simply skip the node separator. */ node->contents += skip_node_separator (node->contents); node->nodelen = tag->nodelen; } return node; } } /* There was a tag table for this file, and the node wasn't found. Return NULL, since this file doesn't contain the desired node. */ return NULL; } /* Managing file_buffers, nodes, and tags. */ /* Create a new, empty file buffer. */ FILE_BUFFER * make_file_buffer () { FILE_BUFFER *file_buffer = xmalloc (sizeof (FILE_BUFFER)); file_buffer->filename = file_buffer->fullpath = NULL; file_buffer->contents = NULL; file_buffer->tags = NULL; file_buffer->subfiles = NULL; file_buffer->tags_slots = 0; file_buffer->flags = 0; return file_buffer; } /* Add FILE_BUFFER to our list of already loaded info files. */ static void remember_info_file (file_buffer) FILE_BUFFER *file_buffer; { int i; for (i = 0; info_loaded_files && info_loaded_files[i]; i++) ; add_pointer_to_array (file_buffer, i, info_loaded_files, info_loaded_files_slots, 10, FILE_BUFFER *); } /* Forget the contents, tags table, nodes list, and names of FILENAME. */ static void forget_info_file (filename) char *filename; { int i; FILE_BUFFER *file_buffer; if (!info_loaded_files) return; for (i = 0; file_buffer = info_loaded_files[i]; i++) if (FILENAME_CMP (filename, file_buffer->filename) == 0 || FILENAME_CMP (filename, file_buffer->fullpath) == 0) { free (file_buffer->filename); free (file_buffer->fullpath); if (file_buffer->contents) free (file_buffer->contents); /* free_file_buffer_tags () also kills the subfiles list, since the subfiles list is only of use in conjunction with tags. */ free_file_buffer_tags (file_buffer); /* Move rest of list down. */ while (info_loaded_files[i + 1]) { info_loaded_files[i] = info_loaded_files[i + 1]; i++; } info_loaded_files[i] = 0; break; } } /* Free the tags (if any) associated with FILE_BUFFER. */ static void free_file_buffer_tags (file_buffer) FILE_BUFFER *file_buffer; { int i; if (file_buffer->tags) { TAG *tag; for (i = 0; (tag = file_buffer->tags[i]); i++) free_info_tag (tag); free (file_buffer->tags); file_buffer->tags = NULL; file_buffer->tags_slots = 0; } if (file_buffer->subfiles) { for (i = 0; file_buffer->subfiles[i]; i++) free (file_buffer->subfiles[i]); free (file_buffer->subfiles); file_buffer->subfiles = NULL; } } /* Free the data associated with TAG, as well as TAG itself. */ static void free_info_tag (tag) TAG *tag; { free (tag->nodename); /* We don't free tag->filename, because that filename is part of the subfiles list for the containing FILE_BUFFER. free_info_tags () will free the subfiles when it is appropriate. */ free (tag); } /* Load the contents of FILE_BUFFER->contents. This function is called when a file buffer was loaded, and then in order to conserve memory, the file buffer's contents were freed and the pointer was zero'ed. Note that the file was already loaded at least once successfully, so the tags and/or nodes members are still correctly filled. */ static void info_reload_file_buffer_contents (fb) FILE_BUFFER *fb; { int is_compressed; #if defined (HANDLE_MAN_PAGES) /* If this is the magic manpage node, don't try to reload, just give up. */ if (fb->flags & N_IsManPage) return; #endif fb->flags &= ~N_IsCompressed; /* Let the filesystem do all the work for us. */ fb->contents = filesys_read_info_file (fb->fullpath, &(fb->filesize), &(fb->finfo), - &is_compressed); + &is_compressed); if (is_compressed) fb->flags |= N_IsCompressed; } /* Return the actual starting memory location of NODE, side-effecting NODE->contents. MIN and MAX are bounds for a search if one is necessary. Because of the way that tags are implemented, the physical nodestart may not actually be where the tag says it is. If that is the case, but the node was found anyway, set N_UpdateTags in NODE->flags. If the node is found, return non-zero. NODE->contents is returned positioned right after the node separator that precedes this node, while the return value is position directly on the separator that precedes this node. If the node could not be found, return a NULL pointer. */ static char * adjust_nodestart (node, min, max) NODE *node; int min, max; { long position; SEARCH_BINDING node_body; /* Define the node body. */ node_body.buffer = node->contents; node_body.start = 0; node_body.end = max; node_body.flags = 0; /* Try the optimal case first. Who knows? This file may actually be formatted (mostly) correctly. */ if (node_body.buffer[0] != INFO_COOKIE && min > 2) node_body.buffer -= 3; position = find_node_separator (&node_body); /* If we found a node start, then check it out. */ if (position != -1) { int sep_len; sep_len = skip_node_separator (node->contents); /* If we managed to skip a node separator, then check for this node being the right one. */ if (sep_len != 0) { char *nodedef, *nodestart; int offset; nodestart = node_body.buffer + position + sep_len; nodedef = nodestart; offset = string_in_line (INFO_NODE_LABEL, nodedef); if (offset != -1) { nodedef += offset; nodedef += skip_whitespace (nodedef); offset = skip_node_characters (nodedef, DONT_SKIP_NEWLINES); if ((offset == strlen (node->nodename)) && (strncmp (node->nodename, nodedef, offset) == 0)) { node->contents = nodestart; return node_body.buffer + position; } } } } /* Oh well, I guess we have to try to find it in a larger area. */ node_body.buffer = node->contents - min; node_body.start = 0; node_body.end = min + max; node_body.flags = 0; position = find_node_in_binding (node->nodename, &node_body); /* If the node couldn't be found, we lose big. */ if (position == -1) return NULL; /* Otherwise, the node was found, but the tags table could need updating (if we used a tag to get here, that is). Set the flag in NODE->flags. */ node->contents = node_body.buffer + position; node->contents += skip_node_separator (node->contents); if (node->flags & N_HasTagsTable) node->flags |= N_UpdateTags; return node_body.buffer + position; } diff --git a/contrib/texinfo/info/session.h b/contrib/texinfo/info/session.h index 07ffd5f02a37..99892fc21ce1 100644 --- a/contrib/texinfo/info/session.h +++ b/contrib/texinfo/info/session.h @@ -1,151 +1,150 @@ /* session.h -- Functions found in session.c. - $Id: session.h,v 1.9 1999/06/25 21:57:40 karl Exp $ + $Id: session.h,v 1.10 2001/11/16 23:17:15 karl Exp $ - Copyright (C) 1993, 98, 99 Free Software Foundation, Inc. + Copyright (C) 1993, 98, 99, 2001 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). */ #ifndef SESSION_H #define SESSION_H #include "info.h" #include "dribble.h" /* All commands that can be invoked from within info_session () receive arguments in the same way. This simple define declares the header of a function named NAME, with associated documentation DOC. The documentation string is groveled out of the source files by the utility program `makedoc', which is also responsible for making the documentation/function-pointer maps. */ #define DECLARE_INFO_COMMAND(name, doc) \ void name (window, count, key) WINDOW *window; int count; unsigned char key; /* Variables found in session.h. */ extern VFunction *info_last_executed_command; /* Variable controlling the garbage collection of files briefly visited during searches. Such files are normally gc'ed, unless they were compressed to begin with. If this variable is non-zero, it says to gc even those file buffer contents which had to be uncompressed. */ extern int gc_compressed_files; /* When non-zero, tiling takes place automatically when info_split_window is called. */ extern int auto_tiling_p; /* Variable controlling the behaviour of default scrolling when you are already at the bottom of a node. */ extern int info_scroll_behaviour; extern char *info_scroll_choices[]; /* Values for info_scroll_behaviour. */ #define IS_Continuous 0 /* Try to get first menu item, or failing that, the "Next:" pointer, or failing that, the "Up:" and "Next:" of the up. */ #define IS_NextOnly 1 /* Try to get "Next:" menu item. */ #define IS_PageOnly 2 /* Simply give up at the bottom of a node. */ /* Utility functions found in session.c */ extern void info_dispatch_on_key (); extern unsigned char info_get_input_char (), info_get_another_input_char (); extern unsigned char info_input_pending_p (); extern void remember_window_and_node (), set_remembered_pagetop_and_point (); extern void set_window_pagetop (), info_set_node_of_window (); -extern char *pretty_keyseq (); extern void initialize_keyseq (), add_char_to_keyseq (); extern void info_gather_typeahead (); extern FILE_BUFFER *file_buffer_of_window (); extern long info_search_in_node (), info_target_search_node (); extern void info_select_reference (); extern int info_any_buffered_input_p (); extern void print_node (); extern void dump_node_to_file (), dump_nodes_to_file (); extern char *program_name_from_file_name (); /* Do the physical deletion of WINDOW, and forget this window and associated nodes. */ extern void info_delete_window_internal (); /* Tell Info that input is coming from the file FILENAME. */ extern void info_set_input_from_file (); #define return_if_control_g(val) \ do { \ info_gather_typeahead (); \ if (info_input_pending_p () == Control ('g')) \ return (val); \ } while (0) /* The names of the functions that run an info session. */ /* Starting an info session. */ extern void begin_multiple_window_info_session (), begin_info_session (); extern void begin_info_session_with_error (), info_session (); extern void info_read_and_dispatch (); /* Moving the point within a node. */ extern void info_next_line (), info_prev_line (); extern void info_end_of_line (), info_beginning_of_line (); extern void info_forward_char (), info_backward_char (); extern void info_forward_word (), info_backward_word (); extern void info_beginning_of_node (), info_end_of_node (); extern void info_move_to_prev_xref (), info_move_to_next_xref (); /* Scrolling text within a window. */ extern void info_scroll_forward (), info_scroll_backward (); extern void info_redraw_display (), info_toggle_wrap (); extern void info_move_to_window_line (); extern void info_up_line (), info_down_line (); extern void info_scroll_half_screen_down (), info_scroll_half_screen_up (); /* Manipulating multiple windows. */ extern void info_split_window (), info_delete_window (); extern void info_keep_one_window (), info_grow_window (); extern void info_scroll_other_window (), info_tile_windows (); extern void info_next_window (), info_prev_window (); /* Selecting nodes. */ extern void info_next_node (), info_prev_node (), info_up_node (); extern void info_last_node (), info_first_node (), info_history_node (); extern void info_goto_node (), info_top_node (), info_dir_node (); extern void info_global_next_node (), info_global_prev_node (); extern void info_kill_node (), info_view_file (); extern void info_menu_sequence (); extern NODE *info_follow_menus (/* initial_node, menus, errstr, errarg */); /* Selecting cross references. */ extern void info_menu_digit (), info_menu_item (), info_xref_item (); extern void info_find_menu (), info_select_reference_this_line (); /* Hacking numeric arguments. */ extern int info_explicit_arg, info_numeric_arg, info_numeric_arg_sign; extern void info_add_digit_to_numeric_arg (), info_universal_argument (); extern void info_initialize_numeric_arg (), info_numeric_arg_digit_loop (); /* Searching commands. */ extern void info_search (), isearch_forward (), isearch_backward (); extern void info_search_case_sensitively (), info_search_backward (); extern void info_search_next (), info_search_previous (); /* Dumping and printing nodes. */ extern void info_print_node (); /* Miscellaneous commands. */ extern void info_abort_key (), info_quit (), info_do_lowercase_version (); #endif /* not SESSION_H */ diff --git a/contrib/texinfo/info/termdep.h b/contrib/texinfo/info/termdep.h index 5f4b41ad1565..0ab6c449bb3b 100644 --- a/contrib/texinfo/info/termdep.h +++ b/contrib/texinfo/info/termdep.h @@ -1,57 +1,58 @@ /* termdep.h -- System things that terminal.c depends on. - $Id: termdep.h,v 1.4 1998/04/13 22:02:57 karl Exp $ + $Id: termdep.h,v 1.5 2001/09/12 17:26:03 karl Exp $ - Copyright (C) 1993, 96, 97, 98 Free Software Foundation, Inc. + Copyright (C) 1993, 96, 97, 98, 2001 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). */ #ifndef INFO_TERMDEP_H #define INFO_TERMDEP_H /* NeXT supplies <termios.h> but it is broken. Probably Autoconf should have a separate test, but anyway ... */ #ifdef NeXT #undef HAVE_TERMIOS_H #endif #ifdef HAVE_TERMIOS_H # include <termios.h> -# ifdef GWINSZ_IN_SYS_IOCTL -# include <sys/ioctl.h> -# endif #else # if defined (HAVE_TERMIO_H) # include <termio.h> # if defined (HAVE_SYS_PTEM_H) # if defined (M_UNIX) || !defined (M_XENIX) # include <sys/stream.h> # include <sys/ptem.h> # undef TIOCGETC # else /* M_XENIX */ # define tchars tc # endif /* M_XENIX */ # endif /* HAVE_SYS_PTEM_H */ # else /* !HAVE_TERMIO_H */ # include <sgtty.h> # endif /* !HAVE_TERMIO_H */ #endif /* !HAVE_TERMIOS_H */ +#ifdef GWINSZ_IN_SYS_IOCTL +# include <sys/ioctl.h> +#endif + #ifdef HAVE_SYS_TTOLD_H # include <sys/ttold.h> #endif /* HAVE_SYS_TTOLD_H */ #endif /* not INFO_TERMDEP_H */ diff --git a/contrib/texinfo/info/terminal.h b/contrib/texinfo/info/terminal.h index 2e27268ea7fb..361fa4c2b78f 100644 --- a/contrib/texinfo/info/terminal.h +++ b/contrib/texinfo/info/terminal.h @@ -1,125 +1,126 @@ -/* terminal.h -- The external interface to terminal I/O. */ +/* terminal.h -- The external interface to terminal I/O. + $Id: terminal.h,v 1.7 2001/11/16 23:17:29 karl Exp $ -/* This file is part of GNU Info, a program for reading online documentation - stored in Info format. - - Copyright (C) 1993, 96, 97 Free Software Foundation, Inc. + Copyright (C) 1993, 96, 97, 2001 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). */ #if !defined (TERMINAL_H) #define TERMINAL_H #include "info.h" /* For almost every function externally visible from terminal.c, there is a corresponding "hook" function which can be bound in order to replace the functionality of the one found in terminal.c. This is how we go about implemented X window display. */ /* The width and height of the terminal. */ extern int screenwidth, screenheight; /* Non-zero means this terminal can't really do anything. */ extern int terminal_is_dumb_p; /* Non-zero means that this terminal has a meta key. */ extern int terminal_has_meta_p; /* Non-zero means that this terminal can produce a visible bell. */ extern int terminal_has_visible_bell_p; /* Non-zero means to use that visible bell if at all possible. */ extern int terminal_use_visible_bell_p; /* Non-zero means that this terminal can scroll lines up and down. */ extern int terminal_can_scroll; /* Initialize the terminal which is known as TERMINAL_NAME. If this terminal doesn't have cursor addressability, TERMINAL_IS_DUMB_P becomes non-zero. The variables SCREENHEIGHT and SCREENWIDTH are set to the dimensions that this terminal actually has. The variable TERMINAL_HAS_META_P becomes non- zero if this terminal supports a Meta key. */ extern void terminal_initialize_terminal (); extern VFunction *terminal_initialize_terminal_hook; /* Return the current screen width and height in the variables SCREENWIDTH and SCREENHEIGHT. */ extern void terminal_get_screen_size (); extern VFunction *terminal_get_screen_size_hook; /* Save and restore tty settings. */ extern void terminal_prep_terminal (), terminal_unprep_terminal (); extern VFunction *terminal_prep_terminal_hook, *terminal_unprep_terminal_hook; /* Re-initialize the terminal to TERMINAL_NAME. */ extern void terminal_new_terminal (); extern VFunction *terminal_new_terminal_hook; /* Move the cursor to the terminal location of X and Y. */ extern void terminal_goto_xy (); extern VFunction *terminal_goto_xy_hook; /* Print STRING to the terminal at the current position. */ extern void terminal_put_text (); extern VFunction *terminal_put_text_hook; /* Print NCHARS from STRING to the terminal at the current position. */ extern void terminal_write_chars (); extern VFunction *terminal_write_chars_hook; /* Clear from the current position of the cursor to the end of the line. */ extern void terminal_clear_to_eol (); extern VFunction *terminal_clear_to_eol_hook; /* Clear the entire terminal screen. */ extern void terminal_clear_screen (); extern VFunction *terminal_clear_screen_hook; /* Move the cursor up one line. */ extern void terminal_up_line (); extern VFunction *terminal_up_line_hook; /* Move the cursor down one line. */ extern void terminal_down_line (); extern VFunction *terminal_down_line_hook; /* Turn on reverse video if possible. */ extern void terminal_begin_inverse (); extern VFunction *terminal_begin_inverse_hook; /* Turn off reverse video if possible. */ extern void terminal_end_inverse (); extern VFunction *terminal_end_inverse_hook; /* Scroll an area of the terminal, starting with the region from START to END, AMOUNT lines. If AMOUNT is negative, the lines are scrolled towards the top of the screen, else they are scrolled towards the bottom of the screen. */ extern void terminal_scroll_terminal (); extern VFunction *terminal_scroll_terminal_hook; /* Ring the terminal bell. The bell is run visibly if it both has one and terminal_use_visible_bell_p is non-zero. */ extern void terminal_ring_bell (); extern VFunction *terminal_ring_bell_hook; -/* The key sequences output by the arrow keys, if this terminal has any. */ +/* The key sequences output by special keys, if this terminal has any. */ extern char *term_ku, *term_kd, *term_kr, *term_kl; extern char *term_kP, *term_kN; +extern char *term_ke, *term_kh; +extern char *term_kx, *term_ki; +extern char *term_kD; #endif /* !TERMINAL_H */ diff --git a/contrib/texinfo/info/variables.c b/contrib/texinfo/info/variables.c index 94127971cd85..581d2bb6f97e 100644 --- a/contrib/texinfo/info/variables.c +++ b/contrib/texinfo/info/variables.c @@ -1,275 +1,309 @@ /* variables.c -- How to manipulate user visible variables in Info. - $Id: variables.c,v 1.7 1999/06/25 21:57:40 karl Exp $ + $Id: variables.c,v 1.8 2001/11/16 23:16:19 karl Exp $ - This file is part of GNU Info, a program for reading online documentation - stored in Info format. - - Copyright (C) 1993, 97 Free Software Foundation, Inc. + Copyright (C) 1993, 97, 2001 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). */ #include "info.h" #include "variables.h" /* **************************************************************** */ /* */ /* User Visible Variables in Info */ /* */ /* **************************************************************** */ /* Choices used by the completer when reading a zero/non-zero value for a variable. */ static char *on_off_choices[] = { "Off", "On", (char *)NULL }; VARIABLE_ALIST info_variables[] = { { "automatic-footnotes", N_("When \"On\", footnotes appear and disappear automatically"), &auto_footnotes_p, (char **)on_off_choices }, { "automatic-tiling", N_("When \"On\", creating or deleting a window resizes other windows"), &auto_tiling_p, (char **)on_off_choices }, { "visible-bell", N_("When \"On\", flash the screen instead of ringing the bell"), &terminal_use_visible_bell_p, (char **)on_off_choices }, { "errors-ring-bell", N_("When \"On\", errors cause the bell to ring"), &info_error_rings_bell_p, (char **)on_off_choices }, { "gc-compressed-files", N_("When \"On\", Info garbage collects files which had to be uncompressed"), &gc_compressed_files, (char **)on_off_choices }, { "show-index-match", N_("When \"On\", the portion of the matched search string is highlighted"), &show_index_match, (char **)on_off_choices }, { "scroll-behaviour", N_("Controls what happens when scrolling is requested at the end of a node"), &info_scroll_behaviour, (char **)info_scroll_choices }, { "scroll-step", N_("The number lines to scroll when the cursor moves out of the window"), &window_scroll_step, (char **)NULL }, { "ISO-Latin", N_("When \"On\", Info accepts and displays ISO Latin characters"), &ISO_Latin_p, (char **)on_off_choices }, { (char *)NULL, (char *)NULL, (int *)NULL, (char **)NULL } }; DECLARE_INFO_COMMAND (describe_variable, _("Explain the use of a variable")) { VARIABLE_ALIST *var; char *description; /* Get the variable's name. */ var = read_variable_name (_("Describe variable: "), window); if (!var) return; description = (char *)xmalloc (20 + strlen (var->name) + strlen (_(var->doc))); if (var->choices) sprintf (description, "%s (%s): %s.", var->name, var->choices[*(var->value)], _(var->doc)); else sprintf (description, "%s (%d): %s.", var->name, *(var->value), _(var->doc)); window_message_in_echo_area ("%s", description); free (description); } DECLARE_INFO_COMMAND (set_variable, _("Set the value of an Info variable")) { VARIABLE_ALIST *var; char *line; /* Get the variable's name and value. */ var = read_variable_name (_("Set variable: "), window); if (!var) return; /* Read a new value for this variable. */ { char prompt[100]; if (!var->choices) { int potential_value; if (info_explicit_arg || count != 1) potential_value = count; else potential_value = *(var->value); sprintf (prompt, _("Set %s to value (%d): "), var->name, potential_value); line = info_read_in_echo_area (active_window, prompt); /* If no error was printed, clear the echo area. */ if (!info_error_was_printed) window_clear_echo_area (); /* User aborted? */ if (!line) return; /* If the user specified a value, get that, otherwise, we are done. */ canonicalize_whitespace (line); if (*line) *(var->value) = atoi (line); else *(var->value) = potential_value; free (line); } else { register int i; REFERENCE **array = (REFERENCE **)NULL; int array_index = 0; int array_slots = 0; for (i = 0; var->choices[i]; i++) { REFERENCE *entry; entry = (REFERENCE *)xmalloc (sizeof (REFERENCE)); entry->label = xstrdup (var->choices[i]); entry->nodename = (char *)NULL; entry->filename = (char *)NULL; add_pointer_to_array (entry, array_index, array, array_slots, 10, REFERENCE *); } sprintf (prompt, _("Set %s to value (%s): "), var->name, var->choices[*(var->value)]); /* Ask the completer to read a variable value for us. */ line = info_read_completing_in_echo_area (window, prompt, array); info_free_references (array); if (!echo_area_is_active) window_clear_echo_area (); /* User aborted? */ if (!line) { info_abort_key (active_window, 0, 0); return; } /* User accepted default choice? If so, no change. */ if (!*line) { free (line); return; } /* Find the choice in our list of choices. */ for (i = 0; var->choices[i]; i++) if (strcmp (var->choices[i], line) == 0) break; if (var->choices[i]) *(var->value) = i; } } } /* Read the name of an Info variable in the echo area and return the address of a VARIABLE_ALIST member. A return value of NULL indicates that no variable could be read. */ VARIABLE_ALIST * read_variable_name (prompt, window) char *prompt; WINDOW *window; { register int i; char *line; REFERENCE **variables; /* Get the completion array of variable names. */ variables = make_variable_completions_array (); /* Ask the completer to read a variable for us. */ line = info_read_completing_in_echo_area (window, prompt, variables); info_free_references (variables); if (!echo_area_is_active) window_clear_echo_area (); /* User aborted? */ if (!line) { info_abort_key (active_window, 0, 0); return ((VARIABLE_ALIST *)NULL); } /* User accepted "default"? (There is none.) */ if (!*line) { free (line); return ((VARIABLE_ALIST *)NULL); } /* Find the variable in our list of variables. */ for (i = 0; info_variables[i].name; i++) if (strcmp (info_variables[i].name, line) == 0) break; if (!info_variables[i].name) return ((VARIABLE_ALIST *)NULL); else return (&(info_variables[i])); } /* Make an array of REFERENCE which actually contains the names of the variables available in Info. */ REFERENCE ** make_variable_completions_array () { register int i; REFERENCE **array = (REFERENCE **)NULL; int array_index = 0, array_slots = 0; for (i = 0; info_variables[i].name; i++) { REFERENCE *entry; entry = (REFERENCE *) xmalloc (sizeof (REFERENCE)); entry->label = xstrdup (info_variables[i].name); entry->nodename = (char *)NULL; entry->filename = (char *)NULL; add_pointer_to_array (entry, array_index, array, array_slots, 200, REFERENCE *); } return (array); } + +#if defined(INFOKEY) + +void +set_variable_to_value(name, value) + char *name; + char *value; +{ + register int i; + + /* Find the variable in our list of variables. */ + for (i = 0; info_variables[i].name; i++) + if (strcmp(info_variables[i].name, name) == 0) + break; + + if (!info_variables[i].name) + return; + + if (info_variables[i].choices) + { + register int j; + + /* Find the choice in our list of choices. */ + for (j = 0; info_variables[i].choices[j]; j++) + if (strcmp (info_variables[i].choices[j], value) == 0) + break; + + if (info_variables[i].choices[j]) + *info_variables[i].value = j; + } + else + { + *info_variables[i].value = atoi(value); + } +} + +#endif /* INFOKEY */ diff --git a/contrib/texinfo/info/window.c b/contrib/texinfo/info/window.c index 1b6d0621644f..faa0784ecd93 100644 --- a/contrib/texinfo/info/window.c +++ b/contrib/texinfo/info/window.c @@ -1,1512 +1,1539 @@ /* window.c -- windows in Info. - $Id: window.c,v 1.11 1999/06/25 21:57:40 karl Exp $ + $Id: window.c,v 1.15 2002/01/19 01:08:20 karl Exp $ - Copyright (C) 1993, 97, 98 Free Software Foundation, Inc. + Copyright (C) 1993, 97, 98, 2001, 02 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). */ #include "info.h" #include "nodes.h" #include "window.h" #include "display.h" #include "info-utils.h" #include "infomap.h" /* The window which describes the screen. */ WINDOW *the_screen = NULL; /* The window which describes the echo area. */ WINDOW *the_echo_area = NULL; /* The list of windows in Info. */ WINDOW *windows = NULL; /* Pointer to the active window in WINDOW_LIST. */ WINDOW *active_window = NULL; /* The size of the echo area in Info. It never changes, irregardless of the size of the screen. */ #define ECHO_AREA_HEIGHT 1 /* Macro returns the amount of space that the echo area truly requires relative to the entire screen. */ #define echo_area_required (1 + the_echo_area->height) /* Initalize the window system by creating THE_SCREEN and THE_ECHO_AREA. Create the first window ever. You pass the dimensions of the total screen size. */ void window_initialize_windows (width, height) int width, height; { the_screen = xmalloc (sizeof (WINDOW)); the_echo_area = xmalloc (sizeof (WINDOW)); windows = xmalloc (sizeof (WINDOW)); active_window = windows; zero_mem (the_screen, sizeof (WINDOW)); zero_mem (the_echo_area, sizeof (WINDOW)); zero_mem (active_window, sizeof (WINDOW)); /* None of these windows has a goal column yet. */ the_echo_area->goal_column = -1; active_window->goal_column = -1; the_screen->goal_column = -1; /* The active and echo_area windows are visible. The echo_area is permanent. The screen is permanent. */ active_window->flags = W_WindowVisible; the_echo_area->flags = W_WindowIsPerm | W_InhibitMode | W_WindowVisible; the_screen->flags = W_WindowIsPerm; /* The height of the echo area never changes. It is statically set right here, and it must be at least 1 line for display. The size of the initial window cannot be the same size as the screen, since the screen includes the echo area. So, we make the height of the initial window equal to the screen's displayable region minus the height of the echo area. */ the_echo_area->height = ECHO_AREA_HEIGHT; active_window->height = the_screen->height - 1 - the_echo_area->height; window_new_screen_size (width, height, NULL); /* The echo area uses a different keymap than normal info windows. */ the_echo_area->keymap = echo_area_keymap; active_window->keymap = info_keymap; } /* Given that the size of the screen has changed to WIDTH and HEIGHT from whatever it was before (found in the_screen->height, ->width), change the size (and possibly location) of each window in the screen. If a window would become too small, call the function DELETER on it, after deleting the window from our chain of windows. If DELETER is NULL, nothing extra is done. The last window can never be deleted, but it can become invisible. */ /* If non-null, a function to call with WINDOW as argument when the function window_new_screen_size () has deleted WINDOW. */ VFunction *window_deletion_notifier = NULL; void window_new_screen_size (width, height) int width, height; { register WINDOW *win; int delta_height, delta_each, delta_leftover; int numwins; /* If no change, do nothing. */ if (width == the_screen->width && height == the_screen->height) return; /* If the new window height is too small, make it be zero. */ if (height < (WINDOW_MIN_SIZE + the_echo_area->height)) height = 0; if (width < 0) width = 0; /* Find out how many windows will change. */ for (numwins = 0, win = windows; win; win = win->next, numwins++); /* See if some windows will need to be deleted. This is the case if the screen is getting smaller, and the available space divided by the number of windows is less than WINDOW_MIN_SIZE. In that case, delete some windows and try again until there is either enough space to divy up among the windows, or until there is only one window left. */ while ((height - echo_area_required) / numwins <= WINDOW_MIN_SIZE) { /* If only one window, make the size of it be zero, and return immediately. */ if (!windows->next) { windows->height = 0; maybe_free (windows->line_starts); windows->line_starts = NULL; windows->line_count = 0; break; } /* If we have some temporary windows, delete one of them. */ for (win = windows; win; win = win->next) if (win->flags & W_TempWindow) break; /* Otherwise, delete the first window, and try again. */ if (!win) win = windows; if (window_deletion_notifier) (*window_deletion_notifier) (win); window_delete_window (win); numwins--; } /* The screen has changed height and width. */ delta_height = height - the_screen->height; /* This is how much. */ the_screen->height = height; /* This is the new height. */ the_screen->width = width; /* This is the new width. */ /* Set the start of the echo area. */ the_echo_area->first_row = height - the_echo_area->height; the_echo_area->width = width; /* Check to see if the screen can really be changed this way. */ if ((!windows->next) && ((windows->height == 0) && (delta_height < 0))) return; /* Divide the change in height among the available windows. */ delta_each = delta_height / numwins; delta_leftover = delta_height - (delta_each * numwins); /* Change the height of each window in the chain by delta_each. Change the height of the last window in the chain by delta_each and by the leftover amount of change. Change the width of each window to be WIDTH. */ for (win = windows; win; win = win->next) { if ((win->width != width) && ((win->flags & W_InhibitMode) == 0)) { win->width = width; maybe_free (win->modeline); win->modeline = xmalloc (1 + width); } win->height += delta_each; /* If the previous height of this window was zero, it was the only window, and it was not visible. Thus we need to compensate for the echo_area. */ if (win->height == delta_each) win->height -= (1 + the_echo_area->height); /* If this is not the first window in the chain, then change the first row of it. We cannot just add delta_each to the first row, since this window's first row is the sum of the collective increases that have gone before it. So we just add one to the location of the previous window's modeline. */ if (win->prev) win->first_row = (win->prev->first_row + win->prev->height) + 1; /* The last window in the chain gets the extra space (or shrinkage). */ if (!win->next) win->height += delta_leftover; if (win->node) recalculate_line_starts (win); win->flags |= W_UpdateWindow; } /* If the screen got smaller, check over the windows just shrunk to keep them within bounds. Some of the windows may have gotten smaller than WINDOW_MIN_HEIGHT in which case some of the other windows are larger than the available display space in the screen. Because of our intial test above, we know that there is enough space for all of the windows. */ if ((delta_each < 0) && ((windows->height != 0) && windows->next)) { int avail; avail = the_screen->height - (numwins + the_echo_area->height); win = windows; while (win) { if ((win->height < WINDOW_MIN_HEIGHT) || (win->height > avail)) { WINDOW *lastwin; /* Split the space among the available windows. */ delta_each = avail / numwins; delta_leftover = avail - (delta_each * numwins); for (win = windows; win; win = win->next) { lastwin = win; if (win->prev) win->first_row = (win->prev->first_row + win->prev->height) + 1; win->height = delta_each; } /* Give the leftover space (if any) to the last window. */ lastwin->height += delta_leftover; break; } else win= win->next; } } } /* Make a new window showing NODE, and return that window structure. If NODE is passed as NULL, then show the node showing in the active window. If the window could not be made return a NULL pointer. The active window is not changed.*/ WINDOW * window_make_window (node) NODE *node; { WINDOW *window; if (!node) node = active_window->node; /* If there isn't enough room to make another window, return now. */ if ((active_window->height / 2) < WINDOW_MIN_SIZE) return (NULL); /* Make and initialize the new window. The fudging about with -1 and +1 is because the following window in the chain cannot start at window->height, since that is where the modeline for the previous window is displayed. The inverse adjustment is made in window_delete_window (). */ window = xmalloc (sizeof (WINDOW)); window->width = the_screen->width; window->height = (active_window->height / 2) - 1; #if defined (SPLIT_BEFORE_ACTIVE) window->first_row = active_window->first_row; #else window->first_row = active_window->first_row + (active_window->height - window->height); #endif window->keymap = info_keymap; window->goal_column = -1; window->modeline = xmalloc (1 + window->width); window->line_starts = NULL; window->flags = W_UpdateWindow | W_WindowVisible; window_set_node_of_window (window, node); /* Adjust the height of the old active window. */ active_window->height -= (window->height + 1); #if defined (SPLIT_BEFORE_ACTIVE) active_window->first_row += (window->height + 1); #endif active_window->flags |= W_UpdateWindow; /* Readjust the new and old windows so that their modelines and contents will be displayed correctly. */ #if defined (NOTDEF) /* We don't have to do this for WINDOW since window_set_node_of_window () already did. */ window_adjust_pagetop (window); window_make_modeline (window); #endif /* NOTDEF */ /* We do have to readjust the existing active window. */ window_adjust_pagetop (active_window); window_make_modeline (active_window); #if defined (SPLIT_BEFORE_ACTIVE) /* This window is just before the active one. The active window gets bumped down one. The active window is not changed. */ window->next = active_window; window->prev = active_window->prev; active_window->prev = window; if (window->prev) window->prev->next = window; else windows = window; #else /* This window is just after the active one. Which window is active is not changed. */ window->prev = active_window; window->next = active_window->next; active_window->next = window; if (window->next) window->next->prev = window; #endif /* !SPLIT_BEFORE_ACTIVE */ return (window); } /* These useful macros make it possible to read the code in window_change_window_height (). */ #define grow_me_shrinking_next(me, next, diff) \ do { \ me->height += diff; \ next->height -= diff; \ next->first_row += diff; \ window_adjust_pagetop (next); \ } while (0) #define grow_me_shrinking_prev(me, prev, diff) \ do { \ me->height += diff; \ prev->height -= diff; \ me->first_row -=diff; \ window_adjust_pagetop (prev); \ } while (0) #define shrink_me_growing_next(me, next, diff) \ do { \ me->height -= diff; \ next->height += diff; \ next->first_row -= diff; \ window_adjust_pagetop (next); \ } while (0) #define shrink_me_growing_prev(me, prev, diff) \ do { \ me->height -= diff; \ prev->height += diff; \ me->first_row += diff; \ window_adjust_pagetop (prev); \ } while (0) /* Change the height of WINDOW by AMOUNT. This also automagically adjusts the previous and next windows in the chain. If there is only one user window, then no change takes place. */ void window_change_window_height (window, amount) WINDOW *window; int amount; { register WINDOW *win, *prev, *next; /* If there is only one window, or if the amount of change is zero, return immediately. */ if (!windows->next || amount == 0) return; /* Find this window in our chain. */ for (win = windows; win; win = win->next) if (win == window) break; /* If the window is isolated (i.e., doesn't appear in our window list, then quit now. */ if (!win) return; /* Change the height of this window by AMOUNT, if that is possible. It can be impossible if there isn't enough available room on the screen, or if the resultant window would be too small. */ prev = window->prev; next = window->next; /* WINDOW decreasing in size? */ if (amount < 0) { int abs_amount = -amount; /* It is easier to deal with this way. */ /* If the resultant window would be too small, stop here. */ if ((window->height - abs_amount) < WINDOW_MIN_HEIGHT) return; /* If we have two neighboring windows, choose the smaller one to get larger. */ if (next && prev) { if (prev->height < next->height) shrink_me_growing_prev (window, prev, abs_amount); else shrink_me_growing_next (window, next, abs_amount); } else if (next) shrink_me_growing_next (window, next, abs_amount); else shrink_me_growing_prev (window, prev, abs_amount); } /* WINDOW increasing in size? */ if (amount > 0) { int total_avail, next_avail = 0, prev_avail = 0; if (next) next_avail = next->height - WINDOW_MIN_SIZE; if (prev) prev_avail = prev->height - WINDOW_MIN_SIZE; total_avail = next_avail + prev_avail; /* If there isn't enough space available to grow this window, give up. */ if (amount > total_avail) return; /* If there aren't two neighboring windows, or if one of the neighbors is larger than the other one by at least AMOUNT, grow that one. */ if ((next && !prev) || ((next_avail - amount) >= prev_avail)) grow_me_shrinking_next (window, next, amount); else if ((prev && !next) || ((prev_avail - amount) >= next_avail)) grow_me_shrinking_prev (window, prev, amount); else { int change; /* This window has two neighbors. They both must be shrunk in to make enough space for WINDOW to grow. Make them both the same size. */ if (prev_avail > next_avail) { change = prev_avail - next_avail; grow_me_shrinking_prev (window, prev, change); amount -= change; } else { change = next_avail - prev_avail; grow_me_shrinking_next (window, next, change); amount -= change; } /* Both neighbors are the same size. Split the difference in AMOUNT between them. */ while (amount) { window->height++; amount--; /* Odd numbers grow next, even grow prev. */ if (amount & 1) { prev->height--; window->first_row--; } else { next->height--; next->first_row++; } } window_adjust_pagetop (prev); window_adjust_pagetop (next); } } if (prev) prev->flags |= W_UpdateWindow; if (next) next->flags |= W_UpdateWindow; window->flags |= W_UpdateWindow; window_adjust_pagetop (window); } /* Tile all of the windows currently displayed in the global variable WINDOWS. If argument STYLE is TILE_INTERNALS, tile windows displaying internal nodes as well, otherwise do not change the height of such windows. */ void window_tile_windows (style) int style; { WINDOW *win, *last_adjusted; int numwins, avail, per_win_height, leftover; int do_internals; numwins = avail = 0; do_internals = (style == TILE_INTERNALS); for (win = windows; win; win = win->next) if (do_internals || !win->node || (win->node->flags & N_IsInternal) == 0) { avail += win->height; numwins++; } if (numwins <= 1 || !the_screen->height) return; /* Find the size for each window. Divide the size of the usable portion of the screen by the number of windows. */ per_win_height = avail / numwins; leftover = avail - (per_win_height * numwins); last_adjusted = NULL; for (win = windows; win; win = win->next) { if (do_internals || !win->node || (win->node->flags & N_IsInternal) == 0) { last_adjusted = win; win->height = per_win_height; } } if (last_adjusted) last_adjusted->height += leftover; /* Readjust the first_row of every window in the chain. */ for (win = windows; win; win = win->next) { if (win->prev) win->first_row = win->prev->first_row + win->prev->height + 1; window_adjust_pagetop (win); win->flags |= W_UpdateWindow; } } /* Toggle the state of line wrapping in WINDOW. This can do a bit of fancy redisplay. */ void window_toggle_wrap (window) WINDOW *window; { if (window->flags & W_NoWrap) window->flags &= ~W_NoWrap; else window->flags |= W_NoWrap; if (window != the_echo_area) { char **old_starts; int old_lines, old_pagetop; old_starts = window->line_starts; old_lines = window->line_count; old_pagetop = window->pagetop; calculate_line_starts (window); /* Make sure that point appears within this window. */ window_adjust_pagetop (window); /* If the pagetop hasn't changed maybe we can do some scrolling now to speed up the display. Many of the line starts will be the same, so scrolling here is a very good optimization.*/ if (old_pagetop == window->pagetop) display_scroll_line_starts (window, old_pagetop, old_starts, old_lines); maybe_free (old_starts); } window->flags |= W_UpdateWindow; } /* Set WINDOW to display NODE. */ void window_set_node_of_window (window, node) WINDOW *window; NODE *node; { window->node = node; window->pagetop = 0; window->point = 0; recalculate_line_starts (window); window->flags |= W_UpdateWindow; /* The display_pos member is nonzero if we're displaying an anchor. */ window->point = node ? node->display_pos : 0; window_adjust_pagetop (window); window_make_modeline (window); } /* Delete WINDOW from the list of known windows. If this window was the active window, make the next window in the chain be the active window. If the active window is the next or previous window, choose that window as the recipient of the extra space. Otherwise, prefer the next window. */ void window_delete_window (window) WINDOW *window; { WINDOW *next, *prev, *window_to_fix; next = window->next; prev = window->prev; /* You cannot delete the only window or a permanent window. */ if ((!next && !prev) || (window->flags & W_WindowIsPerm)) return; if (next) next->prev = prev; if (!prev) windows = next; else prev->next = next; if (window->line_starts) free (window->line_starts); if (window->modeline) free (window->modeline); if (window == active_window) { /* If there isn't a next window, then there must be a previous one, since we cannot delete the last window. If there is a next window, prefer to use that as the active window. */ if (next) active_window = next; else active_window = prev; } if (next && active_window == next) window_to_fix = next; else if (prev && active_window == prev) window_to_fix = prev; else if (next) window_to_fix = next; else if (prev) window_to_fix = prev; else window_to_fix = windows; if (window_to_fix->first_row > window->first_row) { int diff; /* Try to adjust the visible part of the node so that as little text as possible has to move. */ diff = window_to_fix->first_row - window->first_row; window_to_fix->first_row = window->first_row; window_to_fix->pagetop -= diff; if (window_to_fix->pagetop < 0) window_to_fix->pagetop = 0; } /* The `+ 1' is to offset the difference between the first_row locations. See the code in window_make_window (). */ window_to_fix->height += window->height + 1; window_to_fix->flags |= W_UpdateWindow; free (window); } /* For every window in CHAIN, set the flags member to have FLAG set. */ void window_mark_chain (chain, flag) WINDOW *chain; int flag; { register WINDOW *win; for (win = chain; win; win = win->next) win->flags |= flag; } /* For every window in CHAIN, clear the flags member of FLAG. */ void window_unmark_chain (chain, flag) WINDOW *chain; int flag; { register WINDOW *win; for (win = chain; win; win = win->next) win->flags &= ~flag; } /* Return the number of characters it takes to display CHARACTER on the screen at HPOS. */ int character_width (character, hpos) int character, hpos; { int printable_limit = 127; int width = 1; if (ISO_Latin_p) printable_limit = 255; if (character > printable_limit) width = 3; else if (iscntrl (character)) { switch (character) { case '\r': case '\n': width = the_screen->width - hpos; break; case '\t': width = ((hpos + 8) & 0xf8) - hpos; break; default: width = 2; } } else if (character == DEL) width = 2; return (width); } /* Return the number of characters it takes to display STRING on the screen at HPOS. */ int string_width (string, hpos) char *string; int hpos; { register int i, width, this_char_width; for (width = 0, i = 0; string[i]; i++) { this_char_width = character_width (string[i], hpos); width += this_char_width; hpos += this_char_width; } return (width); } /* Quickly guess the approximate number of lines that NODE would take to display. This really only counts carriage returns. */ int window_physical_lines (node) NODE *node; { register int i, lines; char *contents; if (!node) return (0); contents = node->contents; for (i = 0, lines = 1; i < node->nodelen; i++) if (contents[i] == '\n') lines++; return (lines); } /* Calculate a list of line starts for the node belonging to WINDOW. The line starts are pointers to the actual text within WINDOW->NODE. */ void calculate_line_starts (window) WINDOW *window; { register int i, hpos; char **line_starts = NULL; int line_starts_index = 0, line_starts_slots = 0; int bump_index; NODE *node; window->line_starts = NULL; window->line_count = 0; node = window->node; if (!node) return; /* Grovel the node starting at the top, and for each line calculate the width of the characters appearing in that line. Add each line start to our array. */ i = 0; hpos = 0; bump_index = 0; while (i < node->nodelen) { char *line = node->contents + i; unsigned int cwidth, c; add_pointer_to_array (line, line_starts_index, line_starts, line_starts_slots, 100, char *); if (bump_index) { i++; bump_index = 0; } while (1) { - c = node->contents[i]; + /* The cast to unsigned char is for 8-bit characters, which + could be passed as negative integers to character_width + and wreak havoc on some naive implementations of iscntrl. */ + c = (unsigned char) node->contents[i]; cwidth = character_width (c, hpos); /* If this character fits within this line, just do the next one. */ if ((hpos + cwidth) < window->width) { i++; hpos += cwidth; continue; } else { /* If this character would position the cursor at the start of the next printed screen line, then do the next line. */ if (c == '\n' || c == '\r' || c == '\t') { i++; hpos = 0; break; } else { /* This character passes the window width border. Postion the cursor after the printed character, but remember this line start as where this character is. A bit tricky. */ /* If this window doesn't wrap lines, proceed to the next physical line here. */ if (window->flags & W_NoWrap) { hpos = 0; while (i < node->nodelen && node->contents[i] != '\n') i++; if (node->contents[i] == '\n') i++; } else { hpos = the_screen->width - hpos; bump_index++; } break; } } } } window->line_starts = line_starts; window->line_count = line_starts_index; } /* Given WINDOW, recalculate the line starts for the node it displays. */ void recalculate_line_starts (window) WINDOW *window; { maybe_free (window->line_starts); calculate_line_starts (window); } /* Global variable control redisplay of scrolled windows. If non-zero, it is the desired number of lines to scroll the window in order to make point visible. A user might set this to 1 for smooth scrolling. If set to zero, the line containing point is centered within the window. */ int window_scroll_step = 0; /* Adjust the pagetop of WINDOW such that the cursor point will be visible. */ void window_adjust_pagetop (window) WINDOW *window; { register int line = 0; char *contents; if (!window->node) return; contents = window->node->contents; /* Find the first printed line start which is after WINDOW->point. */ for (line = 0; line < window->line_count; line++) { char *line_start; line_start = window->line_starts[line]; if ((line_start - contents) > window->point) break; } /* The line index preceding the line start which is past point is the one containing point. */ line--; /* If this line appears in the current displayable page, do nothing. Otherwise, adjust the top of the page to make this line visible. */ if ((line < window->pagetop) || (line - window->pagetop > (window->height - 1))) { /* The user-settable variable "scroll-step" is used to attempt to make point visible, iff it is non-zero. If that variable is zero, then the line containing point is centered within the window. */ if (window_scroll_step < window->height) { if ((line < window->pagetop) && ((window->pagetop - window_scroll_step) <= line)) window->pagetop -= window_scroll_step; else if ((line - window->pagetop > (window->height - 1)) && ((line - (window->pagetop + window_scroll_step) < window->height))) window->pagetop += window_scroll_step; else window->pagetop = line - ((window->height - 1) / 2); } else window->pagetop = line - ((window->height - 1) / 2); if (window->pagetop < 0) window->pagetop = 0; window->flags |= W_UpdateWindow; } } /* Return the index of the line containing point. */ int window_line_of_point (window) WINDOW *window; { register int i, start = 0; /* Try to optimize. Check to see if point is past the pagetop for this window, and if so, start searching forward from there. */ if ((window->pagetop > -1 && window->pagetop < window->line_count) && (window->line_starts[window->pagetop] - window->node->contents) <= window->point) start = window->pagetop; for (i = start; i < window->line_count; i++) { if ((window->line_starts[i] - window->node->contents) > window->point) break; } return (i - 1); } /* Get and return the goal column for this window. */ int window_get_goal_column (window) WINDOW *window; { if (!window->node) return (-1); if (window->goal_column != -1) return (window->goal_column); /* Okay, do the work. Find the printed offset of the cursor in this window. */ return (window_get_cursor_column (window)); } /* Get and return the printed column offset of the cursor in this window. */ int window_get_cursor_column (window) WINDOW *window; { int i, hpos, end; char *line; i = window_line_of_point (window); if (i < 0) return (-1); line = window->line_starts[i]; end = window->point - (line - window->node->contents); for (hpos = 0, i = 0; i < end; i++) hpos += character_width (line[i], hpos); return (hpos); } /* Count the number of characters in LINE that precede the printed column offset of GOAL. */ int window_chars_to_goal (line, goal) char *line; int goal; { register int i, check, hpos; for (hpos = 0, i = 0; line[i] != '\n'; i++) { check = hpos + character_width (line[i], hpos); if (check > goal) break; hpos = check; } return (i); } /* Create a modeline for WINDOW, and store it in window->modeline. */ void window_make_modeline (window) WINDOW *window; { register int i; char *modeline; char location_indicator[4]; int lines_remaining; /* Only make modelines for those windows which have one. */ if (window->flags & W_InhibitMode) return; /* Find the number of lines actually displayed in this window. */ lines_remaining = window->line_count - window->pagetop; if (window->pagetop == 0) { if (lines_remaining <= window->height) strcpy (location_indicator, "All"); else strcpy (location_indicator, "Top"); } else { if (lines_remaining <= window->height) strcpy (location_indicator, "Bot"); else { float pt, lc; int percentage; pt = (float)window->pagetop; lc = (float)window->line_count; percentage = 100 * (pt / lc); sprintf (location_indicator, "%2d%%", percentage); } } /* Calculate the maximum size of the information to stick in MODELINE. */ { int modeline_len = 0; char *parent = NULL, *filename = "*no file*"; char *nodename = "*no node*"; char *update_message = NULL; NODE *node = window->node; if (node) { if (node->nodename) nodename = node->nodename; if (node->parent) { parent = filename_non_directory (node->parent); modeline_len += strlen ("Subfile: ") + strlen (node->filename); } if (node->filename) filename = filename_non_directory (node->filename); if (node->flags & N_UpdateTags) update_message = _("--*** Tags out of Date ***"); } if (update_message) modeline_len += strlen (update_message); modeline_len += strlen (filename); modeline_len += strlen (nodename); modeline_len += 4; /* strlen (location_indicator). */ /* 10 for the decimal representation of the number of lines in this node, and the remainder of the text that can appear in the line. */ modeline_len += 10 + strlen (_("-----Info: (), lines ----, ")); modeline_len += window->width; modeline = xmalloc (1 + modeline_len); /* Special internal windows have no filename. */ if (!parent && !*filename) sprintf (modeline, _("-%s---Info: %s, %d lines --%s--"), (window->flags & W_NoWrap) ? "$" : "-", nodename, window->line_count, location_indicator); else sprintf (modeline, _("-%s%s-Info: (%s)%s, %d lines --%s--"), (window->flags & W_NoWrap) ? "$" : "-", (node && (node->flags & N_IsCompressed)) ? "zz" : "--", parent ? parent : filename, nodename, window->line_count, location_indicator); if (parent) sprintf (modeline + strlen (modeline), _(" Subfile: %s"), filename); if (update_message) sprintf (modeline + strlen (modeline), "%s", update_message); i = strlen (modeline); if (i >= window->width) modeline[window->width] = '\0'; else { while (i < window->width) modeline[i++] = '-'; modeline[i] = '\0'; } strcpy (window->modeline, modeline); free (modeline); } } /* Make WINDOW start displaying at PERCENT percentage of its node. */ void window_goto_percentage (window, percent) WINDOW *window; int percent; { int desired_line; if (!percent) desired_line = 0; else desired_line = (int) ((float)window->line_count * ((float)percent / 100.0)); window->pagetop = desired_line; window->point = window->line_starts[window->pagetop] - window->node->contents; window->flags |= W_UpdateWindow; window_make_modeline (window); } /* Get the state of WINDOW, and save it in STATE. */ void window_get_state (window, state) WINDOW *window; WINDOW_STATE *state; { state->node = window->node; state->pagetop = window->pagetop; state->point = window->point; } /* Set the node, pagetop, and point of WINDOW. */ void window_set_state (window, state) WINDOW *window; WINDOW_STATE *state; { if (window->node != state->node) window_set_node_of_window (window, state->node); window->pagetop = state->pagetop; window->point = state->point; } /* Manipulating home-made nodes. */ /* A place to buffer echo area messages. */ static NODE *echo_area_node = NULL; /* Make the node of the_echo_area be an empty one. */ static void free_echo_area () { if (echo_area_node) { maybe_free (echo_area_node->contents); free (echo_area_node); } echo_area_node = NULL; window_set_node_of_window (the_echo_area, echo_area_node); } /* Clear the echo area, removing any message that is already present. The echo area is cleared immediately. */ void window_clear_echo_area () { free_echo_area (); display_update_one_window (the_echo_area); } /* Make a message appear in the echo area, built from FORMAT, ARG1 and ARG2. The arguments are treated similar to printf () arguments, but not all of printf () hair is present. The message appears immediately. If there was already a message appearing in the echo area, it is removed. */ void window_message_in_echo_area (format, arg1, arg2) char *format; void *arg1, *arg2; { free_echo_area (); echo_area_node = build_message_node (format, arg1, arg2); window_set_node_of_window (the_echo_area, echo_area_node); display_update_one_window (the_echo_area); } /* Place a temporary message in the echo area built from FORMAT, ARG1 and ARG2. The message appears immediately, but does not destroy any existing message. A future call to unmessage_in_echo_area () restores the old contents. */ static NODE **old_echo_area_nodes = NULL; static int old_echo_area_nodes_index = 0; static int old_echo_area_nodes_slots = 0; void message_in_echo_area (format, arg1, arg2) char *format; void *arg1, *arg2; { if (echo_area_node) { add_pointer_to_array (echo_area_node, old_echo_area_nodes_index, old_echo_area_nodes, old_echo_area_nodes_slots, 4, NODE *); } echo_area_node = NULL; window_message_in_echo_area (format, arg1, arg2); } void unmessage_in_echo_area () { free_echo_area (); if (old_echo_area_nodes_index) echo_area_node = old_echo_area_nodes[--old_echo_area_nodes_index]; window_set_node_of_window (the_echo_area, echo_area_node); display_update_one_window (the_echo_area); } /* A place to build a message. */ static char *message_buffer = NULL; static int message_buffer_index = 0; static int message_buffer_size = 0; /* Ensure that there is enough space to stuff LENGTH characters into MESSAGE_BUFFER. */ static void message_buffer_resize (length) int length; { if (!message_buffer) { message_buffer_size = length + 1; message_buffer = xmalloc (message_buffer_size); message_buffer_index = 0; } while (message_buffer_size <= message_buffer_index + length) message_buffer = (char *) xrealloc (message_buffer, message_buffer_size += 100 + (2 * length)); } /* Format MESSAGE_BUFFER with the results of printing FORMAT with ARG1 and ARG2. */ static void -build_message_buffer (format, arg1, arg2) +build_message_buffer (format, arg1, arg2, arg3) char *format; - void *arg1, *arg2; + void *arg1, *arg2, *arg3; { register int i, len; - void *args[2]; + void *args[3]; int arg_index = 0; args[0] = arg1; args[1] = arg2; + args[2] = arg3; len = strlen (format); message_buffer_resize (len); for (i = 0; format[i]; i++) { if (format[i] != '%') { message_buffer[message_buffer_index++] = format[i]; len--; } else { char c; char *fmt_start = format + i; char *fmt; int fmt_len, formatted_len; + int paramed = 0; + format_again: i++; while (format[i] && strchr ("-. +0123456789", format[i])) i++; c = format[i]; if (c == '\0') abort (); + if (c == '$') { + /* position parameter parameter */ + /* better to use bprintf from bfox's metahtml? */ + arg_index = atoi(fmt_start + 1) - 1; + if (arg_index < 0) + arg_index = 0; + if (arg_index >= 2) + arg_index = 1; + paramed = 1; + goto format_again; + } + fmt_len = format + i - fmt_start + 1; fmt = (char *) xmalloc (fmt_len + 1); strncpy (fmt, fmt_start, fmt_len); fmt[fmt_len] = '\0'; + if (paramed) { + /* removed positioned parameter */ + char *p; + for (p = fmt + 1; *p && *p != '$'; p++) { + ; + } + strcpy(fmt + 1, p + 1); + } + /* If we have "%-98s", maybe 98 calls for a longer string. */ if (fmt_len > 2) { int j; - for (j = 0; j < fmt_len; j++) - if (isdigit (fmt[j])) + for (j = fmt_len - 2; j >= 0; j--) + if (isdigit (fmt[j]) || fmt[j] == '$') break; formatted_len = atoi (fmt + j); } else formatted_len = c == 's' ? 0 : 1; /* %s can produce empty string */ switch (c) { case '%': /* Insert a percent sign. */ message_buffer_resize (len + formatted_len); sprintf (message_buffer + message_buffer_index, fmt, "%"); message_buffer_index += formatted_len; break; case 's': /* Insert the current arg as a string. */ { char *string; int string_len; string = (char *)args[arg_index++]; string_len = strlen (string); if (formatted_len > string_len) string_len = formatted_len; message_buffer_resize (len + string_len); sprintf (message_buffer + message_buffer_index, fmt, string); message_buffer_index += string_len; } break; case 'd': /* Insert the current arg as an integer. */ { long long_val; int integer; long_val = (long)args[arg_index++]; integer = (int)long_val; message_buffer_resize (len + formatted_len > 32 ? formatted_len : 32); sprintf (message_buffer + message_buffer_index, fmt, integer); message_buffer_index = strlen (message_buffer); } break; case 'c': /* Insert the current arg as a character. */ { long long_val; int character; long_val = (long)args[arg_index++]; character = (int)long_val; message_buffer_resize (len + formatted_len); sprintf (message_buffer + message_buffer_index, fmt, character); message_buffer_index += formatted_len; } break; default: abort (); } free (fmt); } } message_buffer[message_buffer_index] = '\0'; } /* Build a new node which has FORMAT printed with ARG1 and ARG2 as the contents. */ NODE * build_message_node (format, arg1, arg2) char *format; void *arg1, *arg2; { NODE *node; message_buffer_index = 0; - build_message_buffer (format, arg1, arg2); + build_message_buffer (format, arg1, arg2, 0); node = message_buffer_to_node (); return (node); } /* Convert the contents of the message buffer to a node. */ NODE * message_buffer_to_node () { NODE *node; node = xmalloc (sizeof (NODE)); node->filename = NULL; node->parent = NULL; node->nodename = NULL; node->flags = 0; node->display_pos =0; /* Make sure that this buffer ends with a newline. */ node->nodelen = 1 + strlen (message_buffer); node->contents = xmalloc (1 + node->nodelen); strcpy (node->contents, message_buffer); node->contents[node->nodelen - 1] = '\n'; node->contents[node->nodelen] = '\0'; return (node); } /* Useful functions can be called from outside of window.c. */ void initialize_message_buffer () { message_buffer_index = 0; } /* Print FORMAT with ARG1,2 to the end of the current message buffer. */ void -printf_to_message_buffer (format, arg1, arg2) +printf_to_message_buffer (format, arg1, arg2, arg3) char *format; - void *arg1, *arg2; + void *arg1, *arg2, *arg3; { - build_message_buffer (format, arg1, arg2); + build_message_buffer (format, arg1, arg2, arg3); } /* Return the current horizontal position of the "cursor" on the most recently output message buffer line. */ int message_buffer_length_this_line () { register int i; if (!message_buffer_index) return (0); for (i = message_buffer_index; i && message_buffer[i - 1] != '\n'; i--); return (string_width (message_buffer + i, 0)); } /* Pad STRING to COUNT characters by inserting blanks. */ int pad_to (count, string) int count; char *string; { register int i; i = strlen (string); if (i >= count) string[i++] = ' '; else { while (i < count) string[i++] = ' '; } string[i] = '\0'; return (i); } diff --git a/contrib/texinfo/lib/getopt.c b/contrib/texinfo/lib/getopt.c index 03effcbdb3e1..d176d3e7e720 100644 --- a/contrib/texinfo/lib/getopt.c +++ b/contrib/texinfo/lib/getopt.c @@ -1,1052 +1,1049 @@ /* Getopt for GNU. - NOTE: getopt is now part of the C library, so if you don't know what - "Keep this file name-space clean" means, talk to drepper@gnu.org - before changing it! + NOTE: The canonical source of this file is maintained with the GNU + C Library. Bugs can be reported to bug-glibc@gnu.org. - Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98 + Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 Free Software Foundation, Inc. - NOTE: The canonical source of this file is maintained with the GNU C Library. - Bugs can be reported to bug-glibc@gnu.org. - 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. */ + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>. Ditto for AIX 3.2 and <stdlib.h>. */ #ifndef _NO_PROTO # define _NO_PROTO #endif #ifdef HAVE_CONFIG_H # include <config.h> -#endif - -#if !defined __STDC__ || !__STDC__ +#else +# if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ -# ifndef const -# define const +# ifndef const +# define const +# endif # endif #endif #include <stdio.h> /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 # include <gnu-versions.h> # if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION # define ELIDE_CODE # endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ # include <stdlib.h> # include <unistd.h> #endif /* GNU C library. */ #ifdef VMS # include <unixlib.h> # if HAVE_STRING_H - 0 # include <string.h> # endif #endif #ifndef _ /* This is for other GNU distributions with internationalized messages. When compiling libc, the _ macro is predefined. */ # ifdef HAVE_LIBINTL_H # include <libintl.h> # define _(msgid) gettext (msgid) # else # define _(msgid) (msgid) # endif #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ -char *optarg = NULL; +char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Formerly, initialization of getopt depended on optind==0, which causes problems with re-calling getopt as programs generally don't know that. */ -int __getopt_initialized = 0; +int __getopt_initialized; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; /* Value of POSIXLY_CORRECT environment variable. */ static char *posixly_correct; #ifdef __GNU_LIBRARY__ /* We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble. On some systems, it contains special magic macros that don't work in GCC. */ # include <string.h> # define my_index strchr #else # if HAVE_STRING_H # include <string.h> # else # include <strings.h> # endif /* Avoid depending on library functions or files whose names are inconsistent. */ #ifndef getenv extern char *getenv (); #endif static char * my_index (str, chr) const char *str; int chr; { while (*str) { if (*str == chr) return (char *) str; str++; } return 0; } /* If using GCC, we can safely declare strlen this way. If not using GCC, it is ok not to declare it. */ #ifdef __GNUC__ /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. That was relevant to code that was here before. */ # if (!defined __STDC__ || !__STDC__) && !defined strlen /* gcc with -traditional declares the built-in strlen to return int, and has done so at least since version 2.4.5. -- rms. */ extern int strlen (const char *); # endif /* not __STDC__ */ #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; #ifdef _LIBC /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; static int nonoption_flags_max_len; static int nonoption_flags_len; static int original_argc; static char *const *original_argv; /* Make sure the environment variable bash 2.0 puts in the environment is valid for the getopt call we must make sure that the ARGV passed to getopt is that one passed to the process. */ static void __attribute__ ((unused)) store_args_and_env (int argc, char *const *argv) { /* XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ original_argc = argc; original_argv = argv; } # ifdef text_set_element text_set_element (__libc_subinit, store_args_and_env); # endif /* text_set_element */ # define SWAP_FLAGS(ch1, ch2) \ if (nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ __getopt_nonoption_flags[ch2] = __tmp; \ } #else /* !_LIBC */ # define SWAP_FLAGS(ch1, ch2) #endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ #if defined __STDC__ && __STDC__ static void exchange (char **); #endif static void exchange (argv) char **argv; { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ #ifdef _LIBC /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = malloc (top + 1); if (new_str == NULL) nonoption_flags_len = nonoption_flags_max_len = 0; else { memset (__mempcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len), '\0', top + 1 - nonoption_flags_max_len); nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } #endif while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ #if defined __STDC__ && __STDC__ static const char *_getopt_initialize (int, char *const *, const char *); #endif static const char * _getopt_initialize (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind; nextchar = NULL; posixly_correct = getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (posixly_correct != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; #ifdef _LIBC if (posixly_correct == NULL && argc == original_argc && argv == original_argv) { if (nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; int len = nonoption_flags_max_len = strlen (orig_str); if (nonoption_flags_max_len < argc) nonoption_flags_max_len = argc; __getopt_nonoption_flags = (char *) malloc (nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) nonoption_flags_max_len = -1; else memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), '\0', nonoption_flags_max_len - len); } } nonoption_flags_len = nonoption_flags_max_len; } else nonoption_flags_len = 0; #endif return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal (argc, argv, optstring, longopts, longind, long_only) int argc; char *const *argv; const char *optstring; const struct option *longopts; int *longind; int long_only; { optarg = NULL; if (optind == 0 || !__getopt_initialized) { if (optind == 0) optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize (argc, argv, optstring); __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #ifdef _LIBC # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ || (optind < nonoption_flags_len \ && __getopt_nonoption_flags[optind] == '1')) #else # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') #endif if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (last_nonopt > optind) last_nonopt = optind; if (first_nonopt > optind) first_nonopt = optind; if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && NONOPTION_P) optind++; last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp (argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) return -1; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) - if (argv[optind - 1][1] == '-') - /* --option */ - fprintf (stderr, - _("%s: option `--%s' doesn't allow an argument\n"), - argv[0], pfound->name); - else - /* +option or -option */ - fprintf (stderr, - _("%s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], pfound->name); + { + if (argv[optind - 1][1] == '-') + /* --option */ + fprintf (stderr, + _("%s: option `--%s' doesn't allow an argument\n"), + argv[0], pfound->name); + else + /* +option or -option */ + fprintf (stderr, + _("%s: option `%c%s' doesn't allow an argument\n"), + argv[0], argv[optind - 1][0], pfound->name); + } nextchar += strlen (nextchar); optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || my_index (optstring, *nextchar) == NULL) { if (opterr) { if (argv[optind][1] == '-') /* --option */ fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); else /* +option or -option */ fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); } nextchar = (char *) ""; optind++; optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = my_index (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (opterr) { if (posixly_correct) /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); else fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); } optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (opterr) fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (opterr) fprintf (stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); nextchar += strlen (nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (opterr) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (opterr) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } int getopt (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } #endif /* Not ELIDE_CODE. */ #ifdef TEST /* Compile with -DTEST to make an executable for use in testing the above definition of `getopt'. */ int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; c = getopt (argc, argv, "abc:d:0123456789"); if (c == -1) break; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ diff --git a/contrib/texinfo/lib/getopt.h b/contrib/texinfo/lib/getopt.h index fb30719a8602..ac6728f83d45 100644 --- a/contrib/texinfo/lib/getopt.h +++ b/contrib/texinfo/lib/getopt.h @@ -1,133 +1,169 @@ /* Declarations for getopt. - Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc. - + Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@gnu.org. - 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. */ #ifndef _GETOPT_H -#define _GETOPT_H 1 + +#ifndef __need_getopt +# define _GETOPT_H 1 +#endif #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; +#ifndef __need_getopt /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { -#if defined (__STDC__) && __STDC__ +# if defined __STDC__ && __STDC__ const char *name; -#else +# else char *name; -#endif +# endif /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ -#define no_argument 0 -#define required_argument 1 -#define optional_argument 2 +# define no_argument 0 +# define required_argument 1 +# define optional_argument 2 +#endif /* need getopt */ + + +/* Get definitions and prototypes for functions to process the + arguments in ARGV (ARGC of them, minus the program name) for + options given in OPTS. -#if defined (__STDC__) && __STDC__ -#ifdef __GNU_LIBRARY__ + Return the option character from OPTS just read. Return -1 when + there are no more options. For unrecognized options, or options + missing arguments, `optopt' is set to the option letter, and '?' is + returned. + + The OPTS string is a list of characters which are recognized option + letters, optionally followed by colons, specifying that that letter + takes an argument, to be placed in `optarg'. + + If a letter in OPTS is followed by two colons, its argument is + optional. This behavior is specific to the GNU `getopt'. + + The argument `--' causes premature termination of argument + scanning, explicitly telling `getopt' that there are no more + options. + + If OPTS begins with `--', then non-option arguments are treated as + arguments to the option '\0'. This behavior is specific to the GNU + `getopt'. */ + +#if defined __STDC__ && __STDC__ +# ifdef __GNU_LIBRARY__ /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ -extern int getopt (int argc, char *const *argv, const char *shortopts); -#else /* not __GNU_LIBRARY__ */ +extern int getopt (int __argc, char *const *__argv, const char *__shortopts); +# else /* not __GNU_LIBRARY__ */ extern int getopt (); -#endif /* __GNU_LIBRARY__ */ -extern int getopt_long (int argc, char *const *argv, const char *shortopts, - const struct option *longopts, int *longind); -extern int getopt_long_only (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind); +# endif /* __GNU_LIBRARY__ */ + +# ifndef __need_getopt +extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts, + const struct option *__longopts, int *__longind); +extern int getopt_long_only (int __argc, char *const *__argv, + const char *__shortopts, + const struct option *__longopts, int *__longind); /* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind, - int long_only); +extern int _getopt_internal (int __argc, char *const *__argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only); +# endif #else /* not __STDC__ */ extern int getopt (); +# ifndef __need_getopt extern int getopt_long (); extern int getopt_long_only (); extern int _getopt_internal (); +# endif #endif /* __STDC__ */ #ifdef __cplusplus } #endif +/* Make sure we later can get all the definitions and declarations. */ +#undef __need_getopt + #endif /* getopt.h */ diff --git a/contrib/texinfo/lib/getopt1.c b/contrib/texinfo/lib/getopt1.c index ff257374c335..9c8256567c49 100644 --- a/contrib/texinfo/lib/getopt1.c +++ b/contrib/texinfo/lib/getopt1.c @@ -1,190 +1,188 @@ /* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. - NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@gnu.org. 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. */ + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include <config.h> -#endif - -#include "getopt.h" - +#else #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif +#endif + +#include "getopt.h" #include <stdio.h> /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 #include <gnu-versions.h> #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include <stdlib.h> #endif #ifndef NULL #define NULL 0 #endif int getopt_long (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } #endif /* Not ELIDE_CODE. */ #ifdef TEST #include <stdio.h> int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, {"verbose", 0, 0, 0}, {"create", 0, 0, 0}, {"file", 1, 0, 0}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "abc:d:0123456789", long_options, &option_index); if (c == -1) break; switch (c) { case 0: printf ("option %s", long_options[option_index].name); if (optarg) printf (" with arg %s", optarg); printf ("\n"); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case 'd': printf ("option d with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ diff --git a/contrib/texinfo/lib/gettext.h b/contrib/texinfo/lib/gettext.h new file mode 100644 index 000000000000..4ab74d92c295 --- /dev/null +++ b/contrib/texinfo/lib/gettext.h @@ -0,0 +1,74 @@ +/* Convenience header for conditional use of GNU <libintl.h>. + Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library 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. */ + +#ifndef _LIBGETTEXT_H +#define _LIBGETTEXT_H 1 + +/* NLS can be disabled through the configure --disable-nls option. */ +#if ENABLE_NLS + +/* Get declarations of GNU message catalog functions. */ +# include <libintl.h> + +#else + +/* Disabled NLS. + The casts to 'const char *' serve the purpose of producing warnings + for invalid uses of the value returned from these functions. + On pre-ANSI systems without 'const', the config.h file is supposed to + contain "#define const". */ +#if 0 +/* no thanks, not ready to go const --karl, 26feb02 */ +# define gettext(Msgid) ((const char *) (Msgid)) +# define dgettext(Domainname, Msgid) ((const char *) (Msgid)) +# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) +# define ngettext(Msgid1, Msgid2, N) \ + ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) +# define dngettext(Domainname, Msgid1, Msgid2, N) \ + ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) +# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ + ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) +# define textdomain(Domainname) ((const char *) (Domainname)) +# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) +# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) +#else /* not 0 */ +# define gettext(Msgid) ((Msgid)) +# define dgettext(Domainname, Msgid) (Msgid) +# define dcgettext(Domainname, Msgid, Category) (Msgid) +# define ngettext(Msgid1, Msgid2, N) \ + ((N) == 1 ? (Msgid1) : (Msgid2)) +# define dngettext(Domainname, Msgid1, Msgid2, N) \ + ((N) == 1 ? (Msgid1) : (Msgid2)) +# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ + ((N) == 1 ? (Msgid1) : (Msgid2)) +# define textdomain(Domainname) (Domainname) +# define bindtextdomain(Domainname, Dirname) (Dirname) +# define bind_textdomain_codeset(Domainname, Codeset) (Codeset) +#endif /* 0 */ +#endif + +/* A pseudo function call that serves as a marker for the automated + extraction of messages, but does not call gettext(). The run-time + translation is done at a different place in the code. + The argument, String, should be a literal string. Concatenated strings + and other string expressions won't work. + The macro's expansion is not parenthesized, so that it is suitable as + initializer for static 'char[]' or 'const char[]' variables. */ +#define gettext_noop(String) String + +#endif /* _LIBGETTEXT_H */ diff --git a/contrib/texinfo/lib/system.h b/contrib/texinfo/lib/system.h index 4ca1837a92e8..a81655334182 100644 --- a/contrib/texinfo/lib/system.h +++ b/contrib/texinfo/lib/system.h @@ -1,203 +1,248 @@ /* system.h: system-dependent declarations; include this first. - $Id: system.h,v 1.14 1999/07/17 21:11:34 karl Exp $ + $Id: system.h,v 1.22 2002/02/26 14:31:18 karl Exp $ - Copyright (C) 1997, 98, 99 Free Software Foundation, Inc. + Copyright (C) 1997, 98, 99, 00, 01, 02 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. */ #ifndef TEXINFO_SYSTEM_H #define TEXINFO_SYSTEM_H #define _GNU_SOURCE #include <config.h> /* <unistd.h> should be included before any preprocessor test of _POSIX_VERSION. */ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif /* HAVE_UNISTD_H */ #include <stdio.h> #include <sys/types.h> #include <ctype.h> +/* All systems nowadays probably have these functions, but ... */ #ifdef HAVE_LOCALE_H #include <locale.h> #endif #ifndef HAVE_SETLOCALE #define setlocale(category,locale) /* empty */ #endif /* For gettext (NLS). */ -#include <libintl.h> +#include "gettext.h" #define _(String) gettext (String) #define N_(String) (String) +#ifndef HAVE_LC_MESSAGES +#define LC_MESSAGES (-1) +#endif + #ifdef STDC_HEADERS #define getopt system_getopt #include <stdlib.h> #undef getopt #else extern char *getenv (); #endif /* Don't use bcopy! Use memmove if source and destination may overlap, memcpy otherwise. */ #ifdef HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include <memory.h> # endif # include <string.h> #else # include <strings.h> char *memchr (); #endif #include <errno.h> #ifndef errno extern int errno; #endif #ifdef VMS #include <perror.h> #endif #ifndef HAVE_DECL_STRERROR extern char *strerror (); #endif +#ifdef HAVE_LIMITS_H +#include <limits.h> +#endif +#ifndef PATH_MAX +#ifndef _POSIX_PATH_MAX +# define _POSIX_PATH_MAX 255 +#endif +#define PATH_MAX _POSIX_PATH_MAX +#endif + #ifndef HAVE_DECL_STRCASECMP extern int strcasecmp (); #endif #ifndef HAVE_DECL_STRNCASECMP extern int strncasecmp (); #endif #ifndef HAVE_DECL_STRCOLL extern int strcoll (); #endif #include <sys/stat.h> #if STAT_MACROS_BROKEN # undef S_ISDIR #endif #if !defined(S_ISDIR) && defined(S_IFDIR) # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) #endif #ifdef HAVE_SYS_FILE_H #include <sys/file.h> #endif /* HAVE_SYS_FILE_H */ #ifndef O_RDONLY /* Since <fcntl.h> is POSIX, prefer that to <sys/fcntl.h>. This also avoids some useless warnings on (at least) Linux. */ #ifdef HAVE_FCNTL_H #include <fcntl.h> #else /* not HAVE_FCNTL_H */ #ifdef HAVE_SYS_FCNTL_H #include <sys/fcntl.h> #endif /* not HAVE_SYS_FCNTL_H */ #endif /* not HAVE_FCNTL_H */ #endif /* not O_RDONLY */ /* MS-DOS and similar non-Posix systems have some peculiarities: - they distinguish between binary and text files; - they use both `/' and `\\' as directory separator in file names; - they can have a drive letter X: prepended to a file name; - they have a separate root directory on each drive; - their filesystems are case-insensitive; - directories in environment variables (like INFOPATH) are separated by `;' rather than `:'; - text files can have their lines ended either with \n or with \r\n pairs; - These are all parameterized here except the last, which is handled by the source code as appropriate (mostly, in info/). */ #ifndef O_BINARY # ifdef _O_BINARY # define O_BINARY _O_BINARY # else # define O_BINARY 0 # endif #endif /* O_BINARY */ +/* We'd like to take advantage of _doprnt if it's around, a la error.c, + but then we'd have no VA_SPRINTF. */ +#if HAVE_VPRINTF +# if __STDC__ +# include <stdarg.h> +# define VA_START(args, lastarg) va_start(args, lastarg) +# else +# include <varargs.h> +# define VA_START(args, lastarg) va_start(args) +# endif +# define VA_FPRINTF(file, fmt, ap) vfprintf (file, fmt, ap) +# define VA_SPRINTF(str, fmt, ap) vsprintf (str, fmt, ap) +#else /* not HAVE_VPRINTF */ +# define VA_START(args, lastarg) +# define va_alist a1, a2, a3, a4, a5, a6, a7, a8 +# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8; +# define va_end(args) +#endif + #if O_BINARY -# include <io.h> +# ifdef HAVE_IO_H +# include <io.h> +# endif # ifdef __MSDOS__ # include <limits.h> # ifdef __DJGPP__ # define HAVE_LONG_FILENAMES(dir) (pathconf (dir, _PC_NAME_MAX) > 12) # define NULL_DEVICE "/dev/null" +# define DEFAULT_INFOPATH "c:/djgpp/info;/usr/local/info;/usr/info;." # else /* !__DJGPP__ */ # define HAVE_LONG_FILENAMES(dir) (0) # define NULL_DEVICE "NUL" # endif /* !__DJGPP__ */ # define SET_SCREEN_SIZE_HELPER terminal_prep_terminal() # define DEFAULT_INFO_PRINT_COMMAND ">PRN" # else /* !__MSDOS__ */ # define setmode(f,m) _setmode(f,m) # define HAVE_LONG_FILENAMES(dir) (1) # define NULL_DEVICE "NUL" # endif /* !__MSDOS__ */ # define SET_BINARY(f) do {if (!isatty(f)) setmode(f,O_BINARY);} while(0) # define FOPEN_RBIN "rb" # define FOPEN_WBIN "wb" # define IS_SLASH(c) ((c) == '/' || (c) == '\\') # define HAVE_DRIVE(n) ((n)[0] && (n)[1] == ':') # define IS_ABSOLUTE(n) (IS_SLASH((n)[0]) || ((n)[0] && (n)[1] == ':')) # define FILENAME_CMP strcasecmp # define FILENAME_CMPN strncasecmp # define PATH_SEP ";" # define STRIP_DOT_EXE 1 # define DEFAULT_TMPDIR "c:/" # define PIPE_USE_FORK 0 #else /* not O_BINARY */ # define SET_BINARY(f) (void)0 # define FOPEN_RBIN "r" # define FOPEN_WBIN "w" # define IS_SLASH(c) ((c) == '/') # define HAVE_DRIVE(n) (0) # define IS_ABSOLUTE(n) ((n)[0] == '/') # define FILENAME_CMP strcmp # define FILENAME_CMPN strncmp # define HAVE_LONG_FILENAMES(dir) (1) # define PATH_SEP ":" # define STRIP_DOT_EXE 0 # ifdef VMS # define DEFAULT_TMPDIR "sys$scratch:" # else # define DEFAULT_TMPDIR "/tmp/" # endif # define NULL_DEVICE "/dev/null" # define PIPE_USE_FORK 1 #endif /* not O_BINARY */ +/* DJGPP supports /dev/null, which is okay for Unix aficionados, + shell scripts and Makefiles, but interactive DOS die-hards + would probably want to have NUL as well. */ +#ifdef __DJGPP__ +# define ALSO_NULL_DEVICE "NUL" +#else +# define ALSO_NULL_DEVICE "" +#endif + #ifdef HAVE_PWD_H #include <pwd.h> #endif /* Some systems don't declare this function in pwd.h. */ struct passwd *getpwnam (); /* Our library routines not included in any system library. */ extern void *xmalloc (), *xrealloc (); extern char *xstrdup (); extern void xexit (); extern char *substring (); /* For convenience. */ #define STREQ(s1,s2) (strcmp (s1, s2) == 0) #endif /* TEXINFO_SYSTEM_H */ diff --git a/contrib/texinfo/lib/xstrdup.c b/contrib/texinfo/lib/xstrdup.c index d5bcaf38091b..38674cab18bb 100644 --- a/contrib/texinfo/lib/xstrdup.c +++ b/contrib/texinfo/lib/xstrdup.c @@ -1,42 +1,46 @@ /* xstrdup.c -- copy a string with out of memory checking - Copyright (C) 1990, 1996 Free Software Foundation, Inc. + Copyright (C) 1990, 1996, 1998 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. */ #if HAVE_CONFIG_H # include <config.h> #endif -#if defined(STDC_HEADERS) || defined(HAVE_STRING_H) +#ifndef PARAMS +# if defined PROTOTYPES || (defined __STDC__ && __STDC__) +# define PARAMS(Args) Args +# else +# define PARAMS(Args) () +# endif +#endif + +#if STDC_HEADERS || HAVE_STRING_H # include <string.h> #else # include <strings.h> #endif -#if defined (__STDC__) && __STDC__ -char *xmalloc (size_t); -char *xstrdup (char *string); -#else -char *xmalloc (); -#endif +#include <sys/types.h> + +char *xmalloc PARAMS ((size_t n)); /* Return a newly allocated copy of STRING. */ char * -xstrdup (string) - char *string; +xstrdup (const char *string) { return strcpy (xmalloc (strlen (string) + 1), string); } diff --git a/contrib/texinfo/makeinfo/README b/contrib/texinfo/makeinfo/README index a6f97ebed4c5..1b45f02c4b21 100644 --- a/contrib/texinfo/makeinfo/README +++ b/contrib/texinfo/makeinfo/README @@ -1,8 +1,8 @@ makeinfo is a standalone program to convert Texinfo source into Info files readable with standalone info or M-x info in Emacs. makeinfo can also output plain ASCII (with --no-headers) -or HTML (with --html). +or HTML (with --html) or XML (with --xml). The Emacs function M-x texinfo-format-buffer does more or less the same job, but makeinfo is faster and gives better error messages. diff --git a/contrib/texinfo/makeinfo/cmds.c b/contrib/texinfo/makeinfo/cmds.c index 65d382e8d4ba..968bc8f0afb9 100644 --- a/contrib/texinfo/makeinfo/cmds.c +++ b/contrib/texinfo/makeinfo/cmds.c @@ -1,1121 +1,1364 @@ /* cmds.c -- Texinfo commands. - $Id: cmds.c,v 1.57 1999/09/19 16:39:35 karl Exp $ + $Id: cmds.c,v 1.69 2002/02/09 00:54:51 karl Exp $ - Copyright (C) 1998, 99 Free Software Foundation, Inc. + Copyright (C) 1998, 99, 2000, 01 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 "system.h" #include "cmds.h" #include "defun.h" #include "files.h" #include "footnote.h" #include "insertion.h" #include "lang.h" #include "macro.h" #include "makeinfo.h" #include "node.h" #include "sectioning.h" #include "toc.h" +#include "xml.h" #ifdef TM_IN_SYS_TIME #include <sys/time.h> #else #include <time.h> #endif void insert_self (), insert_space (), cm_ignore_line (), cm_ignore_arg (); void cm_TeX (), cm_acronym (), cm_asterisk (), cm_b (), cm_bullet (), cm_cite (), cm_code (), cm_copyright (), cm_ctrl (), cm_dfn (), cm_dircategory (), cm_direntry (), cm_dmn (), cm_dots (), cm_emph (), cm_enddots (), cm_i (), cm_image (), cm_kbd (), cm_key (), cm_no_op (), cm_novalidate (), cm_not_fixed_width (), cm_r (), - cm_strong (), cm_var (), cm_sc (), cm_w (), cm_email (), cm_url (); + cm_strong (), cm_var (), cm_sc (), cm_w (), cm_email (), cm_url (), + cm_verb (), cm_documentdescription (); void cm_anchor (), cm_node (), cm_menu (), cm_xref (), cm_ftable (), cm_vtable (), cm_pxref (), cm_inforef (), cm_uref (), cm_email (), cm_quotation (), cm_display (), cm_smalldisplay (), cm_itemize (), cm_enumerate (), cm_tab (), cm_table (), cm_itemx (), cm_noindent (), cm_setfilename (), cm_br (), cm_sp (), cm_page (), cm_group (), cm_center (), cm_ref (), cm_include (), cm_bye (), cm_item (), cm_end (), cm_kindex (), cm_cindex (), cm_findex (), cm_pindex (), cm_vindex (), cm_tindex (), cm_synindex (), cm_printindex (), cm_minus (), cm_example (), cm_smallexample (), cm_smalllisp (), cm_lisp (), cm_format (), cm_smallformat (), cm_exdent (), cm_defindex (), cm_defcodeindex (), cm_result (), cm_expansion (), cm_equiv (), cm_print (), cm_error (), cm_point (), cm_today (), cm_flushleft (), cm_flushright (), cm_finalout (), cm_cartouche (), cm_detailmenu (), - cm_multitable (), cm_settitle (), cm_titlefont (), cm_tt (); + cm_multitable (), cm_settitle (), cm_titlefont (), cm_tt (), + cm_verbatim (), cm_verbatiminclude (), cm_titlepage (); /* Conditionals. */ void cm_set (), cm_clear (), cm_ifset (), cm_ifclear (); void cm_value (), cm_ifeq (); /* Options. */ static void cm_paragraphindent (), cm_exampleindent (); /* Internals. */ static void cm_obsolete (); /* A random string. */ static const char small_tag[] = "small"; /* The dispatch table. */ COMMAND command_table[] = { { "\t", insert_space, NO_BRACE_ARGS }, { "\n", insert_space, NO_BRACE_ARGS }, - { " ", insert_self, NO_BRACE_ARGS }, + { " ", insert_space, NO_BRACE_ARGS }, { "!", insert_self, NO_BRACE_ARGS }, { "\"", cm_accent_umlaut, MAYBE_BRACE_ARGS }, { "'", cm_accent_acute, MAYBE_BRACE_ARGS }, { "*", cm_asterisk, NO_BRACE_ARGS }, { ",", cm_accent_cedilla, MAYBE_BRACE_ARGS }, { "-", cm_no_op, NO_BRACE_ARGS }, { ".", insert_self, NO_BRACE_ARGS }, { ":", cm_no_op, NO_BRACE_ARGS }, { "=", cm_accent, MAYBE_BRACE_ARGS }, { "?", insert_self, NO_BRACE_ARGS }, { "@", insert_self, NO_BRACE_ARGS }, { "^", cm_accent_hat, MAYBE_BRACE_ARGS }, { "`", cm_accent_grave, MAYBE_BRACE_ARGS }, { "{", insert_self, NO_BRACE_ARGS }, { "|", cm_no_op, NO_BRACE_ARGS }, { "}", insert_self, NO_BRACE_ARGS }, { "~", cm_accent_tilde, MAYBE_BRACE_ARGS }, { "AA", cm_special_char, BRACE_ARGS }, { "AE", cm_special_char, BRACE_ARGS }, { "H", cm_accent, MAYBE_BRACE_ARGS }, { "L", cm_special_char, BRACE_ARGS }, { "O", cm_special_char, BRACE_ARGS }, { "OE", cm_special_char, BRACE_ARGS }, { "TeX", cm_TeX, BRACE_ARGS }, { "aa", cm_special_char, BRACE_ARGS }, { "acronym", cm_acronym, BRACE_ARGS }, { "ae", cm_special_char, BRACE_ARGS }, + { "afivepaper", cm_ignore_line, NO_BRACE_ARGS }, + { "afourlatex", cm_ignore_line, NO_BRACE_ARGS }, { "afourpaper", cm_ignore_line, NO_BRACE_ARGS }, + { "afourwide", cm_ignore_line, NO_BRACE_ARGS }, { "alias", cm_alias, NO_BRACE_ARGS }, { "anchor", cm_anchor, BRACE_ARGS }, { "appendix", cm_appendix, NO_BRACE_ARGS }, { "appendixsection", cm_appendixsec, NO_BRACE_ARGS }, { "appendixsec", cm_appendixsec, NO_BRACE_ARGS }, { "appendixsubsec", cm_appendixsubsec, NO_BRACE_ARGS }, { "appendixsubsubsec", cm_appendixsubsubsec, NO_BRACE_ARGS }, { "asis", cm_no_op, BRACE_ARGS }, { "b", cm_b, BRACE_ARGS }, { "bullet", cm_bullet, BRACE_ARGS }, { "bye", cm_bye, NO_BRACE_ARGS }, { "c", cm_ignore_line, NO_BRACE_ARGS }, { "cartouche", cm_cartouche, NO_BRACE_ARGS }, { "center", cm_center, NO_BRACE_ARGS }, { "centerchap", cm_unnumbered, NO_BRACE_ARGS }, { "chapheading", cm_chapheading, NO_BRACE_ARGS }, { "chapter", cm_chapter, NO_BRACE_ARGS }, { "cindex", cm_cindex, NO_BRACE_ARGS }, { "cite", cm_cite, BRACE_ARGS }, { "clear", cm_clear, NO_BRACE_ARGS }, { "code", cm_code, BRACE_ARGS }, { "command", cm_code, BRACE_ARGS }, { "comment", cm_ignore_line, NO_BRACE_ARGS }, { "contents", cm_contents, NO_BRACE_ARGS }, { "copyright", cm_copyright, BRACE_ARGS }, { "ctrl", cm_obsolete, BRACE_ARGS }, { "defcodeindex", cm_defcodeindex, NO_BRACE_ARGS }, { "defcv", cm_defun, NO_BRACE_ARGS }, { "defcvx", cm_defun, NO_BRACE_ARGS }, { "deffn", cm_defun, NO_BRACE_ARGS }, { "deffnx", cm_defun, NO_BRACE_ARGS }, { "defindex", cm_defindex, NO_BRACE_ARGS }, { "definfoenclose", cm_definfoenclose, NO_BRACE_ARGS }, { "defivar", cm_defun, NO_BRACE_ARGS }, { "defivarx", cm_defun, NO_BRACE_ARGS }, { "defmac", cm_defun, NO_BRACE_ARGS }, { "defmacx", cm_defun, NO_BRACE_ARGS }, { "defmethod", cm_defun, NO_BRACE_ARGS }, { "defmethodx", cm_defun, NO_BRACE_ARGS }, { "defop", cm_defun, NO_BRACE_ARGS }, { "defopt", cm_defun, NO_BRACE_ARGS }, { "defoptx", cm_defun, NO_BRACE_ARGS }, { "defopx", cm_defun, NO_BRACE_ARGS }, { "defspec", cm_defun, NO_BRACE_ARGS }, { "defspecx", cm_defun, NO_BRACE_ARGS }, { "deftp", cm_defun, NO_BRACE_ARGS }, { "deftpx", cm_defun, NO_BRACE_ARGS }, { "deftypefn", cm_defun, NO_BRACE_ARGS }, { "deftypefnx", cm_defun, NO_BRACE_ARGS }, { "deftypefun", cm_defun, NO_BRACE_ARGS }, { "deftypefunx", cm_defun, NO_BRACE_ARGS }, { "deftypeivar", cm_defun, NO_BRACE_ARGS }, { "deftypeivarx", cm_defun, NO_BRACE_ARGS }, { "deftypemethod", cm_defun, NO_BRACE_ARGS }, { "deftypemethodx", cm_defun, NO_BRACE_ARGS }, { "deftypeop", cm_defun, NO_BRACE_ARGS }, { "deftypeopx", 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 }, { "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 }, + { "documentdescription", cm_documentdescription, NO_BRACE_ARGS }, { "documentencoding", cm_documentencoding, NO_BRACE_ARGS }, { "documentlanguage", cm_documentlanguage, NO_BRACE_ARGS }, { "dotaccent", cm_accent, MAYBE_BRACE_ARGS }, { "dotless", cm_dotless, BRACE_ARGS }, { "dots", cm_dots, BRACE_ARGS }, { "email", cm_email, BRACE_ARGS }, { "emph", cm_emph, BRACE_ARGS }, { "end", cm_end, NO_BRACE_ARGS }, { "enddots", cm_enddots, BRACE_ARGS }, { "enumerate", cm_enumerate, NO_BRACE_ARGS }, { "env", cm_code, BRACE_ARGS }, { "equiv", cm_equiv, BRACE_ARGS }, { "error", cm_error, BRACE_ARGS }, { "example", cm_example, NO_BRACE_ARGS }, { "exampleindent", cm_exampleindent, NO_BRACE_ARGS }, { "exclamdown", cm_special_char, BRACE_ARGS }, { "exdent", cm_exdent, NO_BRACE_ARGS }, { "expansion", cm_expansion, BRACE_ARGS }, { "file", cm_code, BRACE_ARGS }, { "finalout", cm_no_op, NO_BRACE_ARGS }, { "findex", cm_findex, NO_BRACE_ARGS }, { "flushleft", cm_flushleft, NO_BRACE_ARGS }, { "flushright", cm_flushright, NO_BRACE_ARGS }, { "footnote", cm_footnote, NO_BRACE_ARGS}, /* self-arg eater */ { "footnotestyle", cm_footnotestyle, NO_BRACE_ARGS }, { "format", cm_format, NO_BRACE_ARGS }, { "ftable", cm_ftable, NO_BRACE_ARGS }, { "group", cm_group, NO_BRACE_ARGS }, { "heading", cm_heading, NO_BRACE_ARGS }, { "headings", cm_ignore_line, NO_BRACE_ARGS }, { "html", cm_html, NO_BRACE_ARGS }, { "hyphenation", cm_ignore_arg, BRACE_ARGS }, { "i", cm_i, BRACE_ARGS }, { "ifclear", cm_ifclear, NO_BRACE_ARGS }, { "ifeq", cm_ifeq, NO_BRACE_ARGS }, { "ifhtml", cm_ifhtml, NO_BRACE_ARGS }, { "ifinfo", cm_ifinfo, NO_BRACE_ARGS }, { "ifnothtml", cm_ifnothtml, NO_BRACE_ARGS }, { "ifnotinfo", cm_ifnotinfo, NO_BRACE_ARGS }, { "ifnottex", cm_ifnottex, NO_BRACE_ARGS }, { "ifset", cm_ifset, NO_BRACE_ARGS }, { "iftex", cm_iftex, NO_BRACE_ARGS }, { "ignore", command_name_condition, NO_BRACE_ARGS }, { "image", cm_image, BRACE_ARGS }, { "include", cm_include, NO_BRACE_ARGS }, { "inforef", cm_inforef, BRACE_ARGS }, { "item", cm_item, NO_BRACE_ARGS }, { "itemize", cm_itemize, NO_BRACE_ARGS }, { "itemx", cm_itemx, NO_BRACE_ARGS }, { "kbd", cm_kbd, BRACE_ARGS }, { "kbdinputstyle", cm_ignore_line, NO_BRACE_ARGS }, { "key", cm_key, BRACE_ARGS }, { "kindex", cm_kindex, NO_BRACE_ARGS }, { "l", cm_special_char, BRACE_ARGS }, { "lisp", cm_lisp, NO_BRACE_ARGS }, { "lowersections", cm_lowersections, NO_BRACE_ARGS }, { "macro", cm_macro, NO_BRACE_ARGS }, { "majorheading", cm_majorheading, NO_BRACE_ARGS }, { "math", cm_no_op, BRACE_ARGS }, { "menu", cm_menu, NO_BRACE_ARGS }, { "minus", cm_minus, BRACE_ARGS }, { "multitable", cm_multitable, NO_BRACE_ARGS }, { "need", cm_ignore_line, NO_BRACE_ARGS }, { "node", cm_node, NO_BRACE_ARGS }, { "noindent", cm_noindent, NO_BRACE_ARGS }, { "noindent", cm_novalidate, NO_BRACE_ARGS }, { "nwnode", cm_node, NO_BRACE_ARGS }, { "o", cm_special_char, BRACE_ARGS }, { "oe", cm_special_char, BRACE_ARGS }, { "option", cm_code, BRACE_ARGS }, { "page", cm_no_op, NO_BRACE_ARGS }, { "pagesizes", cm_ignore_line, 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_r, BRACE_ARGS }, { "raisesections", cm_raisesections, NO_BRACE_ARGS }, { "ref", cm_ref, BRACE_ARGS }, { "refill", cm_no_op, NO_BRACE_ARGS }, { "result", cm_result, BRACE_ARGS }, { "ringaccent", cm_accent, MAYBE_BRACE_ARGS }, { "rmacro", cm_rmacro, NO_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_obsolete, NO_BRACE_ARGS }, { "setcontentsaftertitlepage", cm_no_op, NO_BRACE_ARGS }, { "setfilename", cm_setfilename, NO_BRACE_ARGS }, { "setshortcontentsaftertitlepage", cm_no_op, NO_BRACE_ARGS }, { "settitle", cm_settitle, NO_BRACE_ARGS }, { "shortcontents", cm_shortcontents, NO_BRACE_ARGS }, { "shorttitlepage", cm_ignore_line, NO_BRACE_ARGS }, { "smallbook", cm_ignore_line, NO_BRACE_ARGS }, { "smalldisplay", cm_smalldisplay, NO_BRACE_ARGS }, { "smallexample", cm_smallexample, NO_BRACE_ARGS }, { "smallformat", cm_smallformat, NO_BRACE_ARGS }, { "smalllisp", cm_smalllisp, NO_BRACE_ARGS }, { "sp", cm_sp, NO_BRACE_ARGS }, { "ss", cm_special_char, BRACE_ARGS }, { "strong", cm_strong, BRACE_ARGS }, { "subheading", cm_subheading, NO_BRACE_ARGS }, { "subsection", cm_subsection, NO_BRACE_ARGS }, { "subsubheading", cm_subsubheading, NO_BRACE_ARGS }, { "subsubsection", cm_subsubsection, NO_BRACE_ARGS }, - { "summarycontents", cm_no_op, NO_BRACE_ARGS }, + { "summarycontents", cm_shortcontents, NO_BRACE_ARGS }, { "syncodeindex", cm_synindex, NO_BRACE_ARGS }, { "synindex", cm_synindex, NO_BRACE_ARGS }, { "t", cm_tt, BRACE_ARGS }, { "tab", cm_tab, NO_BRACE_ARGS }, { "table", cm_table, NO_BRACE_ARGS }, { "tex", cm_tex, NO_BRACE_ARGS }, { "tieaccent", cm_accent, MAYBE_BRACE_ARGS }, { "tindex", cm_tindex, NO_BRACE_ARGS }, { "titlefont", cm_titlefont, BRACE_ARGS }, { "titlepage", command_name_condition, NO_BRACE_ARGS }, { "today", cm_today, BRACE_ARGS }, { "top", cm_top, NO_BRACE_ARGS }, { "u", cm_accent, MAYBE_BRACE_ARGS }, { "ubaraccent", cm_accent, MAYBE_BRACE_ARGS }, { "udotaccent", cm_accent, MAYBE_BRACE_ARGS }, { "unmacro", cm_unmacro, NO_BRACE_ARGS }, { "unnumbered", cm_unnumbered, NO_BRACE_ARGS }, { "unnumberedsec", cm_unnumberedsec, NO_BRACE_ARGS }, { "unnumberedsubsec", cm_unnumberedsubsec, NO_BRACE_ARGS }, { "unnumberedsubsubsec", cm_unnumberedsubsubsec, NO_BRACE_ARGS }, { "uref", cm_uref, BRACE_ARGS }, { "url", cm_url, BRACE_ARGS }, { "v", cm_accent, MAYBE_BRACE_ARGS }, { "value", cm_value, BRACE_ARGS }, { "var", cm_var, BRACE_ARGS }, + { "verb", cm_verb, NO_BRACE_ARGS }, + { "verbatim", cm_verbatim, NO_BRACE_ARGS }, + { "verbatiminclude", cm_verbatiminclude, NO_BRACE_ARGS }, { "vindex", cm_vindex, NO_BRACE_ARGS }, { "vtable", cm_vtable, NO_BRACE_ARGS }, { "w", cm_w, BRACE_ARGS }, { "xref", cm_xref, BRACE_ARGS }, /* Deprecated commands. These used to be for italics. */ { "iappendix", cm_ideprecated, NO_BRACE_ARGS }, { "iappendixsec", cm_ideprecated, NO_BRACE_ARGS }, { "iappendixsection", cm_ideprecated, NO_BRACE_ARGS }, { "iappendixsubsec", cm_ideprecated, NO_BRACE_ARGS }, { "iappendixsubsubsec", cm_ideprecated, NO_BRACE_ARGS }, { "ichapter", cm_ideprecated, NO_BRACE_ARGS }, { "isection", cm_ideprecated, NO_BRACE_ARGS }, { "isubsection", cm_ideprecated, NO_BRACE_ARGS }, { "isubsubsection", cm_ideprecated, NO_BRACE_ARGS }, { "iunnumbered", cm_ideprecated, NO_BRACE_ARGS }, { "iunnumberedsec", cm_ideprecated, NO_BRACE_ARGS }, { "iunnumberedsubsec", cm_ideprecated, NO_BRACE_ARGS }, { "iunnumberedsubsubsec", cm_ideprecated, NO_BRACE_ARGS }, /* Now @include does what this was used to. */ { "infoinclude", cm_obsolete, NO_BRACE_ARGS }, { "titlespec", cm_obsolete, NO_BRACE_ARGS }, { NULL, NULL, NO_BRACE_ARGS } }; /* The bulk of the Texinfo commands. */ /* Commands which insert their own names. */ void insert_self (arg) int arg; { if (arg == START) add_word (command); } void insert_space (arg) int arg; { if (arg == START) - add_char (' '); + { + if (xml && !docbook) + xml_insert_entity ("space"); + else + add_char (' '); + } } /* Force a line break in the output. */ void cm_asterisk () { if (html) add_word ("<br>"); + else if (xml && !docbook) + xml_insert_entity ("linebreak"); + else if (docbook) + xml_asterisk (); else { close_single_paragraph (); cm_noindent (); } } /* Insert ellipsis. */ void cm_dots (arg) int arg; { if (arg == START) - add_word (html ? "<small>...</small>" : "..."); + { + if (xml && !docbook) + xml_insert_entity ("dots"); + else if (docbook) + xml_insert_entity ("hellip"); + else + add_word (html ? "<small>...</small>" : "..."); + } } /* Insert ellipsis for sentence end. */ void cm_enddots (arg) int arg; { if (arg == START) - add_word (html ? "<small>...</small>." : "...."); + { + if (xml && !docbook) + xml_insert_entity ("enddots"); + else if (docbook) + { + xml_insert_entity ("hellip"); + add_char ('.'); + } + else + add_word (html ? "<small>...</small>." : "...."); + } } void cm_bullet (arg) int arg; { if (arg == START) { if (html) add_word ("•"); + else if (xml && !docbook) + xml_insert_entity ("bullet"); + else if (docbook) + xml_insert_entity ("bull"); else add_char ('*'); } } void cm_minus (arg) int arg; { if (arg == START) - add_char ('-'); + { + if (xml) + xml_insert_entity ("minus"); + else + add_char ('-'); + } } /* Insert "TeX". */ void cm_TeX (arg) int arg; { if (arg == START) - add_word ("TeX"); + { + if (xml && ! docbook) + xml_insert_entity ("tex"); + else + add_word ("TeX"); + } } /* Copyright symbol. */ void cm_copyright (arg) int arg; { if (arg == START) + { if (html) add_word ("©"); + else if (xml && !docbook) + xml_insert_entity ("copyright"); + else if (docbook) + xml_insert_entity ("copy"); else add_word ("(C)"); + } } void cm_today (arg) int arg; { static char *months[12] = { N_("January"), N_("February"), N_("March"), N_("April"), N_("May"), N_("June"), N_("July"), N_("August"), N_("September"), N_("October"), N_("November"), N_("December") }; if (arg == START) { time_t timer = time (0); struct tm *ts = localtime (&timer); add_word_args ("%d %s %d", ts->tm_mday, _(months[ts->tm_mon]), ts->tm_year + 1900); } } void cm_acronym (arg) int arg; { if (html) insert_html_tag (arg, small_tag); + else if (xml) + xml_insert_element (ACRONYM, arg); } void cm_tt (arg) int arg; { /* @t{} is a no-op in Info. */ if (html) insert_html_tag (arg, "tt"); + else if (xml) + xml_insert_element (TT, arg); } void cm_code (arg) int arg; { + if (xml) + xml_insert_element (CODE, arg); + else + { extern int printing_index; if (arg == START) { in_fixed_width_font++; if (html) insert_html_tag (arg, "code"); else if (!printing_index) add_char ('`'); } else if (html) insert_html_tag (arg, "code"); else { if (!printing_index) add_meta_char ('\''); } + } } void cm_kbd (arg) int arg; { - if (html) + if (xml) + xml_insert_element (KBD, arg); + else if (html) { /* Seems like we should increment in_fixed_width_font for Info format too, but then the quote-omitting special case gets confused. Punt. */ if (arg == START) in_fixed_width_font++; insert_html_tag (arg, "kbd"); } else { /* 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_url (arg, start, end) { - if (html) + if (xml) + xml_insert_element (URL, arg); + else if (html) { if (arg == START) add_word ("<<code>"); else add_word ("</code>>"); } else if (arg == START) add_word ("<"); else add_word (">"); } void cm_key (arg) int arg; { - if (html) + if (xml) + xml_insert_element (KEY, arg); + else if (html) add_word (arg == START ? "<" : ">"); else add_char (arg == START ? '<' : '>'); } /* 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; } /* @var in makeinfo just uppercases the text. */ void cm_var (arg, start_pos, end_pos) int arg, start_pos, end_pos; { + if (xml) + xml_insert_element (VAR, arg); + else + { not_fixed_width (arg); if (html) insert_html_tag (arg, "var"); else if (arg == END) { while (start_pos < end_pos) { unsigned char c = output_paragraph[start_pos]; if (strchr ("[](),", c)) warning (_("unlikely character %c in @var"), c); output_paragraph[start_pos] = coerce_to_upper (c); start_pos++; } } + } } void cm_sc (arg, start_pos, end_pos) int arg, start_pos, end_pos; { + if (xml) + xml_insert_element (SC, arg); + else + { not_fixed_width (arg); if (arg == START) { if (html) insert_html_tag (arg, small_tag); } else { - int all_upper = 1; + int all_upper; if (html) start_pos += sizeof (small_tag) + 2 - 1; /* skip <small> */ + /* Avoid the warning below if there's no text inside @sc{}, or + when processing menus under --no-headers. */ + all_upper = start_pos < end_pos; + while (start_pos < end_pos) { unsigned char c = output_paragraph[start_pos]; if (!isupper (c)) all_upper = 0; output_paragraph[start_pos] = coerce_to_upper (c); start_pos++; } if (all_upper) warning (_("@sc argument all uppercase, thus no effect")); if (html) insert_html_tag (arg, small_tag); } + } } void cm_dfn (arg, position) int arg, position; { + if (xml) + xml_insert_element (DFN, arg); + else + { if (html) insert_html_tag (arg, "dfn"); else if (arg == START) add_char ('"'); else add_meta_char ('"'); + } } void cm_emph (arg) int arg; { - if (html) + if (xml) + xml_insert_element (EMPH, arg); + else if (html) insert_html_tag (arg, "em"); else add_char ('_'); } +void +cm_verb (arg) + int arg; +{ + int character; + int delimiter; + int seen_end = 0; + + in_fixed_width_font++; + /* are these necessary ? */ + last_char_was_newline = 0; + + if (html) + add_word ("<pre>"); + + if (input_text_offset < input_text_length) + { + character = curchar (); + if (character == '{') + input_text_offset++; + else + line_error (_("`{' expected, but saw `%c'"), character); + } + + if (input_text_offset < input_text_length) + { + delimiter = curchar (); + input_text_offset++; + } + + while (input_text_offset < input_text_length) + { + character = curchar (); + + if (character == '\n') + line_number++; + /* + Assume no newlines in END_VERBATIM + */ + else if (character == delimiter) + { + seen_end = 1; + input_text_offset++; + break; + } + + add_char (character); + input_text_offset++; + } + + if (!seen_end) + warning (_("end of file inside verb block")); + + if (input_text_offset < input_text_length) + { + character = curchar (); + if (character == '}') + input_text_offset++; + else + line_error (_("`}' expected, but saw `%c'"), character); + } + + if (html) + add_word ("</pre>"); +} + void cm_strong (arg, position) int arg, position; { - if (html) + if (xml) + xml_insert_element (STRONG, arg); + else if (html) insert_html_tag (arg, "strong"); else add_char ('*'); } void cm_cite (arg, position) int arg, position; { - if (html) + if (xml) + xml_insert_element (CITE, arg); + else if (html) insert_html_tag (arg, "cite"); else { if (arg == START) add_char ('`'); else add_char ('\''); } } /* No highlighting, but argument switches fonts. */ void cm_not_fixed_width (arg, start, end) int arg, start, end; { + if (xml) + xml_insert_element (NOTFIXEDWIDTH, arg); not_fixed_width (arg); } void cm_i (arg) int arg; { - if (html) + if (xml) + xml_insert_element (I, arg); + else if (html) insert_html_tag (arg, "i"); else not_fixed_width (arg); } void cm_b (arg) int arg; { - if (html) + if (xml) + xml_insert_element (B, arg); + else if (html) insert_html_tag (arg, "b"); else not_fixed_width (arg); } void cm_r (arg) int arg; { - extern int printing_index; - - /* People use @r{} in index entries like this: - - @findex foo@r{, some text} - - This is supposed to produce output as if the entry were saying - "@code{foo}, some text", since the "fn" index is typeset as - @code. The following attempts to do the same in HTML. Note that - this relies on the fact that only @code bumps up the variable - in_fixed_width_font while processing index entries in HTML mode. */ - if (html && printing_index) + if (xml) + xml_insert_element (R, arg); + else { - int level = in_fixed_width_font; + extern int printing_index; - while (level--) - insert_html_tag (arg == START ? END : START, "code"); + /* People use @r{} in index entries like this: + + @findex foo@r{, some text} + + This is supposed to produce output as if the entry were saying + "@code{foo}, some text", since the "fn" index is typeset as + @code. The following attempts to do the same in HTML. Note that + this relies on the fact that only @code bumps up the variable + in_fixed_width_font while processing index entries in HTML mode. */ + if (html && printing_index) + { + int level = in_fixed_width_font; + + while (level--) + insert_html_tag (arg == START ? END : START, "code"); + } + + not_fixed_width (arg); } - - not_fixed_width (arg); } void cm_titlefont (arg) int arg; { + if (xml) + xml_insert_element (TITLEFONT, arg); + else not_fixed_width (arg); } /* Various commands are no-op's. */ void cm_no_op () { } /* For proofing single chapters, etc. */ void cm_novalidate () { validating = 0; } /* Prevent the argument from being split across two lines. */ void cm_w (arg, start, end) int arg, start, end; { if (arg == START) non_splitting_words++; else non_splitting_words--; } /* Explain that this command is obsolete, thus the user shouldn't do anything with it. */ static void cm_obsolete (arg, start, end) int arg, start, end; { if (arg == START) warning (_("%c%s is obsolete"), COMMAND_PREFIX, command); } /* This says to inhibit the indentation of the next paragraph, but not of following paragraphs. */ void cm_noindent () { if (!inhibit_paragraph_indentation) inhibit_paragraph_indentation = -1; } /* I don't know exactly what to do with this. Should I allow someone to switch filenames in the middle of output? Since the file could be partially written, this doesn't seem to make sense. Another option: ignore it, since they don't *really* want to switch files. Finally, complain, or at least warn. It doesn't really matter, anyway, since this doesn't get executed. */ void cm_setfilename () { char *filename; get_rest_of_line (1, &filename); /* warning ("`@%s %s' encountered and ignored", command, filename); */ + if (xml) + add_word_args ("<setfilename>%s</setfilename>", filename); free (filename); } void cm_settitle () { - get_rest_of_line (0, &title); + if (xml) + { + xml_begin_document (); + xml_insert_element (SETTITLE, START); + get_rest_of_line (0, &title); + execute_string ("%s", title); + xml_insert_element (SETTITLE, END); + } + else + get_rest_of_line (0, &title); } + /* Ignore argument in braces. */ void cm_ignore_arg (arg, start_pos, end_pos) int arg, start_pos, end_pos; { if (arg == END) output_paragraph_offset = start_pos; } /* Ignore argument on rest of line. */ void cm_ignore_line () { discard_until ("\n"); } /* Insert the number of blank lines passed as argument. */ void cm_sp () { int lines; char *line; get_rest_of_line (1, &line); if (sscanf (line, "%d", &lines) != 1 || lines <= 0) line_error (_("@sp requires a positive numeric argument, not `%s'"), line); else - { /* Must disable filling since otherwise multiple newlines is like + { + if (xml) + { + xml_insert_element_with_attribute (SP, START, "lines=\"%s\"", line); + /* insert_string (line);*/ + xml_insert_element (SP, END); + } + else + { + /* Must disable filling since otherwise multiple newlines is like multiple spaces. Must close paragraph since that's what the manual says and that's what TeX does. */ int save_filling_enabled = filling_enabled; filling_enabled = 0; close_paragraph (); + if (lines && html && !executing_string) + html_output_head (); + while (lines--) { if (html) insert_string ("<br><p>\n"); else add_char ('\n'); } filling_enabled = save_filling_enabled; } + } free (line); } /* @dircategory LINE outputs INFO-DIR-SECTION LINE, unless --no-headers. */ void cm_dircategory () { char *line; - if (html) + if (html || docbook) cm_ignore_line (); + else if (xml) + { + xml_insert_element (DIRCATEGORY, START); + get_rest_of_line (1, &line); + insert_string (line); + free (line); + xml_insert_element (DIRCATEGORY, END); + } else { get_rest_of_line (1, &line); if (!no_headers && !html) { kill_self_indent (-1); /* make sure there's no indentation */ insert_string ("INFO-DIR-SECTION "); insert_string (line); insert ('\n'); } free (line); } } /* Start a new line with just this text on it. Then center the line of text. - This always ends the current paragraph. */ + */ void cm_center () { + if (xml) + { + unsigned char *line; + xml_insert_element (CENTER, START); + get_rest_of_line (0, (char **)&line); + execute_string ("%s", (char *)line); + free (line); + xml_insert_element (CENTER, END); + } + else + { int i, start, length; unsigned char *line; int save_indented_fill = indented_fill; int save_filling_enabled = filling_enabled; int fudge_factor = 1; - close_paragraph (); filling_enabled = indented_fill = 0; cm_noindent (); start = output_paragraph_offset; if (html) - add_word ("<p align=\"center\">"); + add_word ("<div align=\"center\">"); inhibit_output_flushing (); get_rest_of_line (0, (char **)&line); execute_string ("%s", (char *)line); free (line); uninhibit_output_flushing (); if (html) - add_word ("</p>"); + add_word ("</div>"); else { i = output_paragraph_offset - 1; while (i > (start - 1) && output_paragraph[i] == '\n') i--; output_paragraph_offset = ++i; length = output_paragraph_offset - start; if (length < (fill_column - fudge_factor)) { line = xmalloc (1 + length); memcpy (line, (char *)(output_paragraph + start), length); i = (fill_column - fudge_factor - length) / 2; output_paragraph_offset = start; while (i--) insert (' '); for (i = 0; i < length; i++) insert (line[i]); free (line); } } insert ('\n'); - close_paragraph (); filling_enabled = save_filling_enabled; indented_fill = save_indented_fill; + } } /* Show what an expression returns. */ void cm_result (arg) int arg; { if (arg == END) add_word (html ? "=>" : "=>"); } /* What an expression expands to. */ void cm_expansion (arg) int arg; { if (arg == END) add_word (html ? "==>" : "==>"); } /* Indicates two expressions are equivalent. */ void cm_equiv (arg) int arg; { if (arg == END) add_word ("=="); } /* What an expression may print. */ void cm_print (arg) int arg; { if (arg == END) add_word ("-|"); } /* An error signaled. */ void cm_error (arg) int arg; { if (arg == END) add_word (html ? "error-->" : "error-->"); } /* The location of point in an example of a buffer. */ void cm_point (arg) int arg; { if (arg == END) add_word ("-!-"); } /* @exdent: Start a new line with just this text on it. The text is outdented one level if possible. */ void cm_exdent () { char *line; int save_indent = current_indent; int save_in_fixed_width_font = in_fixed_width_font; /* Read argument */ get_rest_of_line (0, &line); /* Exdent the output. Actually this may be a no-op. */ if (current_indent) current_indent -= default_indentation_increment; /* @exdent arg is supposed to be in roman. */ in_fixed_width_font = 0; /* The preceding newline already inserted the `current_indent'. Remove one level's worth. */ kill_self_indent (default_indentation_increment); if (html) add_word ("<br>"); /* Can't close_single_paragraph, then we lose preceding blank lines. */ flush_output (); execute_string ("%s", line); free (line); if (html) add_word ("<br>"); close_single_paragraph (); current_indent = save_indent; in_fixed_width_font = save_in_fixed_width_font; } - -/* Remember this file, and move onto the next. */ -void -cm_include () +/* + Read include-filename, process the include-file: + verbatim_include == 0: process through reader_loop + verbatim_include != 0: process through handle_verbatim_environment + */ +static void +handle_include (verbatim_include) + int verbatim_include; { char *filename; if (macro_expansion_output_stream && !executing_string) me_append_before_this_command (); close_paragraph (); get_rest_of_line (0, &filename); if (macro_expansion_output_stream && !executing_string) remember_itext (input_text, input_text_offset); pushfile (); /* In verbose mode we print info about including another file. */ if (verbose_mode) { int i = 0; FSTACK *stack = filestack; for (i = 0, stack = filestack; stack; stack = stack->next, i++); i *= 2; printf ("%*s", i, ""); - printf ("%c%s %s\n", COMMAND_PREFIX, command, filename); + printf ("%c%s `%s'\n", COMMAND_PREFIX, command, filename); fflush (stdout); } if (!find_and_load (filename)) { extern int errno; popfile (); line_number--; - /* Cannot "@include foo", in line 5 of "/wh/bar". */ - line_error ("%c%s %s: %s", COMMAND_PREFIX, command, filename, + /* /wh/bar:5: @include/@verbatiminclude `foo': No such file or dir */ + line_error ("%c%s `%s': %s", COMMAND_PREFIX, command, filename, strerror (errno)); free (filename); return; } else { if (macro_expansion_output_stream && !executing_string) - remember_itext (input_text, input_text_offset); - reader_loop (); + remember_itext (input_text, input_text_offset); + + if (!verbatim_include) + reader_loop (); + else + handle_verbatim_environment (0); } free (filename); popfile (); } +/* Include file as if put in @verbatim environment */ +void +cm_verbatiminclude () +{ + handle_include (1); +} + + +/* Remember this file, and move onto the next. */ +void +cm_include () +{ + handle_include (0); +} + + /* @bye: Signals end of processing. Easy to make this happen. */ void cm_bye () { discard_braces (); /* should not have any unclosed braces left */ flush_output (); input_text_offset = input_text_length; } /* @paragraphindent */ static void cm_paragraphindent () { char *arg; get_rest_of_line (1, &arg); if (set_paragraph_indent (arg) != 0) line_error (_("Bad argument to %c%s"), COMMAND_PREFIX, command); free (arg); } /* @exampleindent: change indentation of example-like environments. */ static int set_default_indentation_increment (string) char *string; { if (strcmp (string, "asis") == 0 || strcmp (string, _("asis")) == 0) ; else if (strcmp (string, "none") == 0 || strcmp (string, _("none")) == 0) default_indentation_increment = 0; else if (sscanf (string, "%d", &default_indentation_increment) != 1) return -1; return 0; } static void cm_exampleindent () { char *arg; get_rest_of_line (1, &arg); if (set_default_indentation_increment (arg) != 0) line_error (_("Bad argument to %c%s"), COMMAND_PREFIX, command); free (arg); } diff --git a/contrib/texinfo/makeinfo/defun.c b/contrib/texinfo/makeinfo/defun.c index c62aba791d37..b261a9918cfb 100644 --- a/contrib/texinfo/makeinfo/defun.c +++ b/contrib/texinfo/makeinfo/defun.c @@ -1,663 +1,720 @@ /* defun.c -- @defun and friends. - $Id: defun.c,v 1.11 1999/07/11 16:50:19 karl Exp $ + $Id: defun.c,v 1.18 2002/01/22 18:01:24 karl Exp $ - Copyright (C) 1998, 99 Free Software Foundation, Inc. + Copyright (C) 1998, 99, 2000, 01, 02 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 "system.h" #include "defun.h" +#include "docbook.h" #include "insertion.h" #include "makeinfo.h" #define DEFUN_SELF_DELIMITING(c) \ ((c) == '(' || (c) == ')' || (c) == '[' || (c) == ']') struct token_accumulator { unsigned int length; unsigned int index; char **tokens; }; static void initialize_token_accumulator (accumulator) struct token_accumulator *accumulator; { accumulator->length = 0; accumulator->index = 0; accumulator->tokens = NULL; } static void accumulate_token (accumulator, token) struct token_accumulator *accumulator; char *token; { if (accumulator->index >= accumulator->length) { accumulator->length += 10; accumulator->tokens = xrealloc (accumulator->tokens, (accumulator->length * sizeof (char *))); } accumulator->tokens[accumulator->index] = token; accumulator->index += 1; } /* Given STRING_POINTER pointing at an open brace, skip forward and return a pointer to just past the matching close brace. */ static int scan_group_in_string (string_pointer) char **string_pointer; { char *scan_string = (*string_pointer) + 1; unsigned int level = 1; for (;;) { int c; if (level == 0) { *string_pointer = scan_string; return 1; } c = *scan_string++; if (c == 0) { /* Tweak line_number to compensate for fact that we gobbled the whole line before coming here. */ line_number -= 1; line_error (_("Missing `}' in @def arg")); line_number += 1; *string_pointer = scan_string - 1; return 0; } if (c == '{') level += 1; if (c == '}') level -= 1; } } /* Return a list of tokens from the contents of STRING. Commands and brace-delimited groups count as single tokens. Contiguous whitespace characters are converted to a token consisting of a single space. */ static char ** args_from_string (string) char *string; { struct token_accumulator accumulator; char *token_start, *token_end; char *scan_string = string; initialize_token_accumulator (&accumulator); while (*scan_string) { /* Replace arbitrary whitespace by a single space. */ if (whitespace (*scan_string)) { scan_string += 1; while (whitespace (*scan_string)) scan_string += 1; accumulate_token ((&accumulator), (xstrdup (" "))); continue; } /* Commands count as single tokens. */ if (*scan_string == COMMAND_PREFIX) { token_start = scan_string; scan_string += 1; if (self_delimiting (*scan_string)) scan_string += 1; else { int c; while (1) { c = *scan_string++; if ((c == 0) || (c == '{') || (whitespace (c))) { scan_string -= 1; break; } } if (*scan_string == '{') { char *s = scan_string; (void) scan_group_in_string (&s); scan_string = s; } } token_end = scan_string; } /* Parentheses and brackets are self-delimiting. */ else if (DEFUN_SELF_DELIMITING (*scan_string)) { token_start = scan_string; scan_string += 1; token_end = scan_string; } /* Open brace introduces a group that is a single token. */ else if (*scan_string == '{') { char *s = scan_string; int balanced = scan_group_in_string (&s); token_start = scan_string + 1; scan_string = s; token_end = balanced ? (scan_string - 1) : scan_string; } /* Otherwise a token is delimited by whitespace, parentheses, brackets, or braces. A token is also ended by a command. */ else { token_start = scan_string; for (;;) { int c; c = *scan_string++; /* Do not back up if we're looking at a }; since the only valid }'s are those matched with {'s, we want to give an error. If we back up, we go into an infinite loop. */ if (!c || whitespace (c) || DEFUN_SELF_DELIMITING (c) || c == '{') { scan_string--; break; } /* If we encounter a command embedded within a token, then end the token. */ if (c == COMMAND_PREFIX) { scan_string--; break; } } token_end = scan_string; } accumulate_token (&accumulator, substring (token_start, token_end)); } accumulate_token (&accumulator, NULL); return accumulator.tokens; } static void process_defun_args (defun_args, auto_var_p) char **defun_args; int auto_var_p; { int pending_space = 0; for (;;) { char *defun_arg = *defun_args++; if (defun_arg == NULL) break; if (defun_arg[0] == ' ') { pending_space = 1; continue; } if (pending_space) { add_char (' '); pending_space = 0; } if (DEFUN_SELF_DELIMITING (defun_arg[0])) add_char (defun_arg[0]); else if (defun_arg[0] == '&') if (html) { defun_arg = escape_string (xstrdup (defun_arg)); add_word (defun_arg); free (defun_arg); } else add_word (defun_arg); else if (defun_arg[0] == COMMAND_PREFIX) execute_string ("%s", defun_arg); else if (auto_var_p) if (html) { defun_arg = escape_string (xstrdup (defun_arg)); add_word (defun_arg); free (defun_arg); } else add_word (defun_arg); else add_word (defun_arg); } } static char * next_nonwhite_defun_arg (arg_pointer) char ***arg_pointer; { char **scan = (*arg_pointer); char *arg = (*scan++); if ((arg != 0) && (*arg == ' ')) arg = *scan++; if (arg == 0) scan -= 1; *arg_pointer = scan; return (arg == 0) ? "" : arg; } /* This is needed also in insertion.c. */ enum insertion_type get_base_type (type) enum insertion_type type; { enum insertion_type base_type; switch (type) { case defivar: base_type = defcv; break; case defmac: base_type = deffn; break; case defmethod: base_type = defop; break; case defopt: base_type = defvr; break; case defspec: base_type = deffn; break; case deftypefun: base_type = deftypefn; break; case deftypeivar: base_type = deftypeivar; break; case deftypemethod: base_type = deftypemethod; break; case deftypeop: base_type = deftypeop; break; case deftypevar: base_type = deftypevr; break; case defun: base_type = deffn; break; case defvar: base_type = defvr; break; default: base_type = type; break; } return base_type; } /* Make the defun type insertion. TYPE says which insertion this is. X_P, if nonzero, says not to start a new insertion. */ static void defun_internal (type, x_p) enum insertion_type type; int x_p; { enum insertion_type base_type; char **defun_args, **scan_args; char *category, *defined_name, *type_name, *type_name2; { char *line; /* The @def.. line is the only place in Texinfo where you are allowed to use unquoted braces that don't delimit arguments of a command or a macro; in any other place it will trigger an error message from the reader loop. The special handling of this case inside `args_from_string' is an extra special hack which allows this. The side effect is that if we try to expand the rest of the line below, the recursive reader loop will signal an error if there are brace-delimited arguments on that line. The best solution to this would be to change the syntax of @def.. commands so that it doesn't violate Texinfo's own rules. But it's probably too late for this now, as it will break a lot of existing manuals. Unfortunately, this means that you can't call macros, use @value, etc. inside @def.. commands, sigh. */ get_rest_of_line (0, &line); defun_args = (args_from_string (line)); free (line); } scan_args = defun_args; /* Get base type and category string. */ base_type = get_base_type (type); /* xx all these const strings should be determined upon documentlanguage argument and NOT via gettext (kama). */ switch (type) { case defun: case deftypefun: category = _("Function"); break; case defmac: category = _("Macro"); break; case defspec: category = _("Special Form"); break; case defvar: case deftypevar: category = _("Variable"); break; case defopt: category = _("User Option"); break; case defivar: case deftypeivar: category = _("Instance Variable"); break; case defmethod: case deftypemethod: category = _("Method"); break; default: category = next_nonwhite_defun_arg (&scan_args); break; } /* The class name. */ if ((base_type == deftypefn) || (base_type == deftypevr) || (base_type == defcv) || (base_type == defop) || (base_type == deftypeivar) || (base_type == deftypemethod) || (base_type == deftypeop) ) type_name = next_nonwhite_defun_arg (&scan_args); /* The type name for typed languages. */ - if (base_type == deftypemethod - || base_type == deftypeivar - || base_type == deftypeop + if ((base_type == deftypemethod) + || (base_type == deftypeivar) + || (base_type == deftypeop) ) type_name2 = next_nonwhite_defun_arg (&scan_args); /* The function or whatever that's actually being defined. */ defined_name = next_nonwhite_defun_arg (&scan_args); /* This hack exists solely for the purposes of formatting the Texinfo manual. I couldn't think of a better way. The token might be a simple @@ followed immediately by more text. If this is the case, then the next defun arg is part of this one, and we should concatenate them. */ if (*scan_args && **scan_args && !whitespace (**scan_args) && STREQ (defined_name, "@@")) { char *tem = xmalloc (3 + strlen (scan_args[0])); sprintf (tem, "@@%s", scan_args[0]); free (scan_args[0]); scan_args[0] = tem; scan_args++; defined_name = tem; } + /* It's easy to write @defun foo(arg1 arg2), but a following ( is + misparsed by texinfo.tex and this is next to impossible to fix. + Warn about it. */ + if (*scan_args && **scan_args && **scan_args == '(') + warning ("`%c' follows defined name `%s' instead of whitespace", + **scan_args, defined_name); + if (!x_p) begin_insertion (type); /* Write the definition header line. This should start at the normal indentation. */ current_indent -= default_indentation_increment; start_paragraph (); - if (html && !x_p) + if (!x_p) { /* Start the definition on new paragraph. */ - add_word ("<p>\n"); + if (html) + add_word ("<p>\n"); + if (docbook) + docbook_begin_paragraph (); + } - if (!html) + if (!html && !docbook) switch (base_type) { case deffn: case defvr: case deftp: execute_string (" -- %s: %s", category, defined_name); break; case deftypefn: case deftypevr: execute_string (" -- %s: %s %s", category, type_name, defined_name); break; case defcv: execute_string (" -- %s %s %s: %s", category, _("of"), type_name, defined_name); break; case deftypeivar: execute_string (" -- %s %s %s: %s %s", category, _("of"), type_name, type_name2, defined_name); break; case defop: execute_string (" -- %s %s %s: %s", category, _("on"), type_name, defined_name); break; case deftypeop: execute_string (" -- %s %s %s: %s %s", category, _("on"), type_name, type_name2, defined_name); break; case deftypemethod: execute_string (" -- %s %s %s: %s %s", category, _("on"), type_name, type_name2, defined_name); break; } if (html) { /* If this is not a @def...x version, it could only be a normal version @def.... So start the table here. */ if (!x_p) - add_word ("<table width=\"100%\">\n"); + { + add_html_elt ("<table width="); + add_word ("\"100%\">\n"); + } /* If this is an @def...x there has to be an other @def... before it, so this is only a new row within an existing table. With two complete standalone tables the gap between them is too big. */ add_word ("<tr>\n"); - add_word ("<td align=\"left\">"); + add_html_elt ("<td align=\"left\">"); switch (base_type) { case deffn: case defvr: case deftp: /* <i> is for the following function arguments. */ - add_word_args ("<b>%s</b><i>", defined_name); + add_word ("<b>"); + execute_string ("%s", defined_name); + add_word ("</b><i>"); break; case deftypefn: case deftypevr: - add_word_args ("%s <b>%s</b><i>", type_name, defined_name); + execute_string ("%s ", type_name); + add_word ("<b>"); + execute_string ("%s", defined_name); + add_word ("</b><i>"); break; case defcv: case defop: - add_word_args ("<b>%s</b><i>", defined_name); + add_word ("<b>"); + execute_string ("%s", defined_name); + add_word ("</b><i>"); break; case deftypemethod: case deftypeop: case deftypeivar: - add_word_args ("%s <b>%s</b><i>", type_name2, defined_name); + execute_string ("%s ", type_name2); + add_word ("<b>"); + execute_string ("%s", defined_name); + add_word ("</b><i>"); break; } } /* if (html)... */ + if (docbook) + { + switch (base_type) + { + case deffn: + case defvr: + case deftp: + case defcv: + case defop: + add_word_args ("<%s>%s</%s>", DB_FUNCTION, defined_name, + DB_FUNCTION); + break; + case deftypefn: + case deftypevr: + add_word_args ("%s <%s>%s</%s>", type_name, DB_FUNCTION, + defined_name, DB_FUNCTION); + break; + case deftypemethod: + case deftypeop: + case deftypeivar: + add_word_args ("%s <%s>%s</%s>", type_name2, DB_FUNCTION, + defined_name, DB_FUNCTION); + break; + } + + } /* if (docbook)... */ + current_indent += default_indentation_increment; /* Now process the function arguments, if any. If these carry onto the next line, they should be indented by two increments to distinguish them from the body of the definition, which is indented by one increment. */ current_indent += default_indentation_increment; switch (base_type) { case deffn: case defop: process_defun_args (scan_args, 1); break; /* Through Makeinfo 1.67 we processed remaining args only for deftp, deftypefn, and deftypemethod. But the libc manual, for example, needs to say: @deftypevar {char *} tzname[2] And simply allowing the extra text seems far simpler than trying to invent yet more defn commands. In any case, we should either output it or give an error, not silently ignore it. */ default: process_defun_args (scan_args, 0); break; } current_indent -= default_indentation_increment; close_single_paragraph (); if (html) { /* xx The single words (on, off) used here, should depend on documentlanguage and NOT on gettext --kama. */ switch (base_type) { case deffn: case defvr: case deftp: case deftypefn: case deftypevr: add_word ("</i>"); /* close italic area for arguments */ /* put the rest into the second column */ - add_word_args ("</td>\n<td align=\"right\">%s", category); + add_word ("</td>\n"); + add_html_elt ("<td align=\"right\">"); + execute_string ("%s", category); break; - - case defcv: - add_word ("</td>\n<td align=\"right\">"); - add_word_args ("%s %s %s", category, _("of"), type_name); - break; - - case defop: - case deftypemethod: - case deftypeop: - add_word ("</i>"); - add_word ("</td>\n<td align=\"right\">"); - add_word_args ("%s %s %s", category, _("on"), type_name); - break; - - case deftypeivar: - add_word ("</i>"); - add_word ("</td>\n<td align=\"right\">"); - add_word_args ("%s %s %s", category, _("of"), type_name); - break; - } /* switch (base_type)... */ - + + case defcv: + add_word ("</td>\n"); + add_html_elt ("<td align=\"right\">"); + execute_string ("%s %s %s", category, _("of"), type_name); + break; + + case defop: + case deftypemethod: + case deftypeop: + add_word ("</i>"); + add_word ("</td>\n"); + add_html_elt ("<td align=\"right\">"); + execute_string ("%s %s %s", category, _("on"), type_name); + break; + + case deftypeivar: + add_word ("</i>"); + add_word ("</td>\n"); + add_html_elt ("<td align=\"right\">"); + execute_string ("%s %s %s", category, _("of"), type_name); + break; + } /* switch (base_type)... */ + add_word ("</td>\n"); /* close second column */ add_word ("</tr>\n"); /* close row */ - + /* This is needed because I have to know if the next line is normal text or another @def..x. If text follows, create a new table to get the indentation for the following text. This construction would fail if someone uses: @deffn @sp 2 @deffnx . @end deffn But we don't care. */ if (!looking_at ("@def")) { add_word ("</table>\n"); - add_word ("<table width=\"95%\" align=\"center\">\n"); - add_word ("<tr><td>\n"); + add_html_elt ("<table width=\"95%\" align=\"center\">"); + add_word ("\n<tr><td>\n"); } - + } /* if (html)... */ /* Make an entry in the appropriate index. */ switch (base_type) { case deffn: case deftypefn: execute_string ("@findex %s\n", defined_name); break; case defvr: case deftypevr: case defcv: execute_string ("@vindex %s\n", defined_name); break; case deftypeivar: execute_string ("@vindex %s %s %s\n", defined_name, _("of"), type_name); break; case defop: case deftypeop: case deftypemethod: execute_string ("@findex %s %s %s\n", defined_name, _("on"), type_name); break; case deftp: execute_string ("@tindex %s\n", defined_name); break; } /* Deallocate the token list. */ scan_args = defun_args; while (1) { char * arg = (*scan_args++); if (arg == NULL) break; free (arg); } free (defun_args); } /* Add an entry for a function, macro, special form, variable, or option. If the name of the calling command ends in `x', then this is an extra entry included in the body of an insertion of the same type. */ void cm_defun () { int x_p; enum insertion_type type; char *temp = xstrdup (command); x_p = (command[strlen (command) - 1] == 'x'); if (x_p) temp[strlen (temp) - 1] = 0; type = find_type_from_name (temp); free (temp); /* If we are adding to an already existing insertion, then make sure that we are already in an insertion of type TYPE. */ if (x_p && (!insertion_level || insertion_stack->insertion != type)) { line_error (_("Must be in `%s' insertion to use `%sx'"), command, command); discard_until ("\n"); return; } defun_internal (type, x_p); } diff --git a/contrib/texinfo/makeinfo/docbook.c b/contrib/texinfo/makeinfo/docbook.c new file mode 100644 index 000000000000..c9b05c2d8f85 --- /dev/null +++ b/contrib/texinfo/makeinfo/docbook.c @@ -0,0 +1,492 @@ +/* docbook.c -- docbook output. + $Id: docbook.c,v 1.3 2001/12/31 16:52:17 karl Exp $ + + Copyright (C) 2001 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 "system.h" +#include "cmds.h" +#include "docbook.h" +#include "insertion.h" +#include "lang.h" +#include "makeinfo.h" +#include "macro.h" +#include "sectioning.h" + +int docbook_version_inserted = 0; +int docbook_first_chapter_found = 0; +int docbook_must_insert_node_anchor = 0; +int docbook_begin_book_p = 0; +int docbook_no_new_paragraph = 0; + +static int section_level = -1; +static int in_docbook_paragraph = 0; +static int in_list = 0; + +static int in_table = 0; +static int in_term = 0; +static int in_entry = 0; +static int in_varlistitem = 0; + +static int in_example = 0; + +void +docbook_begin_section (level, cmd) + int level; + char *cmd; +{ + int i, old_no_indent; + char *temp, *tem; + static char *last_chap = NULL; + + close_paragraph (); + docbook_first_chapter_found = 1; + filling_enabled = indented_fill = 0; + old_no_indent = no_indent; + no_indent = 1; + + if (!docbook_begin_book_p) + docbook_begin_book (); + + if (macro_expansion_output_stream && !executing_string) + append_to_expansion_output (input_text_offset + 1); + + get_rest_of_line (0, &temp); + + if (in_docbook_paragraph) + { + insert_string ("\n</para>\n\n"); + adjust_braces_following (0, 10); + } + in_docbook_paragraph = 0; + docbook_no_new_paragraph++; + + if (level > section_level + 1) + level = section_level + 1; + + for (i = section_level; i >= level ; i--) + { + if (i == 0) + { + if (last_chap && strcmp(last_chap, "appendix") == 0) + add_word ("</appendix>\n\n"); + else + add_word ("</chapter>\n\n"); + } + else + add_word_args ("</sect%d>\n\n", i); + } + + section_level = level; + + if (level == 0) + { + if (strcmp(cmd, "appendix") == 0) + add_word ("<appendix"); + else + add_word ("<chapter"); + last_chap = cmd; + } + else + add_word_args ("<sect%d", level); + + if (docbook_must_insert_node_anchor) + { + add_word (" id=\""); + tem = expansion (current_node, 0); + add_escaped_anchor_name (tem, 0); + free (tem); + add_word ("\""); + docbook_must_insert_node_anchor = 0; + } + add_word (">\n"); + add_word ("<title>"); + + if (macro_expansion_output_stream && !executing_string) + { + char *temp1 = xmalloc (2 + strlen (temp)); + sprintf (temp1, "%s", temp); + remember_itext (input_text, input_text_offset); + me_execute_string (temp1); + free (temp1); + } + else + execute_string ("%s", temp); + + free (temp); + + add_word ("\n"); + + close_paragraph (); + filling_enabled = 1; + no_indent = old_no_indent; + docbook_no_new_paragraph--; + insert_string("\n"); + in_docbook_paragraph = 1; +} + +void +docbook_begin_paragraph () +{ + if (!docbook_first_chapter_found) + return; + + if (in_example) + return; + + if (in_table && !in_term) + { + if (!in_varlistitem) + insert_string ("\n\n"); + else + insert_string ("\n\n\n\n"); + in_varlistitem = 1; + + return; + } + if (in_list) + return; + if (in_docbook_paragraph) + { + insert_string ("\n\n\n"); + adjust_braces_following (0, 10); + } + +#if 0 + if (docbook_must_insert_node_anchor) + { + char *tem; + insert_string ("\n"); + docbook_must_insert_node_anchor = 0; + } + else +#endif + { + insert_string ("\n"); + adjust_braces_following (0, 7); + } + in_docbook_paragraph = 1; +} + +void +docbook_begin_book () +{ + if (!docbook_begin_book_p) + docbook_begin_book_p = 1; + else + return; + + ++docbook_no_new_paragraph; + add_word_args ("\n\ +\n%s\n", title); + --docbook_no_new_paragraph; +} + +void +docbook_end_book () +{ + int i; + if (in_docbook_paragraph) + { + insert_string ("\n\n\n"); + } + + for (i = section_level; i >= 0 ; i--) + { + if (i == 0) + add_word ("\n"); + else + add_word_args ("\n", i); + } + + add_word ("\n"); +} + +void +docbook_insert_tag (start_or_end, tag) + int start_or_end; + char *tag; +{ + if (!paragraph_is_open && start_or_end == START) + docbook_begin_paragraph (); + + add_char ('<'); + if (start_or_end == START) + add_word (tag); + else + { + add_char ('/'); + for (; *tag && *tag != ' '; tag++) + add_char(*tag); + } + add_meta_char ('>'); +} + +void +docbook_xref1 (node_name) + char *node_name; +{ + char *tem; + add_word (""); +} + +void +docbook_xref2 (node_name, ref_name) + char *node_name; + char *ref_name; +{ + char *tem; + add_word (""); +} + +int +docbook_quote (character) + int character; +{ + switch (language_code) + { + case fr: + if (character == '`') + { + add_word ("Ğ "); + return ';'; + } + else + { + add_word (" "); + return 'ğ'; + } + break; + + default: + if (character == '`') + { + add_word ("&ldquo"); + return ';'; + } + else + { + add_word ("&rdquo"); + return ';'; + } + break; + } +} + +#define IS_BLANK(c) (c == ' ' || c == '\t' || c == '\n') + +int +docbook_is_punctuation (character, next) + int character; + int next; +{ + return ( (character == ';' + || character == ':' + || character == '?' + || character == '!') + && IS_BLANK (next)); +} + +void +docbook_punctuation (character) + int character; +{ + switch (language_code) + { + case fr: + while (output_paragraph[output_paragraph_offset-1] == ' ') + output_paragraph_offset--; + add_word (" "); + break; + } +} + +static int in_item = 0; + +void +docbook_begin_itemize () +{ + if (in_docbook_paragraph) + insert_string ("\n\n"); + + in_docbook_paragraph = 0; + insert_string ("\n\n"); + in_item = 0; + in_list = 1; +} + +void +docbook_end_itemize () +{ + if (in_item) + { + insert_string ("\n\n"); + in_item = 0; + } + insert_string ("\n\n\n\n"); + in_docbook_paragraph = 1; + in_list = 0; +} + +void +docbook_begin_enumerate () +{ + if (in_docbook_paragraph) + insert_string ("\n\n"); + in_docbook_paragraph = 0; + insert_string ("\n\n"); + in_item = 0; + in_list = 1; +} + +void +docbook_end_enumerate () +{ + if (in_item) + { + insert_string ("\n\n"); + in_item = 0; + } + insert_string ("\n\n\n\n"); + in_docbook_paragraph = 1; + in_list = 0; +} + +void +docbook_begin_table () +{ +#if 0 + if (in_docbook_paragraph) + insert_string ("\n\n\n"); + in_docbook_paragraph = 0; +#endif + + add_word ("\n\n"); + in_table ++; + in_varlistitem = 0; + in_entry = 0; +} + +void +docbook_end_table () +{ + if (!in_varlistitem) + docbook_begin_paragraph (); + insert_string ("\n\n\n\n\n"); +#if 0 + if (in_table == 1) + { + insert_string ("\n\n\n"); + in_docbook_paragraph = 0; + } + else + { + insert_string ("\n\n\n"); + in_docbook_paragraph = 1; + } +#endif + in_table --; + in_list = 0; +} + +void +docbook_add_item () +{ + if (in_item) + insert_string ("\n\n"); + insert_string ("\n\n"); + in_docbook_paragraph = 1; + in_item = 1; +} + +void +docbook_add_table_item () +{ + if (in_varlistitem) + { + insert_string ("\n\n\n\n"); + in_entry = 0; + in_varlistitem = 0; + } + if (!in_entry) + { + insert_string ("\n"); + in_entry = 1; + } + insert_string (""); + in_list = 1; + in_term = 1; +} + +void +docbook_close_table_item () +{ + insert_string (""); + in_list = 1; + in_term = 0; +} + +void +docbook_add_anchor (anchor) + char *anchor; +{ + add_word (""); +} + +void +docbook_footnote (note) + char *note; +{ + /* add_word_args ("\n%s\n\n", note); */ + add_word ("\n"); + execute_string("%s", note); + add_word("\n\n"); +} + +void +docbook_begin_index () +{ + add_word ("\n"); +} + +void +docbook_begin_example () +{ + add_word ("\n\n\n"); + in_example = 1; +} + +void +docbook_end_example () +{ + in_example = 0; + add_word ("\n\n"); +} diff --git a/contrib/texinfo/makeinfo/docbook.h b/contrib/texinfo/makeinfo/docbook.h new file mode 100644 index 000000000000..6f0ca49c6af1 --- /dev/null +++ b/contrib/texinfo/makeinfo/docbook.h @@ -0,0 +1,81 @@ +/* docbook.h -- docbook declarations. + $Id: docbook.h,v 1.2 2001/12/31 16:51:32 karl Exp $ + + Copyright (C) 2001 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. */ + +#ifndef DOCBOOK_H +#define DOCBOOK_H + +#define DB_B "emphasis role=\"bold\"" +#define DB_CITE "citetitle" +#define DB_CODE "literal" +#define DB_COMMAND "command" +#define DB_DFN "firstterm" +#define DB_EMPH "emphasis" +#define DB_ENV "envar" +#define DB_FILE "filename" +#define DB_FUNCTION "function" +#define DB_I "emphasis" +#define DB_KBD "userinput" +#define DB_KEY "keycap" +#define DB_OPTION "option" +#define DB_STRONG "emphasis role=\"bold\"" +#define DB_TT "literal" +#define DB_URL "systemitem role=\"sitename\"" +#define DB_VAR "replaceable" + +extern int docbook_version_inserted; +extern int docbook_begin_book_p; +extern int docbook_first_chapter_found; +extern int docbook_must_insert_node_anchor; +extern int docbook_no_new_paragraph; + +void docbook_begin_section (); +void docbook_begin_paragraph (); +void docbook_begin_book (); +void docbook_end_book (); + +void docbook_insert_tag (); + +void docbook_xref1 (); +void docbook_xref2 (); + +int docbook_quote (); + +int docbook_is_punctuation (); +void docbook_punctuation (); + +void docbook_begin_itemize (); +void docbook_end_itemize (); +void docbook_begin_enumerate (); +void docbook_end_enumerate (); + +void docbook_begin_table (); +void docbook_end_table (); +void docbook_add_item (); +void docbook_add_table_item (); +void docbook_close_table_item (); +void docbook_add_anchor (); + +void docbook_footnote (); + +void docbook_begin_index (); + +void docbook_begin_example (); +void docbook_end_example (); + +#endif /* DOCBOOK_H */ diff --git a/contrib/texinfo/makeinfo/files.c b/contrib/texinfo/makeinfo/files.c index ce8ace014de3..83c00e1b2866 100644 --- a/contrib/texinfo/makeinfo/files.c +++ b/contrib/texinfo/makeinfo/files.c @@ -1,529 +1,576 @@ -/* files.c -- file-related functions for Texinfo. - $Id: files.c,v 1.5 1999/03/23 21:42:44 karl Exp $ +/* files.c -- file-related functions for makeinfo. + $Id: files.c,v 1.10 2002/01/16 15:52:45 karl Exp $ - Copyright (C) 1998, 99 Free Software Foundation, Inc. + Copyright (C) 1998, 99, 2000, 01, 02 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 "system.h" #include "files.h" #include "macro.h" #include "makeinfo.h" FSTACK *filestack = NULL; static int node_filename_stack_index = 0; static int node_filename_stack_size = 0; static char **node_filename_stack = NULL; /* Looking for include files. */ /* Given a string containing units of information separated by colons, return the next one pointed to by INDEX, or NULL if there are no more. Advance INDEX to the character after the colon. */ static char * extract_colon_unit (string, index) char *string; int *index; { int start; int path_sep_char = PATH_SEP[0]; int i = *index; if (!string || (i >= strlen (string))) return NULL; /* Each call to this routine leaves the index pointing at a colon if there is more to the path. If i > 0, then increment past the `:'. If i == 0, then the path has a leading colon. Trailing colons are handled OK by the `else' part of the if statement; an empty string is returned in that case. */ if (i && string[i] == path_sep_char) i++; start = i; while (string[i] && string[i] != path_sep_char) i++; *index = i; if (i == start) { if (string[i]) (*index)++; /* Return "" in the case of a trailing `:'. */ return xstrdup (""); } else { char *value; value = xmalloc (1 + (i - start)); memcpy (value, &string[start], (i - start)); value [i - start] = 0; return value; } } /* Return the full pathname for FILENAME by searching along PATH. When found, return the stat () info for FILENAME in FINFO. If PATH is NULL, only the current directory is searched. If the file could not be found, return a NULL pointer. */ static char * get_file_info_in_path (filename, path, finfo) char *filename, *path; struct stat *finfo; { char *dir; int result, index = 0; if (path == NULL) path = "."; /* Handle absolute pathnames. */ if (IS_ABSOLUTE (filename) || (*filename == '.' && (IS_SLASH (filename[1]) || (filename[1] == '.' && IS_SLASH (filename[2]))))) { if (stat (filename, finfo) == 0) return xstrdup (filename); else return NULL; } while ((dir = extract_colon_unit (path, &index))) { char *fullpath; if (!*dir) { free (dir); dir = xstrdup ("."); } fullpath = xmalloc (2 + strlen (dir) + strlen (filename)); sprintf (fullpath, "%s/%s", dir, filename); free (dir); result = stat (fullpath, finfo); if (result == 0) return fullpath; else free (fullpath); } return NULL; } /* Find and load the file named FILENAME. Return a pointer to the loaded file, or NULL if it can't be loaded. */ char * find_and_load (filename) char *filename; { struct stat fileinfo; long file_size; int file = -1, count = 0; char *fullpath, *result; -#if O_BINARY || defined (VMS) - int n; -#endif + int n, bytes_to_read; result = fullpath = NULL; fullpath = get_file_info_in_path (filename, include_files_path, &fileinfo); if (!fullpath) goto error_exit; filename = fullpath; file_size = (long) fileinfo.st_size; file = open (filename, O_RDONLY); if (file < 0) goto error_exit; /* Load the file, with enough room for a newline and a null. */ result = xmalloc (file_size + 2); /* VMS stat lies about the st_size value. The actual number of readable bytes is always less than this value. The arcane mysteries of VMS/RMS are too much to probe, so this hack - suffices to make things work. */ -#if O_BINARY || defined (VMS) -#ifdef VMS - while ((n = read (file, result + count, file_size)) > 0) -#else /* !VMS */ -#ifndef WIN32 - while ((n = read (file, result + count, file_size)) > 0) -#else /* WIN32 */ - /* Does WIN32 really need reading 1 character at a time?? */ - while ((n = read (file, result + count, 1)) > 0) -#endif /* WIN32 */ -#endif /* !VMS */ - count += n; + suffices to make things work. It's also needed on Cygwin. And so + we might as well use it everywhere. */ + bytes_to_read = file_size; + while ((n = read (file, result + count, bytes_to_read)) > 0) + { + count += n; + bytes_to_read -= n; + } if (0 < count && count < file_size) result = xrealloc (result, count + 2); /* why waste the slack? */ else if (n == -1) -#else /* !VMS && !O_BINARY */ - count = file_size; - if (read (file, result, file_size) != file_size) -#endif /* !VMS && !WIN32 */ - - error_exit: +error_exit: { if (result) free (result); if (fullpath) free (fullpath); if (file != -1) close (file); return NULL; } close (file); /* Set the globals to the new file. */ input_text = result; input_text_length = count; input_filename = fullpath; node_filename = xstrdup (fullpath); input_text_offset = 0; line_number = 1; /* Not strictly necessary. This magic prevents read_token () from doing extra unnecessary work each time it is called (that is a lot of times). INPUT_TEXT_LENGTH is one past the actual end of the text. */ input_text[input_text_length] = '\n'; /* This, on the other hand, is always necessary. */ input_text[input_text_length+1] = 0; return result; } /* Pushing and popping files. */ void push_node_filename () { if (node_filename_stack_index + 1 > node_filename_stack_size) node_filename_stack = xrealloc (node_filename_stack, (node_filename_stack_size += 10) * sizeof (char *)); node_filename_stack[node_filename_stack_index] = node_filename; node_filename_stack_index++; } void pop_node_filename () { node_filename = node_filename_stack[--node_filename_stack_index]; } /* Save the state of the current input file. */ void pushfile () { FSTACK *newstack = xmalloc (sizeof (FSTACK)); newstack->filename = input_filename; newstack->text = input_text; newstack->size = input_text_length; newstack->offset = input_text_offset; newstack->line_number = line_number; newstack->next = filestack; filestack = newstack; push_node_filename (); } /* Make the current file globals be what is on top of the file stack. */ void popfile () { FSTACK *tos = filestack; if (!tos) abort (); /* My fault. I wonder what I did? */ if (macro_expansion_output_stream) { maybe_write_itext (input_text, input_text_offset); forget_itext (input_text); } /* Pop the stack. */ filestack = filestack->next; /* Make sure that commands with braces have been satisfied. */ if (!executing_string && !me_executing_string) discard_braces (); /* Get the top of the stack into the globals. */ input_filename = tos->filename; input_text = tos->text; input_text_length = tos->size; input_text_offset = tos->offset; line_number = tos->line_number; free (tos); /* Go back to the (now) current node. */ pop_node_filename (); } /* Flush all open files on the file stack. */ void flush_file_stack () { while (filestack) { char *fname = input_filename; char *text = input_text; popfile (); free (fname); free (text); } } /* Return the index of the first character in the filename which is past all the leading directory characters. */ static int skip_directory_part (filename) char *filename; { int i = strlen (filename) - 1; while (i && !IS_SLASH (filename[i])) i--; if (IS_SLASH (filename[i])) i++; else if (filename[i] && HAVE_DRIVE (filename)) i = 2; return i; } char * filename_non_directory (name) char *name; { return xstrdup (name + skip_directory_part (name)); } /* Return just the simple part of the filename; i.e. the filename without the path information, or extensions. This conses up a new string. */ char * filename_part (filename) char *filename; { char *basename = filename_non_directory (filename); #ifdef REMOVE_OUTPUT_EXTENSIONS /* See if there is an extension to remove. If so, remove it. */ { char *temp; temp = strrchr (basename, '.'); if (temp) *temp = 0; } #endif /* REMOVE_OUTPUT_EXTENSIONS */ return basename; } /* Return the pathname part of filename. This can be NULL. */ char * pathname_part (filename) char *filename; { char *expand_filename (); char *result = NULL; int i; filename = expand_filename (filename, ""); i = skip_directory_part (filename); if (i) { result = xmalloc (1 + i); strncpy (result, filename, i); result[i] = 0; } free (filename); return result; } /* Return the expansion of FILENAME. */ char * expand_filename (filename, input_name) char *filename, *input_name; { int i; char *full_pathname (); if (filename) { filename = full_pathname (filename); if (IS_ABSOLUTE (filename) || (*filename == '.' && (IS_SLASH (filename[1]) || (filename[1] == '.' && IS_SLASH (filename[2]))))) return filename; } else { filename = filename_non_directory (input_name); if (!*filename) { free (filename); filename = xstrdup ("noname.texi"); } for (i = strlen (filename) - 1; i; i--) if (filename[i] == '.') break; if (!i) i = strlen (filename); if (i + 6 > (strlen (filename))) filename = xrealloc (filename, i + 6); strcpy (filename + i, html ? ".html" : ".info"); return filename; } if (IS_ABSOLUTE (input_name)) { /* Make it so that relative names work. */ char *result; i = strlen (input_name) - 1; result = xmalloc (1 + strlen (input_name) + strlen (filename)); strcpy (result, input_name); while (!IS_SLASH (result[i]) && i) i--; if (IS_SLASH (result[i])) i++; strcpy (&result[i], filename); free (filename); return result; } return filename; } /* Return the full path to FILENAME. */ char * full_pathname (filename) char *filename; { int initial_character; char *result; /* No filename given? */ if (!filename || !*filename) return xstrdup (""); /* Already absolute? */ if (IS_ABSOLUTE (filename) || (*filename == '.' && (IS_SLASH (filename[1]) || (filename[1] == '.' && IS_SLASH (filename[2]))))) return xstrdup (filename); initial_character = *filename; if (initial_character != '~') { char *localdir = xmalloc (1025); #ifdef HAVE_GETCWD if (!getcwd (localdir, 1024)) #else if (!getwd (localdir)) #endif { fprintf (stderr, _("%s: getwd: %s, %s\n"), progname, filename, localdir); xexit (1); } strcat (localdir, "/"); strcat (localdir, filename); result = xstrdup (localdir); free (localdir); } else { /* Does anybody know why WIN32 doesn't want to support $HOME? If the reason is they don't have getpwnam, they should only disable the else clause below. */ #ifndef WIN32 if (IS_SLASH (filename[1])) { /* Return the concatenation of the environment variable HOME and the rest of the string. */ char *temp_home; temp_home = (char *) getenv ("HOME"); result = xmalloc (strlen (&filename[1]) + 1 + temp_home ? strlen (temp_home) : 0); *result = 0; if (temp_home) strcpy (result, temp_home); strcat (result, &filename[1]); } else { struct passwd *user_entry; int i, c; char *username = xmalloc (257); for (i = 1; (c = filename[i]); i++) { if (IS_SLASH (c)) break; else username[i - 1] = c; } if (c) username[i - 1] = 0; user_entry = getpwnam (username); if (!user_entry) return xstrdup (filename); result = xmalloc (1 + strlen (user_entry->pw_dir) + strlen (&filename[i])); strcpy (result, user_entry->pw_dir); strcat (result, &filename[i]); } #endif /* not WIN32 */ } return result; } char * output_name_from_input_name (name) char *name; { return expand_filename (NULL, name); } + + +/* Modify the file name FNAME so that it fits the limitations of the + underlying filesystem. In particular, truncate the file name as it + would be truncated by the filesystem. We assume the result can + never be longer than the original, otherwise we couldn't be sure we + have enough space in the original string to modify it in place. */ +char * +normalize_filename (fname) + char *fname; +{ + int maxlen; + char orig[PATH_MAX + 1]; + int i; + char *lastdot, *p; + +#ifdef _PC_NAME_MAX + maxlen = pathconf (fname, _PC_NAME_MAX); + if (maxlen < 1) +#endif + maxlen = PATH_MAX; + + i = skip_directory_part (fname); + if (fname[i] == '\0') + return fname; /* only a directory name -- don't modify */ + strcpy (orig, fname + i); + + switch (maxlen) + { + case 12: /* MS-DOS 8+3 filesystem */ + if (orig[0] == '.') /* leading dots are not allowed */ + orig[0] = '_'; + lastdot = strrchr (orig, '.'); + if (!lastdot) + lastdot = orig + strlen (orig); + strncpy (fname + i, orig, lastdot - orig); + for (p = fname + i; + p < fname + i + (lastdot - orig) && p < fname + i + 8; + p++) + if (*p == '.') + *p = '_'; + *p = '\0'; + if (*lastdot == '.') + strncat (fname + i, lastdot, 4); + break; + case 14: /* old Unix systems with 14-char limitation */ + strcpy (fname + i, orig); + if (strlen (fname + i) > 14) + fname[i + 14] = '\0'; + break; + default: + strcpy (fname + i, orig); + if (strlen (fname) > maxlen - 1) + fname[maxlen - 1] = '\0'; + break; + } + + return fname; +} diff --git a/contrib/texinfo/makeinfo/files.h b/contrib/texinfo/makeinfo/files.h index d96c444f2a85..88ae209801a8 100644 --- a/contrib/texinfo/makeinfo/files.h +++ b/contrib/texinfo/makeinfo/files.h @@ -1,45 +1,46 @@ /* files.h -- declarations for files.c. - $Id: files.h,v 1.1 1998/10/24 21:37:25 karl Exp $ + $Id: files.h,v 1.2 2002/01/16 15:52:45 karl Exp $ - Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 1998, 2002 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. */ #ifndef FILES_H #define FILES_H /* A stack of file information records. If a new file is read in with "@input", we remember the old input file state on this stack. */ typedef struct fstack { struct fstack *next; char *filename; char *text; int size; int offset; int line_number; } FSTACK; extern FSTACK *filestack; extern void pushfile (), popfile (); extern void flush_file_stack (); extern char *find_and_load (); extern char *output_name_from_input_name (); extern char *expand_filename (); extern char *filename_part (); extern char *pathname_part (); +extern char *normalize_filename (); #endif /* !FILES_H */ diff --git a/contrib/texinfo/makeinfo/footnote.c b/contrib/texinfo/makeinfo/footnote.c index c1a056d6e32c..d9f2525c1761 100644 --- a/contrib/texinfo/makeinfo/footnote.c +++ b/contrib/texinfo/makeinfo/footnote.c @@ -1,359 +1,381 @@ /* footnote.c -- footnotes for Texinfo. - $Id: footnote.c,v 1.10 1999/09/20 12:20:52 karl Exp $ + $Id: footnote.c,v 1.13 2002/03/02 15:05:21 karl Exp $ - Copyright (C) 1998, 99 Free Software Foundation, Inc. + Copyright (C) 1998, 99, 2002 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 "system.h" #include "footnote.h" #include "macro.h" #include "makeinfo.h" +#include "xml.h" /* Nonzero means that the footnote style for this document was set on the command line, which overrides any other settings. */ int footnote_style_preset = 0; /* The current footnote number in this node. Each time a new node is started this is reset to 1. */ int current_footnote_number = 1; /* Nonzero means we automatically number footnotes with no specified marker. */ int number_footnotes = 1; /* Nonzero means we are currently outputting footnotes. */ int already_outputting_pending_notes = 0; /* Footnotes can be handled in one of two ways: separate_node: Make them look like followed references, with the reference destinations in a makeinfo manufactured node or, end_node: Make them appear at the bottom of the node that they originally appeared in. */ #define separate_node 0 #define end_node 1 int footnote_style = end_node; int first_footnote_this_node = 1; int footnote_count = 0; /* Set the footnote style based on the style identifier in STRING. */ int set_footnote_style (string) char *string; { if (strcasecmp (string, "separate") == 0) footnote_style = separate_node; else if (strcasecmp (string, "end") == 0) footnote_style = end_node; else return -1; return 0; } void cm_footnotestyle () { char *arg; get_rest_of_line (1, &arg); /* If set on command line, do not change the footnote style. */ if (!footnote_style_preset && set_footnote_style (arg) != 0) line_error (_("Bad argument to %c%s"), COMMAND_PREFIX, command); free (arg); } typedef struct fn { struct fn *next; char *marker; char *note; int number; } FN; FN *pending_notes = NULL; /* A method for remembering footnotes. Note that this list gets output at the end of the current node. */ void remember_note (marker, note) char *marker, *note; { FN *temp = xmalloc (sizeof (FN)); temp->marker = xstrdup (marker); temp->note = xstrdup (note); temp->next = pending_notes; temp->number = current_footnote_number; pending_notes = temp; footnote_count++; } /* How to get rid of existing footnotes. */ static void free_pending_notes () { FN *temp; while ((temp = pending_notes)) { free (temp->marker); free (temp->note); pending_notes = pending_notes->next; free (temp); } first_footnote_this_node = 1; footnote_count = 0; current_footnote_number = 1; /* for html */ } /* What to do when you see a @footnote construct. */ /* Handle a "footnote". footnote *{this is a footnote} where "*" is the (optional) marker character for this note. */ void cm_footnote () { char *marker; char *note; get_until ("{", &marker); canon_white (marker); if (macro_expansion_output_stream && !executing_string) append_to_expansion_output (input_text_offset + 1); /* include the { */ /* Read the argument in braces. */ if (curchar () != '{') { line_error (_("`%c%s' needs an argument `{...}', not just `%s'"), COMMAND_PREFIX, command, marker); free (marker); return; } else { int len; int braces = 1; int loc = ++input_text_offset; while (braces) { if (loc == input_text_length) { line_error (_("No closing brace for footnote `%s'"), marker); return; } if (input_text[loc] == '{') braces++; else if (input_text[loc] == '}') braces--; else if (input_text[loc] == '\n') line_number++; loc++; } len = (loc - input_text_offset) - 1; note = xmalloc (len + 1); memcpy (note, &input_text[input_text_offset], len); note[len] = 0; input_text_offset = loc; } /* Must write the macro-expanded argument to the macro expansion output stream. This is like the case in index_add_arg. */ if (macro_expansion_output_stream && !executing_string) { /* Calling me_execute_string on a lone } provokes an error, since as far as the reader knows there is no matching {. We wrote the { above in the call to append_to_expansion_output. */ me_execute_string_keep_state (note, "}"); } if (!current_node || !*current_node) { line_error (_("Footnote defined without parent node")); free (marker); free (note); return; } + /* output_pending_notes is non-reentrant (it uses a global data + structure pending_notes, which it frees before it returns), and + TeX doesn't grok footnotes inside footnotes anyway. Disallow + that. */ + if (already_outputting_pending_notes) + { + line_error (_("Footnotes inside footnotes are not allowed")); + free (marker); + free (note); + return; + } + if (!*marker) { free (marker); if (number_footnotes) { marker = xmalloc (10); sprintf (marker, "%d", current_footnote_number); } else marker = xstrdup ("*"); } + if (xml) + xml_insert_footnote (note); + else + { remember_note (marker, note); /* fixme: html: footnote processing needs work; we currently ignore the style requested; we could clash with a node name of the form `fn-', though that's unlikely. */ if (html) - add_word_args ("%s", - current_footnote_number, marker); + { + add_html_elt ("%s", + current_footnote_number, marker); + } else /* Your method should at least insert MARKER. */ switch (footnote_style) { case separate_node: add_word_args ("(%s)", marker); execute_string (" (*note %s-Footnote-%d::)", current_node, current_footnote_number); if (first_footnote_this_node) { char *temp_string, *expanded_ref; temp_string = xmalloc (strlen (current_node) + strlen ("-Footnotes") + 1); strcpy (temp_string, current_node); strcat (temp_string, "-Footnotes"); expanded_ref = expansion (temp_string, 0); remember_node_reference (expanded_ref, line_number, followed_reference); free (temp_string); free (expanded_ref); first_footnote_this_node = 0; } break; case end_node: add_word_args ("(%s)", marker); break; default: break; } current_footnote_number++; - + } free (marker); free (note); } /* Output the footnotes. We are at the end of the current node. */ void output_pending_notes () { FN *footnote = pending_notes; if (!pending_notes) return; if (html) { /* The type= attribute is used just in case some weirdo browser out there doesn't use numbers by default. Since we rely on the browser to produce the footnote numbers, we need to make sure they ARE indeed numbers. Pre-HTML4 browsers seem to not care. */ add_word ("

"); add_word (_("Footnotes")); add_word ("

\n
    \n"); } else switch (footnote_style) { case separate_node: { char *old_current_node = current_node; char *old_command = xstrdup (command); already_outputting_pending_notes++; execute_string ("%cnode %s-Footnotes,,,%s\n", COMMAND_PREFIX, current_node, current_node); already_outputting_pending_notes--; current_node = old_current_node; free (command); command = old_command; } break; case end_node: close_paragraph (); in_fixed_width_font++; /* This string should be translated according to the @documentlanguage, not the current LANG. We can't do that yet, so leave it in English. */ execute_string ("---------- Footnotes ----------\n\n"); in_fixed_width_font--; break; } /* Handle the footnotes in reverse order. */ { FN **array = xmalloc ((footnote_count + 1) * sizeof (FN *)); array[footnote_count] = NULL; while (--footnote_count > -1) { array[footnote_count] = footnote; footnote = footnote->next; } filling_enabled = 1; indented_fill = 1; while ((footnote = array[++footnote_count])) { if (html) { /* Make the text of every footnote begin a separate paragraph. */ add_word_args ("
  1. \n

    ", footnote->number); + already_outputting_pending_notes++; execute_string ("%s", footnote->note); + already_outputting_pending_notes--; add_word ("

    \n"); } else { char *old_current_node = current_node; char *old_command = xstrdup (command); already_outputting_pending_notes++; execute_string ("%canchor{%s-Footnote-%d}(%s) %s", COMMAND_PREFIX, current_node, footnote->number, footnote->marker, footnote->note); already_outputting_pending_notes--; current_node = old_current_node; free (command); command = old_command; } close_paragraph (); } if (html) add_word ("

"); close_paragraph (); free (array); } free_pending_notes (); } diff --git a/contrib/texinfo/makeinfo/html.c b/contrib/texinfo/makeinfo/html.c index f2e53e510db6..b7a8d59802a3 100644 --- a/contrib/texinfo/makeinfo/html.c +++ b/contrib/texinfo/makeinfo/html.c @@ -1,182 +1,359 @@ /* html.c -- html-related utilities. - $Id: html.c,v 1.5 1999/09/18 19:27:41 karl Exp $ + $Id: html.c,v 1.19 2002/02/23 19:12:15 karl Exp $ - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 01, 02 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 "system.h" #include "cmds.h" #include "html.h" #include "lang.h" #include "makeinfo.h" #include "sectioning.h" /* See html.h. */ int html_output_head_p = 0; void html_output_head () { - char *html_title; - + static char *html_title = NULL; + static int html_title_written = 0; + if (html_output_head_p) return; html_output_head_p = 1; - /* The should not have markup. */ - html_title = title ? text_expansion (title) : _("Untitled"); + /* The <title> should not have markup, so use text_expansion. */ + if (!html_title) + html_title = title ? text_expansion (title) : _("Untitled"); - add_word_args ("<html lang=\"%s\"><head>\n<title>%s\n", + add_word_args ("\n\n%s\n", language_table[language_code].abbrev, html_title); add_word ("\n"); - - add_word_args ("\n", html_title); + + if (!document_description) + document_description = html_title; + + add_word_args ("\n", + document_description); add_word_args ("\n", VERSION); add_word ("\n"); - add_word ("\n\n"); + add_word ("\n\n"); + + if (title && !html_title_written) + { + add_word_args ("

%s

\n", html_title); + html_title_written = 1; + } } /* Escape HTML special characters in the string if necessary, returning a pointer to a possibly newly-allocated one. */ char * escape_string (string) char * string; { int i=0, newlen=0; char * newstring; do { /* Find how much to allocate. */ switch (string[i]) { case '&': newlen += 5; /* `&' */ break; case '<': case '>': newlen += 4; /* `<', `>' */ break; default: newlen++; } - i++; } - while (string[i]); + while (string[i++]); if (newlen == i) return string; /* Already OK. */ - newstring = xmalloc (newlen + 2); + newstring = xmalloc (newlen); i = 0; do { switch (string[i]) { case '&': strcpy (newstring, "&"); newstring += 5; break; case '<': strcpy (newstring, "<"); newstring += 4; break; case '>': strcpy (newstring, ">"); newstring += 4; break; default: newstring[0] = string[i]; newstring++; } } while (string[i++]); free (string); - return newstring - newlen -1; + return newstring - newlen; } /* Open or close TAG according to START_OR_END. */ void insert_html_tag (start_or_end, tag) int start_or_end; char *tag; { if (!paragraph_is_open && (start_or_end == START)) { /* Need to compensate for the

we are about to insert, or else cm_xxx functions that call us will get wrong text between START and END. */ adjust_braces_following (output_paragraph_offset, 3); add_word ("

"); } add_char ('<'); if (start_or_end != START) add_char ('/'); add_word (tag); add_char ('>'); } /* Output an HTML to the filename for NODE, including the other string as extra attributes. */ void -add_link (node, attributes) - char *node, *attributes; +add_link (nodename, attributes) + char *nodename, *attributes; { - if (node) + if (nodename) { - add_word_args ("\n"); + add_html_elt ("\n"); } } /* Output NAME with characters escaped as appropriate for an anchor name, i.e., escape URL special characters as %. */ void add_escaped_anchor_name (name) char *name; { for (; *name; name++) { if (*name == '&') add_word ("&"); else if (! URL_SAFE_CHAR (*name)) /* Cast so characters with the high bit set are treated as >128, for example o-umlaut should be 246, not -10. */ add_word_args ("%%%x", (unsigned char) *name); else add_char (*name); } } /* Insert the text for the name of a reference in an HTML anchor appropriate for NODENAME. If HREF is nonzero, it will be appropriate for a href= attribute, rather than name= i.e., including the `#' if it's an internal reference. */ void add_anchor_name (nodename, href) char *nodename; int href; { if (href) - add_char ('#'); + { + if (splitting) + add_url_name (nodename, href); + add_char ('#'); + } + /* Always add NODENAME, so that the reference would pinpoint the + exact node on its file. This is so several nodes could share the + same file, in case of file-name clashes, but also for more + accurate browser positioning. */ + if (strcasecmp (nodename, "(dir)") == 0) + /* Strip the parens, but keep the original letter-case. */ + add_word_args ("%.3s", nodename + 1); + else + add_escaped_anchor_name (nodename); +} + +/* Insert the text for the name of a reference in an HTML url, aprropriate + for NODENAME */ +void +add_url_name (nodename, href) + char *nodename; + int href; +{ + add_nodename_to_filename (nodename, href); +} + +/* Only allow [-0-9a-zA-Z_.] when nodifying filenames. This may + result in filename clashes; e.g., + + @node Foo ],,, + @node Foo [,,, + + both map to Foo--.html. If that happens, cm_node will put all + the nodes whose file names clash on the same file. */ +void +fix_filename (filename) + char *filename; +{ + char *p; + for (p = filename; *p; p++) + { + if (!(isalnum (*p) || strchr ("-._", *p))) + *p = '-'; + } +} + +/* As we can't look-up a (forward-referenced) nodes' html filename + from the tentry, we take the easy way out. We assume that + nodenames are unique, and generate the html filename from the + nodename, that's always known. */ +static char * +nodename_to_filename_1 (nodename, href) + char *nodename; + int href; +{ + char *p; + char *filename; + char dirname[PATH_MAX]; - add_escaped_anchor_name (nodename); + if (strcasecmp (nodename, "Top") == 0) + { + /* We want to convert references to the Top node into + "index.html#Top". */ + if (href) + filename = xstrdup ("index.html"); /* "#Top" is added by our callers */ + else + filename = xstrdup ("Top"); + } + else if (strcasecmp (nodename, "(dir)") == 0) + /* We want to convert references to the (dir) node into + "../index.html". */ + filename = xstrdup ("../index.html"); + else + { + filename = xmalloc (PATH_MAX); + dirname[0] = '\0'; + *filename = '\0'; + + /* Check for external reference: ``(info-document)node-name'' + Assume this node lives at: ``../info-document/node-name.html'' + + We need to handle the special case (sigh): ``(info-document)'', + ie, an external top-node, which should translate to: + ``../info-document/info-document.html'' */ + + p = nodename; + if (*nodename == '(') + { + int length; + + p = strchr (nodename, ')'); + if (p == NULL) + { + line_error (_("Invalid node name: `%s'"), nodename); + exit (1); + } + + length = p - nodename - 1; + if (length > 5 && + FILENAME_CMPN (p - 5, ".info", 5) == 0) + length -= 5; + /* This is for DOS, and also for Windows and GNU/Linux + systems that might have Info files copied from a DOS 8+3 + filesystem. */ + if (length > 4 && + FILENAME_CMPN (p - 4, ".inf", 4) == 0) + length -= 4; + strcpy (filename, "../"); + strncpy (dirname, nodename + 1, length); + *(dirname + length) = '\0'; + fix_filename (dirname); + strcat (filename, dirname); + strcat (filename, "/"); + p++; + } + + /* In the case of just (info-document), there will be nothing + remaining, and we will refer to ../info-document/, which will + work fine. */ + strcat (filename, p); + if (*p) + { + /* Hmm */ + fix_filename (filename + strlen (filename) - strlen (p)); + strcat (filename, ".html"); + } + } + + /* Produce a file name suitable for the underlying filesystem. */ + normalize_filename (filename); + +#if 0 + /* We add ``#Nodified-filename'' anchor to external references to be + prepared for non-split HTML support. Maybe drop this. */ + if (href && *dirname) + { + strcat (filename, "#"); + strcat (filename, p); + /* Hmm, again */ + fix_filename (filename + strlen (filename) - strlen (p)); + } +#endif + + return filename; +} + +/* If necessary, ie, if current filename != filename of node, output + the node name. */ +void +add_nodename_to_filename (nodename, href) + char *nodename; + int href; +{ + /* for now, don't check: always output filename */ + char *filename = nodename_to_filename_1 (nodename, href); + add_word (filename); + free (filename); +} + +char * +nodename_to_filename (nodename) + char *nodename; +{ + /* The callers of nodename_to_filename use the result to produce + . */ extern int html_output_head_p; /* Perform the output. */ extern void html_output_head (); /* Escape &<>. */ extern char *escape_string (/* char * */); /* Open or close TAG according to START_OR_END. */ extern void insert_html_tag (/* int start_or_end, char *tag */); /* Output HTML to NODE, plus extra ATTRIBUTES. */ extern void add_link (/* char *node, char *attributes */); /* Escape URL-special characters as %xy. */ extern void add_escaped_anchor_name (/* char *name */); /* See html.c. */ extern void add_anchor_name (/* nodename, href */); +extern void add_url_name ( /* nodename, href */ ); +extern char* nodename_to_filename ( /* nodename */ ); +extern void add_nodename_to_filename ( /*nodename, href */ ); #endif /* !HTML_H */ diff --git a/contrib/texinfo/makeinfo/index.c b/contrib/texinfo/makeinfo/index.c index 05466ce9a4f0..edaf4e1b213e 100644 --- a/contrib/texinfo/makeinfo/index.c +++ b/contrib/texinfo/makeinfo/index.c @@ -1,823 +1,852 @@ /* index.c -- indexing for Texinfo. - $Id: index.c,v 1.21 1999/07/18 18:50:02 karl Exp $ + $Id: index.c,v 1.24 2002/01/22 14:28:07 karl Exp $ - Copyright (C) 1998, 99 Free Software Foundation, Inc. + Copyright (C) 1998, 99, 2002 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 "system.h" #include "index.h" #include "lang.h" #include "macro.h" #include "toc.h" +#include "xml.h" /* An index element... */ typedef struct index_elt { struct index_elt *next; char *entry; /* The index entry itself, after expansion. */ char *entry_text; /* The original, non-expanded entry text. */ char *node; /* The node from whence it came. */ int code; /* Nonzero means add `@code{...}' when printing this element. */ int defining_line; /* Line number where this entry was written. */ char *defining_file; /* Source file for defining_line. */ } INDEX_ELT; /* A list of short-names for each index. There are two indices into the the_indices array. * read_index is the index that points to the list of index entries that we will find if we ask for the list of entries for this name. * write_index is the index that points to the list of index entries that we will add new entries to. Initially, read_index and write_index are the same, but the @syncodeindex and @synindex commands can change the list we add entries to. For example, after the commands @cindex foo @defindex ii @synindex cp ii @cindex bar the cp index will contain the entry `foo', and the new ii index will contain the entry `bar'. This is consistent with the way texinfo.tex handles the same situation. In addition, for each index, it is remembered whether that index is a code index or not. Code indices have @code{} inserted around the first word when they are printed with printindex. */ typedef struct { char *name; int read_index; /* index entries for `name' */ int write_index; /* store index entries here, @synindex can change it */ int code; } INDEX_ALIST; INDEX_ALIST **name_index_alist = NULL; /* An array of pointers. Each one is for a different index. The "synindex" command changes which array slot is pointed to by a given "index". */ INDEX_ELT **the_indices = NULL; /* The number of defined indices. */ int defined_indices = 0; /* Stuff for defining commands on the fly. */ COMMAND **user_command_array = NULL; int user_command_array_len = 0; /* How to compare index entries for sorting. May be set to strcoll. */ int (*index_compare_fn) () = strcasecmp; /* Find which element in the known list of indices has this name. Returns -1 if NAME isn't found. */ static int find_index_offset (name) char *name; { int i; for (i = 0; i < defined_indices; i++) if (name_index_alist[i] && STREQ (name, name_index_alist[i]->name)) return i; return -1; } /* Return a pointer to the entry of (name . index) for this name. Return NULL if the index doesn't exist. */ INDEX_ALIST * find_index (name) char *name; { int offset = find_index_offset (name); if (offset > -1) return name_index_alist[offset]; else return NULL; } /* User-defined commands, which happens only from user-defined indexes. Used to initialize the builtin indices, too. */ void define_user_command (name, proc, needs_braces_p) char *name; COMMAND_FUNCTION *proc; int needs_braces_p; { int slot = user_command_array_len; user_command_array_len++; if (!user_command_array) user_command_array = xmalloc (1 * sizeof (COMMAND *)); user_command_array = xrealloc (user_command_array, (1 + user_command_array_len) * sizeof (COMMAND *)); user_command_array[slot] = xmalloc (sizeof (COMMAND)); user_command_array[slot]->name = xstrdup (name); user_command_array[slot]->proc = proc; user_command_array[slot]->argument_in_braces = needs_braces_p; } /* Please release me, let me go... */ static void free_index (index) INDEX_ELT *index; { INDEX_ELT *temp; while ((temp = index)) { free (temp->entry); free (temp->entry_text); /* Do not free the node, because we already freed the tag table, which freed all the node names. */ /* free (temp->node); */ index = index->next; free (temp); } } /* Flush an index by name. This will delete the list of entries that would be written by a @printindex command for this index. */ static void undefindex (name) char *name; { int i; int which = find_index_offset (name); /* The index might have already been freed if this was the target of an @synindex. */ if (which < 0 || !name_index_alist[which]) return; i = name_index_alist[which]->read_index; free_index (the_indices[i]); the_indices[i] = NULL; free (name_index_alist[which]->name); free (name_index_alist[which]); name_index_alist[which] = NULL; } /* Add the arguments to the current index command to the index NAME. html fixxme generate specific html anchor */ static void index_add_arg (name) char *name; { int which; char *index_entry; INDEX_ALIST *tem; tem = find_index (name); which = tem ? tem->write_index : -1; if (macro_expansion_output_stream && !executing_string) append_to_expansion_output (input_text_offset + 1); get_rest_of_line (0, &index_entry); ignore_blank_line (); if (macro_expansion_output_stream && !executing_string) { char *index_line = xmalloc (strlen (index_entry) + 2); sprintf (index_line, "%s\n", index_entry); me_execute_string_keep_state (index_line, NULL); free (index_line); } if (which < 0) { line_error (_("Unknown index `%s'"), name); free (index_entry); } else { INDEX_ELT *new = xmalloc (sizeof (INDEX_ELT)); new->next = the_indices[which]; new->entry_text = index_entry; new->entry = NULL; new->node = current_node ? current_node : xstrdup (""); new->code = tem->code; new->defining_line = line_number - 1; /* We need to make a copy since input_filename may point to something that goes away, for example, inside a macro. (see the findexerr test). */ new->defining_file = xstrdup (input_filename); the_indices[which] = new; + /* The index breaks if there are colons in the entry. */ + if (strchr (new->entry_text, ':')) + warning (_("Info cannot handle `:' in index entry `%s'"), + new->entry_text); } + if (xml) + xml_insert_indexterm (index_entry, name); } /* The function which user defined index commands call. */ static void gen_index () { char *name = xstrdup (command); if (strlen (name) >= strlen ("index")) name[strlen (name) - strlen ("index")] = 0; index_add_arg (name); free (name); } /* Define an index known as NAME. We assign the slot number. If CODE is nonzero, make this a code index. */ static void defindex (name, code) char *name; int code; { int i, slot; /* If it already exists, flush it. */ undefindex (name); /* Try to find an empty slot. */ slot = -1; for (i = 0; i < defined_indices; i++) if (!name_index_alist[i]) { slot = i; break; } if (slot < 0) { /* No such luck. Make space for another index. */ slot = defined_indices; defined_indices++; name_index_alist = (INDEX_ALIST **) xrealloc (name_index_alist, (1 + defined_indices) * sizeof (INDEX_ALIST *)); the_indices = (INDEX_ELT **) xrealloc (the_indices, (1 + defined_indices) * sizeof (INDEX_ELT *)); } /* We have a slot. Start assigning. */ name_index_alist[slot] = xmalloc (sizeof (INDEX_ALIST)); name_index_alist[slot]->name = xstrdup (name); name_index_alist[slot]->read_index = slot; name_index_alist[slot]->write_index = slot; name_index_alist[slot]->code = code; the_indices[slot] = NULL; } /* Define an index NAME, implicitly @code if CODE is nonzero. */ static void top_defindex (name, code) char *name; int code; { char *temp; temp = xmalloc (1 + strlen (name) + strlen ("index")); sprintf (temp, "%sindex", name); define_user_command (temp, gen_index, 0); defindex (name, code); free (temp); } /* Set up predefined indices. */ void init_indices () { int i; /* Create the default data structures. */ /* Initialize data space. */ if (!the_indices) { the_indices = xmalloc ((1 + defined_indices) * sizeof (INDEX_ELT *)); the_indices[defined_indices] = NULL; name_index_alist = xmalloc ((1 + defined_indices) * sizeof (INDEX_ALIST *)); name_index_alist[defined_indices] = NULL; } /* If there were existing indices, get rid of them now. */ for (i = 0; i < defined_indices; i++) { undefindex (name_index_alist[i]->name); if (name_index_alist[i]) { /* Suppose we're called with two input files, and the first does a @synindex pg cp. Then, when we get here to start the second file, the "pg" element won't get freed by undefindex (because it's pointing to "cp"). So free it here; otherwise, when we try to define the pg index again just below, it will still point to cp. */ free (name_index_alist[i]->name); free (name_index_alist[i]); name_index_alist[i] = NULL; } } /* Add the default indices. */ top_defindex ("cp", 0); /* cp is the only non-code index. */ top_defindex ("fn", 1); top_defindex ("ky", 1); top_defindex ("pg", 1); top_defindex ("tp", 1); top_defindex ("vr", 1); } /* Given an index name, return the offset in the_indices of this index, or -1 if there is no such index. */ int translate_index (name) char *name; { INDEX_ALIST *which = find_index (name); if (which) return which->read_index; else return -1; } /* Return the index list which belongs to NAME. */ INDEX_ELT * index_list (name) char *name; { int which = translate_index (name); if (which < 0) return (INDEX_ELT *) -1; else return the_indices[which]; } /* Define a new index command. Arg is name of index. */ static void gen_defindex (code) int code; { char *name; get_rest_of_line (0, &name); if (find_index (name)) { line_error (_("Index `%s' already exists"), name); } else { char *temp = xmalloc (strlen (name) + sizeof ("index")); sprintf (temp, "%sindex", name); define_user_command (temp, gen_index, 0); defindex (name, code); free (temp); } free (name); } void cm_defindex () { gen_defindex (0); } void cm_defcodeindex () { gen_defindex (1); } /* Expects 2 args, on the same line. Both are index abbreviations. Make the first one be a synonym for the second one, i.e. make the first one have the same index as the second one. */ void cm_synindex () { int source, target; char *abbrev1, *abbrev2; skip_whitespace (); get_until_in_line (0, " ", &abbrev1); target = find_index_offset (abbrev1); skip_whitespace (); get_until_in_line (0, " ", &abbrev2); source = find_index_offset (abbrev2); if (source < 0 || target < 0) { line_error (_("Unknown index `%s' and/or `%s' in @synindex"), abbrev1, abbrev2); } else { name_index_alist[target]->write_index = name_index_alist[source]->write_index; } free (abbrev1); free (abbrev2); } void cm_pindex () /* Pinhead index. */ { index_add_arg ("pg"); } void cm_vindex () /* Variable index. */ { index_add_arg ("vr"); } void cm_kindex () /* Key index. */ { index_add_arg ("ky"); } void cm_cindex () /* Concept index. */ { index_add_arg ("cp"); } void cm_findex () /* Function index. */ { index_add_arg ("fn"); } void cm_tindex () /* Data Type index. */ { index_add_arg ("tp"); } int index_element_compare (element1, element2) INDEX_ELT **element1, **element2; { return index_compare_fn ((*element1)->entry, (*element2)->entry); } /* Force all index entries to be unique. */ void make_index_entries_unique (array, count) INDEX_ELT **array; int count; { int i, j; INDEX_ELT **copy; int counter = 1; copy = xmalloc ((1 + count) * sizeof (INDEX_ELT *)); for (i = 0, j = 0; i < count; i++) { if (i == (count - 1) || array[i]->node != array[i + 1]->node || !STREQ (array[i]->entry, array[i + 1]->entry)) copy[j++] = array[i]; else { free (array[i]->entry); free (array[i]->entry_text); free (array[i]); } } copy[j] = NULL; /* Now COPY contains only unique entries. Duplicated entries in the original array have been freed. Replace the current array with the copy, fixing the NEXT pointers. */ for (i = 0; copy[i]; i++) { copy[i]->next = copy[i + 1]; /* Fix entry names which are the same. They point to different nodes, so we make the entry name unique. */ if (copy[i+1] && STREQ (copy[i]->entry, copy[i + 1]->entry) && !html) { char *new_entry_name; new_entry_name = xmalloc (10 + strlen (copy[i]->entry)); sprintf (new_entry_name, "%s <%d>", copy[i]->entry, counter); free (copy[i]->entry); copy[i]->entry = new_entry_name; counter++; } else counter = 1; array[i] = copy[i]; } array[i] = NULL; /* Free the storage used only by COPY. */ free (copy); } /* Sort the index passed in INDEX, returning an array of pointers to elements. The array is terminated with a NULL pointer. We call qsort because it's supposed to be fast. I think this looks bad. */ INDEX_ELT ** sort_index (index) INDEX_ELT *index; { INDEX_ELT **array; INDEX_ELT *temp = index; int count = 0; int save_line_number = line_number; char *save_input_filename = input_filename; int save_html = html; /* Pretend we are in non-HTML mode, for the purpose of getting the expanded index entry that lacks any markup and other HTML escape characters which could produce a wrong sort order. */ /* fixme: html: this still causes some markup, such as non-ASCII characters @AE{} etc., to sort incorrectly. */ html = 0; while (temp) { count++; temp = temp->next; } /* We have the length. Make an array. */ array = xmalloc ((count + 1) * sizeof (INDEX_ELT *)); count = 0; temp = index; while (temp) { array[count++] = temp; /* Set line number and input filename to the source line for this index entry, as this expansion finds any errors. */ line_number = array[count - 1]->defining_line; input_filename = array[count - 1]->defining_file; /* If this particular entry should be printed as a "code" index, then expand it as @code{entry}, i.e. as in fixed-width font. */ array[count-1]->entry = expansion (temp->entry_text, - array[count-1]->code); + array[count-1]->code); temp = temp->next; } array[count] = NULL; /* terminate the array. */ line_number = save_line_number; input_filename = save_input_filename; html = save_html; #ifdef HAVE_STRCOLL /* This is not perfect. We should set (then restore) the locale to the documentlanguage, so strcoll operates according to the document's locale, not the user's. For now, I'm just going to assume that those few new documents which use @documentlanguage will be processed in the appropriate locale. In any case, don't use strcoll in the C (aka POSIX) locale, that is the ASCII ordering. */ if (language_code != en) { char *lang_env = getenv ("LANG"); if (lang_env && !STREQ (lang_env, "C") && !STREQ (lang_env, "POSIX")) index_compare_fn = strcoll; } #endif /* HAVE_STRCOLL */ /* Sort the array. */ qsort (array, count, sizeof (INDEX_ELT *), index_element_compare); make_index_entries_unique (array, count); return array; } /* Nonzero means that we are in the middle of printing an index. */ int printing_index = 0; /* Takes one arg, a short name of an index to print. Outputs a menu of the sorted elements of the index. */ void cm_printindex () { - int item; - INDEX_ELT *index; - INDEX_ELT *last_index = 0; - INDEX_ELT **array; - char *index_name; - unsigned line_length; - char *line; - int saved_inhibit_paragraph_indentation = inhibit_paragraph_indentation; - int saved_filling_enabled = filling_enabled; - int saved_line_number = line_number; - char *saved_input_filename = input_filename; - - close_paragraph (); - get_rest_of_line (0, &index_name); - - index = index_list (index_name); - if (index == (INDEX_ELT *)-1) + if (xml && !docbook) { - line_error (_("Unknown index `%s' in @printindex"), index_name); - free (index_name); - return; + char *index_name; + get_rest_of_line (0, &index_name); + xml_insert_element (PRINTINDEX, START); + insert_string (index_name); + xml_insert_element (PRINTINDEX, END); } - - /* 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 (); - if (html) - add_word ("

"); } diff --git a/contrib/texinfo/makeinfo/insertion.c b/contrib/texinfo/makeinfo/insertion.c index 11b908901db5..c7087f2c287c 100644 --- a/contrib/texinfo/makeinfo/insertion.c +++ b/contrib/texinfo/makeinfo/insertion.c @@ -1,1368 +1,1571 @@ /* insertion.c -- insertions for Texinfo. - $Id: insertion.c,v 1.27 1999/07/06 23:12:53 karl Exp $ + $Id: insertion.c,v 1.39 2002/03/02 15:05:21 karl Exp $ - Copyright (C) 1998, 99 Free Software Foundation, Inc. + Copyright (C) 1998, 99, 2000, 01, 02 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 "system.h" #include "cmds.h" #include "defun.h" #include "insertion.h" #include "macro.h" #include "makeinfo.h" +#include "xml.h" /* Must match list in insertion.h. */ static char *insertion_type_names[] = -{ +{ "cartouche", "defcv", "deffn", "defivar", "defmac", "defmethod", "defop", "defopt", "defspec", "deftp", "deftypefn", "deftypefun", "deftypeivar", "deftypemethod", "deftypeop", "deftypevar", "deftypevr", "defun", "defvar", "defvr", "detailmenu", "direntry", - "display", "enumerate", "example", "flushleft", "flushright", - "format", "ftable", "group", "ifclear", "ifhtml", "ifinfo", - "ifnothtml", "ifnotinfo", "ifnottex", "ifset", "iftex", "itemize", - "lisp", "menu", "multitable", "quotation", "rawhtml", "rawtex", - "smalldisplay", "smallexample", "smallformat", "smalllisp", "table", - "tex", "vtable", "bad_type" + "display", "documentdescription", "enumerate", "example", "flushleft", + "flushright", "format", "ftable", "group", "ifclear", "ifhtml", + "ifinfo", "ifnothtml", "ifnotinfo", "ifnottex", "ifset", "iftex", + "itemize", "lisp", "menu", "multitable", "quotation", "rawhtml", + "rawtex", "smalldisplay", "smallexample", "smallformat", "smalllisp", + "verbatim", "table", "tex", "vtable", "bad_type" }; /* All nested environments. */ INSERTION_ELT *insertion_stack = NULL; /* How deeply we're nested. */ int insertion_level = 0; /* Whether to examine menu lines. */ int in_menu = 0; /* How to examine menu lines. */ int in_detailmenu = 0; /* Set to 1 if we've processed (commentary) text in a @menu that wasn't part of a menu item. */ int had_menu_commentary; /* Set to 1 if

is written in normal context. Used for menu and itemize. */ int in_paragraph = 0; static const char dl_tag[] = "

\n"; void init_insertion_stack () { insertion_stack = NULL; } /* Return the type of the current insertion. */ static enum insertion_type current_insertion_type () { return insertion_level ? insertion_stack->insertion : bad_type; } /* Return the string which is the function to wrap around items, or NULL if we're not in an environment where @item is ok. */ static char * current_item_function () { int done = 0; INSERTION_ELT *elt = insertion_stack; /* Skip down through the stack until we find an insertion with an itemize function defined, i.e., skip conditionals, @cartouche, etc. */ while (!done && elt) { switch (elt->insertion) { /* This list should match the one in cm_item. */ case ifclear: case ifhtml: case ifinfo: case ifnothtml: case ifnotinfo: case ifnottex: case ifset: case iftex: case rawhtml: case rawtex: case tex: case cartouche: elt = elt->next; break; default: done = 1; } } /* item_function usually gets assigned the empty string. */ return done && (*elt->item_function) ? elt->item_function : NULL; } /* Parse the item marker function off the input. If result is just "@", change it to "@ ", since "@" by itself is not a command. This makes "@ ", "@\t", and "@\n" all the same, but their default meanings are the same anyway, and let's not worry about supporting redefining them. */ char * get_item_function () { char *item_function; get_rest_of_line (0, &item_function); /* If we hit the end of text in get_rest_of_line, backing up input pointer will cause the last character of the last line be pushed back onto the input, which is wrong. */ if (input_text_offset < input_text_length) backup_input_pointer (); if (STREQ (item_function, "@")) { free (item_function); item_function = xstrdup ("@ "); } return item_function; } /* Push the state of the current insertion on the stack. */ void push_insertion (type, item_function) enum insertion_type type; char *item_function; { INSERTION_ELT *new = xmalloc (sizeof (INSERTION_ELT)); new->item_function = item_function; new->filling_enabled = filling_enabled; new->indented_fill = indented_fill; new->insertion = type; new->line_number = line_number; new->filename = xstrdup (input_filename); new->inhibited = inhibit_paragraph_indentation; new->in_fixed_width_font = in_fixed_width_font; new->next = insertion_stack; insertion_stack = new; insertion_level++; } /* Pop the value on top of the insertion stack into the global variables. */ void pop_insertion () { INSERTION_ELT *temp = insertion_stack; if (temp == NULL) return; in_fixed_width_font = temp->in_fixed_width_font; inhibit_paragraph_indentation = temp->inhibited; filling_enabled = temp->filling_enabled; indented_fill = temp->indented_fill; free_and_clear (&(temp->item_function)); free_and_clear (&(temp->filename)); insertion_stack = insertion_stack->next; free (temp); insertion_level--; } /* Return a pointer to the print name of this enumerated type. */ char * insertion_type_pname (type) enum insertion_type type; { if ((int) type < (int) bad_type) return insertion_type_names[(int) type]; else return _("Broken-Type in insertion_type_pname"); } /* Return the insertion_type associated with NAME. If the type is not one of the known ones, return BAD_TYPE. */ enum insertion_type find_type_from_name (name) char *name; { int index = 0; while (index < (int) bad_type) { if (STREQ (name, insertion_type_names[index])) return (enum insertion_type) index; if (index == rawhtml && STREQ (name, "html")) return rawhtml; if (index == rawtex && STREQ (name, "tex")) return rawtex; index++; } return bad_type; } int defun_insertion (type) enum insertion_type type; { return 0 || (type == defcv) || (type == deffn) || (type == defivar) || (type == defmac) || (type == defmethod) || (type == defop) || (type == defopt) || (type == defspec) || (type == deftp) || (type == deftypefn) || (type == deftypefun) || (type == deftypeivar) || (type == deftypemethod) || (type == deftypeop) || (type == deftypevar) || (type == deftypevr) || (type == defun) || (type == defvar) || (type == defvr) ; } /* MAX_NS is the maximum nesting level for enumerations. I picked 100 which seemed reasonable. This doesn't control the number of items, just the number of nested lists. */ #define max_stack_depth 100 #define ENUM_DIGITS 1 #define ENUM_ALPHA 2 typedef struct { int enumtype; int enumval; } DIGIT_ALPHA; DIGIT_ALPHA enumstack[max_stack_depth]; int enumstack_offset = 0; int current_enumval = 1; int current_enumtype = ENUM_DIGITS; char *enumeration_arg = NULL; void start_enumerating (at, type) int at, type; { if ((enumstack_offset + 1) == max_stack_depth) { line_error (_("Enumeration stack overflow")); return; } enumstack[enumstack_offset].enumtype = current_enumtype; enumstack[enumstack_offset].enumval = current_enumval; enumstack_offset++; current_enumval = at; current_enumtype = type; } void stop_enumerating () { --enumstack_offset; if (enumstack_offset < 0) enumstack_offset = 0; current_enumval = enumstack[enumstack_offset].enumval; current_enumtype = enumstack[enumstack_offset].enumtype; } /* Place a letter or digits into the output stream. */ void enumerate_item () { char temp[10]; if (current_enumtype == ENUM_ALPHA) { if (current_enumval == ('z' + 1) || current_enumval == ('Z' + 1)) { current_enumval = ((current_enumval - 1) == 'z' ? 'a' : 'A'); warning (_("lettering overflow, restarting at %c"), current_enumval); } sprintf (temp, "%c. ", current_enumval); } else sprintf (temp, "%d. ", current_enumval); indent (output_column += (current_indent - strlen (temp))); add_word (temp); current_enumval++; } static void enum_html () { char type; int start; if (isdigit (*enumeration_arg)) { type = '1'; start = atoi (enumeration_arg); } else if (isupper (*enumeration_arg)) { type = 'A'; start = *enumeration_arg - 'A' + 1; } else { type = 'a'; start = *enumeration_arg - 'a' + 1; } add_word_args ("
    \n", type, start); } /* Conditionally parse based on the current command name. */ void command_name_condition () { char *discarder = xmalloc (8 + strlen (command)); sprintf (discarder, "\n%cend %s", COMMAND_PREFIX, command); discard_until (discarder); discard_until ("\n"); free (discarder); } /* This is where the work for all the "insertion" style commands is done. A huge switch statement handles the various setups, and generic code is on both sides. */ void begin_insertion (type) enum insertion_type type; { int no_discard = 0; if (defun_insertion (type)) { push_insertion (type, xstrdup ("")); no_discard++; } else - push_insertion (type, get_item_function ()); + { + push_insertion (type, get_item_function ()); + } switch (type) { case menu: if (!no_headers) close_paragraph (); filling_enabled = no_indent = 0; inhibit_paragraph_indentation = 1; if (html) { had_menu_commentary = 1; } - else if (!no_headers) + else if (!no_headers && !xml) add_word ("* Menu:\n"); + if (xml) + xml_insert_element (MENU, START); + in_menu++; in_fixed_width_font++; 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_fixed_width_font++; in_detailmenu++; break; case direntry: - if (html) - command_name_condition (); - else - { - close_single_paragraph (); - filling_enabled = no_indent = 0; - inhibit_paragraph_indentation = 1; - insert_string ("START-INFO-DIR-ENTRY\n"); - } + close_single_paragraph (); + filling_enabled = no_indent = 0; + inhibit_paragraph_indentation = 1; + insert_string ("START-INFO-DIR-ENTRY\n"); + break; + + case documentdescription: + { + char *desc; + int start_of_end; + int save_fixed_width; + + discard_until ("\n"); /* ignore the @documentdescription line */ + start_of_end = get_until ("\n@end documentdescription", &desc); + save_fixed_width = in_fixed_width_font; + + in_fixed_width_font = 0; + document_description = expansion (desc, 0); + free (desc); + + in_fixed_width_font = save_fixed_width; + input_text_offset = start_of_end; /* go back to the @end to match */ + } break; case quotation: /* @quotation does filling (@display doesn't). */ if (html) add_word ("
    \n"); else { close_single_paragraph (); last_char_was_newline = no_indent = 0; indented_fill = filling_enabled = 1; inhibit_paragraph_indentation = 1; } current_indent += default_indentation_increment; break; case display: case smalldisplay: case example: case smallexample: case lisp: case smalllisp: /* Like @display but without indentation. */ case smallformat: case format: close_single_paragraph (); inhibit_paragraph_indentation = 1; in_fixed_width_font++; filling_enabled = 0; last_char_was_newline = 0; if (html) /* Kludge alert: if
     is followed by a newline, IE3
                renders an extra blank line before the pre-formatted block.
                Other browsers seem to not mind one way or the other.  */
    -        add_word ("
    ");
    +        add_word ("
    ");
     
           if (type != format && type != smallformat)
             current_indent += default_indentation_increment;
           break;
     
         case multitable:
           do_multitable ();
           break;
     
         case table:
         case ftable:
         case vtable:
         case itemize:
           close_single_paragraph ();
           current_indent += default_indentation_increment;
           filling_enabled = indented_fill = 1;
     #if defined (INDENT_PARAGRAPHS_IN_TABLE)
           inhibit_paragraph_indentation = 0;
     #else
           inhibit_paragraph_indentation = 1;
     #endif /* !INDENT_PARAGRAPHS_IN_TABLE */
     
           /* Make things work for losers who forget the itemize syntax. */
           if (type == itemize)
             {
               if (!(*insertion_stack->item_function))
                 {
                   free (insertion_stack->item_function);
                   insertion_stack->item_function = xstrdup ("@bullet");
                 }
             }
     
           if (!*insertion_stack->item_function)
             {
               line_error (_("%s requires an argument: the formatter for %citem"),
                           insertion_type_pname (type), COMMAND_PREFIX);
             }
     
           if (html)
             {
               if (type == itemize)
     	    {
     	      add_word ("
      \n"); in_paragraph = 0; } else add_word (dl_tag); } + if (xml) + xml_begin_table (type, insertion_stack->item_function); break; case enumerate: close_single_paragraph (); no_indent = 0; #if defined (INDENT_PARAGRAPHS_IN_TABLE) inhibit_paragraph_indentation = 0; #else inhibit_paragraph_indentation = 1; #endif /* !INDENT_PARAGRAPHS_IN_TABLE */ current_indent += default_indentation_increment; filling_enabled = indented_fill = 1; if (html) enum_html (); + if (xml) + xml_begin_enumerate (enumeration_arg); + if (isdigit (*enumeration_arg)) start_enumerating (atoi (enumeration_arg), ENUM_DIGITS); else start_enumerating (*enumeration_arg, ENUM_ALPHA); break; /* @group does nothing special in makeinfo. */ case group: /* Only close the paragraph if we are not inside of an @example-like environment. */ - if (!insertion_stack->next + if (xml) + xml_insert_element (GROUP, START); + else if (!insertion_stack->next || (insertion_stack->next->insertion != display && insertion_stack->next->insertion != smalldisplay && insertion_stack->next->insertion != example && insertion_stack->next->insertion != smallexample && insertion_stack->next->insertion != lisp && insertion_stack->next->insertion != smalllisp && insertion_stack->next->insertion != format && insertion_stack->next->insertion != smallformat && insertion_stack->next->insertion != flushleft && insertion_stack->next->insertion != flushright)) close_single_paragraph (); break; /* Insertions that are no-ops in info, but do something in TeX. */ case cartouche: case ifclear: case ifhtml: case ifinfo: case ifnothtml: case ifnotinfo: case ifnottex: case ifset: case iftex: case rawtex: if (in_menu) no_discard++; break; case rawhtml: escape_html = 0; break; case defcv: case deffn: case defivar: case defmac: case defmethod: case defop: case defopt: case defspec: case deftp: case deftypefn: case deftypefun: case deftypeivar: case deftypemethod: case deftypeop: case deftypevar: case deftypevr: case defun: case defvar: case defvr: inhibit_paragraph_indentation = 1; filling_enabled = indented_fill = 1; current_indent += default_indentation_increment; no_indent = 0; break; case flushleft: close_single_paragraph (); inhibit_paragraph_indentation = 1; filling_enabled = indented_fill = no_indent = 0; + if (html) + add_word ("
      "); break; case flushright: close_single_paragraph (); filling_enabled = indented_fill = no_indent = 0; inhibit_paragraph_indentation = 1; force_flush_right++; + if (html) + add_word ("
      "); break; default: line_error ("begin_insertion internal error: type=%d", type); } if (!no_discard) discard_until ("\n"); } /* Try to end the insertion with the specified TYPE. With a value of `bad_type', TYPE gets translated to match the value currently on top of the stack. Otherwise, if TYPE doesn't match the top of the insertion stack, give error. */ void end_insertion (type) enum insertion_type type; { enum insertion_type temp_type; if (!insertion_level) return; temp_type = current_insertion_type (); if (type == bad_type) type = temp_type; if (type != temp_type) { line_error (_("`@end' expected `%s', but saw `%s'"), insertion_type_pname (temp_type), insertion_type_pname (type)); return; } pop_insertion (); + if (xml) + { + switch (type) + { + case ifinfo: + case documentdescription: + break; + case quotation: + xml_insert_element (QUOTATION, END); + break; + case example: + xml_insert_element (EXAMPLE, END); + break; + case smallexample: + xml_insert_element (SMALLEXAMPLE, END); + break; + case lisp: + xml_insert_element (LISP, END); + break; + case smalllisp: + xml_insert_element (SMALLLISP, END); + break; + case cartouche: + xml_insert_element (CARTOUCHE, END); + break; + case format: + xml_insert_element (FORMAT, END); + break; + case smallformat: + xml_insert_element (SMALLFORMAT, END); + break; + case display: + xml_insert_element (DISPLAY, END); + break; + case smalldisplay: + xml_insert_element (SMALLDISPLAY, END); + break; + case table: + case ftable: + case vtable: + case itemize: + xml_end_table (type); + break; + case enumerate: + xml_end_enumerate (type); + break; + case group: + xml_insert_element (GROUP, END); + break; + } + } switch (type) { /* Insertions which have no effect on paragraph formatting. */ + case documentdescription: case ifclear: - case ifhtml: case ifinfo: + case ifhtml: case ifnothtml: case ifnotinfo: case ifnottex: case ifset: case iftex: case rawtex: break; case rawhtml: escape_html = 1; break; case direntry: /* Eaten if html. */ 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 (html) add_word ("
    \n"); else if (!no_headers) close_insertion_paragraph (); break; case multitable: end_multitable (); break; case enumerate: stop_enumerating (); close_insertion_paragraph (); current_indent -= default_indentation_increment; if (html) add_word ("
\n"); break; case flushleft: + if (html) + add_word ("\n"); + close_insertion_paragraph (); + break; + case group: case cartouche: close_insertion_paragraph (); break; case format: case smallformat: case display: case smalldisplay: case example: case smallexample: case lisp: case smalllisp: case quotation: /* @format and @smallformat are the only fixed_width insertion without a change in indentation. */ if (type != format && type != smallformat) current_indent -= default_indentation_increment; if (html) add_word (type == quotation ? "\n" : "\n"); /* The ending of one of these insertions always marks the start of a new paragraph. */ close_insertion_paragraph (); break; case table: case ftable: case vtable: current_indent -= default_indentation_increment; if (html) add_word ("
\n"); break; case itemize: current_indent -= default_indentation_increment; if (html) add_word ("\n"); close_insertion_paragraph (); break; case flushright: force_flush_right--; + if (html) + add_word ("\n"); close_insertion_paragraph (); break; /* Handle the @defun insertions with this default clause. */ default: { enum insertion_type base_type; if (type < defcv || type > defvr) line_error ("end_insertion internal error: type=%d", type); base_type = get_base_type (type); switch (base_type) { case deffn: case defvr: case deftp: case deftypefn: case deftypevr: case defcv: case defop: case deftypemethod: case deftypeop: case deftypeivar: if (html) /* close the tables which has been opened in defun.c */ - add_word ("\n\n"); + add_word ("\n\n"); break; } /* switch (base_type)... */ current_indent -= default_indentation_increment; close_insertion_paragraph (); } break; } if (current_indent < 0) line_error ("end_insertion internal error: current indent=%d", current_indent); } /* Insertions cannot cross certain boundaries, such as node beginnings. In code that creates such boundaries, you should call `discard_insertions' before doing anything else. It prints the errors for you, and cleans up the insertion stack. With nonzero SPECIALS_OK argument, allows unmatched @if... conditionals, otherwise not. This is because conditionals can cross node boundaries. Always happens with the @top node, for example. */ void discard_insertions (specials_ok) int specials_ok; { int real_line_number = line_number; while (insertion_stack) { if (specials_ok && ((ifclear <= insertion_stack->insertion && insertion_stack->insertion <= iftex) || insertion_stack->insertion == rawhtml || insertion_stack->insertion == rawtex)) break; else { char *offender = insertion_type_pname (insertion_stack->insertion); - char *current_filename = input_filename; - input_filename = insertion_stack->filename; - line_number = insertion_stack->line_number; - line_error (_("No matching `%cend %s'"), COMMAND_PREFIX, offender); - input_filename = current_filename; + file_line_error (insertion_stack->filename, + insertion_stack->line_number, + _("No matching `%cend %s'"), COMMAND_PREFIX, + offender); pop_insertion (); } } line_number = real_line_number; } /* Insertion (environment) commands. */ void cm_quotation () { + if (xml) + xml_insert_element (QUOTATION, START); begin_insertion (quotation); } void cm_example () { + if (xml) + xml_insert_element (EXAMPLE, START); begin_insertion (example); } void cm_smallexample () { + if (xml) + xml_insert_element (SMALLEXAMPLE, START); begin_insertion (smallexample); } void cm_lisp () { + if (xml) + xml_insert_element (LISP, START); begin_insertion (lisp); } void cm_smalllisp () { + if (xml) + xml_insert_element (SMALLLISP, START); begin_insertion (smalllisp); } -/* @cartouche/@end cartouche draws box with rounded corners in - TeX output. Right now, just a no-op insertion. */ void cm_cartouche () { + if (xml) + xml_insert_element (CARTOUCHE, START); begin_insertion (cartouche); } void cm_format () { + if (xml) + xml_insert_element (FORMAT, START); begin_insertion (format); } void cm_smallformat () { + if (xml) + xml_insert_element (SMALLFORMAT, START); begin_insertion (smallformat); } void cm_display () { + if (xml) + xml_insert_element (DISPLAY, START); begin_insertion (display); } void cm_smalldisplay () { + if (xml) + xml_insert_element (SMALLDISPLAY, START); begin_insertion (smalldisplay); } void cm_direntry () { - if (no_headers || html) + if (html || xml) command_name_condition (); else begin_insertion (direntry); } +void +cm_documentdescription () +{ + if (html || xml) + begin_insertion (documentdescription); + else + command_name_condition (); +} + + void cm_itemize () { begin_insertion (itemize); } /* Start an enumeration insertion of type TYPE. If the user supplied no argument on the line, then use DEFAULT_STRING as the initial string. */ static void do_enumeration (type, default_string) int type; char *default_string; { get_until_in_line (0, ".", &enumeration_arg); canon_white (enumeration_arg); if (!*enumeration_arg) { free (enumeration_arg); enumeration_arg = xstrdup (default_string); } if (!isdigit (*enumeration_arg) && !isletter (*enumeration_arg)) { warning (_("%s requires letter or digit"), insertion_type_pname (type)); switch (type) { case enumerate: default_string = "1"; break; } enumeration_arg = xstrdup (default_string); } begin_insertion (type); } void cm_enumerate () { do_enumeration (enumerate, "1"); } +/* Handle verbatim environment: + find_end_verbatim == 0: process until end of file + find_end_verbatim != 0: process until 'COMMAND_PREFIXend verbatim' + or end of file + + We cannot simply copy input stream onto output stream; as the + verbatim environment may be encapsulated in an @example environment, + for example. */ +void +handle_verbatim_environment (find_end_verbatim) + int find_end_verbatim; +{ + int character; + int seen_end = 0; + int save_filling_enabled = filling_enabled; + int save_inhibit_paragraph_indentation = inhibit_paragraph_indentation; + + close_single_paragraph (); + inhibit_paragraph_indentation = 1; + filling_enabled = 0; + in_fixed_width_font++; + last_char_was_newline = 0; + + /* No indentation: this is verbatim after all + If you want indent, enclose @verbatim in @example + current_indent += default_indentation_increment; + */ + + if (html) + add_word ("
");
+
+  while (input_text_offset < input_text_length)
+    {
+      character = curchar ();
+
+      if (character == '\n')
+        line_number++;
+      /*
+	Assume no newlines in END_VERBATIM
+      */
+      else if (find_end_verbatim && (character == COMMAND_PREFIX) /* @ */
+	  && (input_text_length - input_text_offset > sizeof (END_VERBATIM))
+	  && !strncmp (&input_text[input_text_offset+1], END_VERBATIM,
+		       sizeof (END_VERBATIM)-1))
+	{
+	  input_text_offset += sizeof (END_VERBATIM);
+	  seen_end = 1;
+	  break;
+	}
+
+      add_char (character);
+      input_text_offset++;
+    }
+
+  if (find_end_verbatim && !seen_end)
+    warning (_("end of file inside verbatim block"));
+
+  if (html)
+    add_word ("
"); + + in_fixed_width_font--; + filling_enabled = save_filling_enabled; + inhibit_paragraph_indentation = save_inhibit_paragraph_indentation; +} + +void +cm_verbatim () +{ + handle_verbatim_environment (1); +} + void cm_table () { begin_insertion (table); } void cm_multitable () { begin_insertion (multitable); /* @@ */ } void cm_ftable () { begin_insertion (ftable); } void cm_vtable () { begin_insertion (vtable); } void cm_group () { begin_insertion (group); } void cm_ifinfo () { if (process_info) begin_insertion (ifinfo); else command_name_condition (); } void cm_ifnotinfo () { if (!process_info) begin_insertion (ifnotinfo); else command_name_condition (); } /* Insert raw HTML (no escaping of `<' etc.). */ void cm_html () { if (process_html) begin_insertion (rawhtml); else command_name_condition (); } void cm_ifhtml () { if (process_html) begin_insertion (ifhtml); else command_name_condition (); } void cm_ifnothtml () { if (!process_html) begin_insertion (ifnothtml); else command_name_condition (); } void cm_tex () { if (process_tex) begin_insertion (rawtex); else command_name_condition (); } void cm_iftex () { if (process_tex) begin_insertion (iftex); else command_name_condition (); } void cm_ifnottex () { if (!process_tex) begin_insertion (ifnottex); else command_name_condition (); } /* Begin an insertion where the lines are not filled or indented. */ void cm_flushleft () { begin_insertion (flushleft); } /* Begin an insertion where the lines are not filled, and each line is forced to the right-hand side of the page. */ void cm_flushright () { begin_insertion (flushright); } void cm_menu () { if (current_node == NULL) { warning (_("@menu seen before first @node, creating `Top' node")); warning (_("perhaps your @top node should be wrapped in @ifnottex rather than @ifinfo?")); /* Include @top command so we can construct the implicit node tree. */ execute_string ("@node top\n@top Top\n"); } begin_insertion (menu); } void cm_detailmenu () { if (current_node == NULL) { /* Problems anyway, @detailmenu should always be inside @menu. */ warning (_("@detailmenu seen before first node, creating `Top' node")); execute_string ("@node top\n@top Top\n"); } begin_insertion (detailmenu); } /* End existing insertion block. */ void cm_end () { char *temp; enum insertion_type type; if (!insertion_level) { line_error (_("Unmatched `%c%s'"), COMMAND_PREFIX, command); return; } get_rest_of_line (0, &temp); if (temp[0] == 0) line_error (_("`%c%s' needs something after it"), COMMAND_PREFIX, command); type = find_type_from_name (temp); if (type == bad_type) { line_error (_("Bad argument to `%s', `%s', using `%s'"), command, temp, insertion_type_pname (current_insertion_type ())); } + if (xml && type == menu) /* fixme */ + { + xml_end_menu (); + } end_insertion (type); free (temp); } /* @itemx, @item. */ static int itemx_flag = 0; /* Return whether CMD takes a brace-delimited {arg}. */ -static int +/*static */int command_needs_braces (cmd) char *cmd; { int i; for (i = 0; command_table[i].name; i++) { if (STREQ (command_table[i].name, cmd)) return command_table[i].argument_in_braces == BRACE_ARGS; } return 0; /* macro or alias */ } void cm_item () { char *rest_of_line, *item_func; /* Can only hack "@item" while inside of an insertion. */ if (insertion_level) { INSERTION_ELT *stack = insertion_stack; int original_input_text_offset; skip_whitespace (); original_input_text_offset = input_text_offset; get_rest_of_line (0, &rest_of_line); item_func = current_item_function (); /* Do the right thing depending on which insertion function is active. */ switch_top: switch (stack->insertion) { case multitable: multitable_item (); /* Support text directly after the @item. */ if (*rest_of_line) { line_number--; input_text_offset = original_input_text_offset; } break; case ifclear: case ifhtml: case ifinfo: case ifnothtml: case ifnotinfo: case ifnottex: case ifset: case iftex: case rawhtml: case rawtex: case tex: case cartouche: stack = stack->next; if (!stack) goto no_insertion; else goto switch_top; break; case menu: case quotation: case example: case smallexample: case lisp: case smalllisp: case format: case smallformat: case display: case smalldisplay: case group: line_error (_("@%s not meaningful inside `@%s' block"), command, insertion_type_pname (current_insertion_type ())); break; case itemize: case enumerate: if (itemx_flag) { line_error (_("@itemx not meaningful inside `%s' block"), insertion_type_pname (current_insertion_type ())); } else { if (html) { if (in_paragraph) { add_word ("

"); in_paragraph = 0; } add_word ("
  • "); } + else if (xml) + xml_begin_item (); else { start_paragraph (); kill_self_indent (-1); filling_enabled = indented_fill = 1; if (current_item_function ()) { output_column = current_indent - 2; indent (output_column); /* The item marker can be given with or without braces -- @bullet and @bullet{} are both ok. Or it might be something that doesn't take braces at all, such as "o" or "#" or "@ ". Thus, only supply braces if the item marker is a command, they haven't supplied braces themselves, and we know it needs them. */ if (item_func && *item_func) { if (*item_func == COMMAND_PREFIX && item_func[strlen (item_func) - 1] != '}' && command_needs_braces (item_func + 1)) execute_string ("%s{}", item_func); else execute_string ("%s", item_func); } insert (' '); output_column++; } else enumerate_item (); /* Special hack. This makes `close_paragraph' a no-op until `start_paragraph' has been called. */ must_start_paragraph = 1; } /* Handle text directly after the @item. */ if (*rest_of_line) { line_number--; input_text_offset = original_input_text_offset; } } break; case table: case ftable: case vtable: if (html) { static int last_html_output_position = 0; /* If nothing has been output since the last
    , remove the empty
    element. Some browsers render an extra empty line for
    , which makes @itemx conversion look ugly. */ if (last_html_output_position == output_position && strncmp ((char *) output_paragraph, "
    ", output_paragraph_offset) == 0) output_paragraph_offset = 0; /* Force the browser to render one blank line before each new @item in a table. But don't do that unless this is the first
    after the
    , or if we are converting @itemx. Note that there are some browsers which ignore
    in this context, but I cannot find any way to force them all render exactly one blank line. */ if (!itemx_flag && strncmp ((char *) output_paragraph + output_paragraph_offset - sizeof (dl_tag) + 1, dl_tag, sizeof (dl_tag) - 1) != 0) add_word ("
    "); add_word ("
    "); if (item_func && *item_func) execute_string ("%s{%s}", item_func, rest_of_line); else execute_string ("%s", rest_of_line); if (current_insertion_type () == ftable) execute_string ("%cfindex %s\n", COMMAND_PREFIX, rest_of_line); if (current_insertion_type () == vtable) execute_string ("%cvindex %s\n", COMMAND_PREFIX, rest_of_line); /* Make sure output_position is updated, so we could remember it. */ close_single_paragraph (); last_html_output_position = output_position; add_word ("
    "); } + else if (xml) /* && docbook)*/ /* 05-08 */ + { + xml_begin_table_item (); + if (item_func && *item_func) + execute_string ("%s{%s}", item_func, rest_of_line); + else + execute_string ("%s", rest_of_line); + xml_continue_table_item (); + } else { /* We need this to determine if we have two @item's in a row (see test just below). */ static int last_item_output_position = 0; /* Get rid of extra characters. */ kill_self_indent (-1); /* If we have one @item followed directly by another @item, we need to insert a blank line. This is not true for @itemx, though. */ if (!itemx_flag && last_item_output_position == output_position) insert ('\n'); /* `close_paragraph' almost does what we want. The problem is when paragraph_is_open, and last_char_was_newline, and the last newline has been turned into a space, because filling_enabled. I handle it here. */ if (last_char_was_newline && filling_enabled && paragraph_is_open) insert ('\n'); close_paragraph (); #if defined (INDENT_PARAGRAPHS_IN_TABLE) /* Indent on a new line, but back up one indentation level. */ { int save = inhibit_paragraph_indentation; inhibit_paragraph_indentation = 1; /* At this point, inserting any non-whitespace character will force the existing indentation to be output. */ add_char ('i'); inhibit_paragraph_indentation = save; } #else /* !INDENT_PARAGRAPHS_IN_TABLE */ add_char ('i'); #endif /* !INDENT_PARAGRAPHS_IN_TABLE */ output_paragraph_offset--; kill_self_indent (default_indentation_increment + 1); /* Add item's argument to the line. */ filling_enabled = 0; if (item_func && *item_func) execute_string ("%s{%s}", item_func, rest_of_line); else execute_string ("%s", rest_of_line); if (current_insertion_type () == ftable) execute_string ("%cfindex %s\n", COMMAND_PREFIX, rest_of_line); else if (current_insertion_type () == vtable) execute_string ("%cvindex %s\n", COMMAND_PREFIX, rest_of_line); /* Start a new line, and let start_paragraph () do the indenting of it for you. */ close_single_paragraph (); indented_fill = filling_enabled = 1; last_item_output_position = output_position; } } free (rest_of_line); } else { no_insertion: line_error (_("%c%s found outside of an insertion block"), COMMAND_PREFIX, command); } } void cm_itemx () { itemx_flag++; cm_item (); itemx_flag--; } diff --git a/contrib/texinfo/makeinfo/insertion.h b/contrib/texinfo/makeinfo/insertion.h index 6f4a24b79267..51540b223565 100644 --- a/contrib/texinfo/makeinfo/insertion.h +++ b/contrib/texinfo/makeinfo/insertion.h @@ -1,61 +1,61 @@ /* insertion.h -- declarations for insertion.c. - $Id: insertion.h,v 1.6 1999/07/06 23:12:58 karl Exp $ + $Id: insertion.h,v 1.8 2001/06/30 00:29:41 karl Exp $ - Copyright (C) 1998, 99 Free Software Foundation, Inc. + Copyright (C) 1998, 99, 2001 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. */ #ifndef INSERTION_H #define INSERTION_H /* Must match list in insertion.c. */ enum insertion_type -{ +{ cartouche, defcv, deffn, defivar, defmac, defmethod, defop, defopt, defspec, deftp, deftypefn, deftypefun, deftypeivar, deftypemethod, deftypeop, deftypevar, deftypevr, defun, defvar, defvr, detailmenu, - direntry, display, enumerate, example, flushleft, flushright, format, - ftable, group, ifclear, ifhtml, ifinfo, ifnothtml, ifnotinfo, - ifnottex, ifset, iftex, itemize, lisp, menu, multitable, quotation, - rawhtml, rawtex, smalldisplay, smallexample, smallformat, smalllisp, - table, tex, vtable, bad_type + direntry, display, documentdescription, enumerate, example, flushleft, + flushright, format, ftable, group, ifclear, ifhtml, ifinfo, ifnothtml, + ifnotinfo, ifnottex, ifset, iftex, itemize, lisp, menu, multitable, + quotation, rawhtml, rawtex, smalldisplay, smallexample, smallformat, + smalllisp, verbatim, table, tex, vtable, bad_type }; 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; extern int insertion_level; extern INSERTION_ELT *insertion_stack; extern int in_menu; extern int in_detailmenu; extern int had_menu_commentary; extern int in_paragraph; extern void command_name_condition (); extern void cm_ifnothtml (), cm_ifhtml(), cm_html (); extern void cm_ifinfo (), cm_ifnotinfo (); extern void cm_ifnottex (), cm_iftex (), cm_tex (); #endif /* !INSERTION_H */ diff --git a/contrib/texinfo/makeinfo/lang.c b/contrib/texinfo/makeinfo/lang.c index eeb9ef582a4f..468bed80b1f0 100644 --- a/contrib/texinfo/makeinfo/lang.c +++ b/contrib/texinfo/makeinfo/lang.c @@ -1,415 +1,698 @@ -/* lang.c -- language depend behaviour (startpoint) - $Id: lang.c,v 1.11 1999/07/13 21:16:29 karl Exp $ +/* lang.c -- language-dependent support. + $Id: lang.c,v 1.14 2001/09/11 18:04:35 karl Exp $ - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 01 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 Karl Heinz Marbaise . */ + Originally written by Karl Heinz Marbaise . */ #include "system.h" #include "cmds.h" #include "lang.h" #include "makeinfo.h" +#include "xml.h" /* Current document encoding. */ -char *document_encoding = NULL; +encoding_code_type document_encoding_code = no_encoding; /* Current language code; default is English. */ language_code_type language_code = en; -language_struct language_table[] = { +/* Translation table between HTML and ISO Codes. The last item is + hopefully the Unicode. It might be possible that those Unicodes are + not correct, cause I didn't check them. kama */ +iso_map_type iso8859_1_map [] = { + { "nbsp", 0xA0, 0x00A0 }, + { "iexcl", 0xA1, 0x00A1 }, + { "cent", 0xA2, 0x00A2 }, + { "pound", 0xA3, 0x00A3 }, + { "curren", 0xA4, 0x00A4 }, + { "yen", 0xA5, 0x00A5 }, + { "brkbar", 0xA6, 0x00A6 }, + { "sect", 0xA7, 0x00A7 }, + { "uml", 0xA8, 0x00A8 }, + { "copy", 0xA9, 0x00A9 }, + { "ordf", 0xAA, 0x00AA }, + { "laquo", 0xAB, 0x00AB }, + { "not", 0xAC, 0x00AC }, + { "shy", 0xAD, 0x00AD }, + { "reg", 0xAE, 0x00AE }, + { "hibar", 0xAF, 0x00AF }, + { "deg", 0xB0, 0x00B0 }, + { "plusmn", 0xB1, 0x00B1 }, + { "sup2", 0xB2, 0x00B2 }, + { "sup3", 0xB3, 0x00B3 }, + { "acute", 0xB4, 0x00B4 }, + { "micro", 0xB5, 0x00B5 }, + { "para", 0xB6, 0x00B6 }, + { "middot", 0xB7, 0x00B7 }, + { "cedil", 0xB8, 0x00B8 }, + { "sup1", 0xB9, 0x00B9 }, + { "ordm", 0xBA, 0x00BA }, + { "raquo", 0xBB, 0x00BB }, + { "frac14", 0xBC, 0x00BC }, + { "frac12", 0xBD, 0x00BD }, + { "frac34", 0xBE, 0x00BE }, + { "iquest", 0xBF, 0x00BF }, + { "Agrave", 0xC0, 0x00C0 }, + { "Aacute", 0xC1, 0x00C1 }, + { "Acirc", 0xC2, 0x00C2 }, + { "Atilde", 0xC3, 0x00C3 }, + { "Auml", 0xC4, 0x00C4 }, + { "Aring", 0xC5, 0x00C5 }, + { "AElig", 0xC6, 0x00C6 }, + { "Ccedil", 0xC7, 0x00C7 }, + { "Ccedil", 0xC7, 0x00C7 }, + { "Egrave", 0xC8, 0x00C8 }, + { "Eacute", 0xC9, 0x00C9 }, + { "Ecirc", 0xCA, 0x00CA }, + { "Euml", 0xCB, 0x00CB }, + { "Igrave", 0xCC, 0x00CC }, + { "Iacute", 0xCD, 0x00CD }, + { "Icirc", 0xCE, 0x00CE }, + { "Iuml", 0xCF, 0x00CF }, + { "ETH", 0xD0, 0x00D0 }, /* I don't know ;-( */ + { "Ntilde", 0xD1, 0x00D1 }, + { "Ograve", 0xD2, 0x00D2 }, + { "Oacute", 0xD3, 0x00D3 }, + { "Ocirc", 0xD4, 0x00D4 }, + { "Otilde", 0xD5, 0x00D5 }, + { "Ouml", 0xD6, 0x00D6 }, + { "times", 0xD7, 0x00D7 }, + { "Oslash", 0xD8, 0x00D8 }, + { "Ugrave", 0xD9, 0x00D9 }, + { "Uacute", 0xDA, 0x00DA }, + { "Ucirc", 0xDB, 0x00DB }, + { "Uuml", 0xDC, 0x00DC }, + { "Yacute", 0xDD, 0x00DD }, + { "THORN", 0xDE, 0x00DE }, + { "szlig", 0xDF, 0x00DF }, + { "agrave", 0xE0, 0x00E0 }, + { "aacute", 0xE1, 0x00E1 }, + { "acirc", 0xE2, 0x00E2 }, + { "atilde", 0xE3, 0x00E3 }, + { "auml", 0xE4, 0x00E4 }, + { "aring", 0xE5, 0x00E5 }, + { "aelig", 0xE6, 0x00E6 }, + { "ccedil", 0xE7, 0x00E7 }, + { "egrave", 0xE8, 0x00E8 }, + { "eacute", 0xE9, 0x00E9 }, + { "ecirc", 0xEA, 0x00EA }, + { "euml", 0xEB, 0x00EB }, + { "igrave", 0xEC, 0x00EC }, + { "iacute", 0xED, 0x00ED }, + { "icirc", 0xEE, 0x00EE }, + { "iuml", 0xEF, 0x00EF }, + { "eth", 0xF0, 0x00F0 }, + { "ntilde", 0xF1, 0x00F1 }, + { "ograve", 0xF2, 0x00F2 }, + { "oacute", 0xF3, 0x00F3 }, + { "ocirc", 0xF4, 0x00F4 }, + { "otilde", 0xF5, 0x00F5 }, + { "ouml", 0xF6, 0x00F6 }, + { "divide", 0xF7, 0x00F7 }, + { "oslash", 0xF8, 0x00F8 }, + { "ugrave", 0xF9, 0x00F9 }, + { "uacute", 0xFA, 0x00FA }, + { "ucirc", 0xFB, 0x00FB }, + { "uuml", 0xFC, 0x00FC }, + { "yacute", 0xFD, 0x00FD }, + { "thorn", 0xFE, 0x00FE }, + { "yuml", 0xFF, 0x00FF } +}; + +/* This might be put into structure below and NOT coded via define, + because some translation tables could contain different numbers of + characters, but for now it suffices. */ +#define ISO_MAP_SIZE (sizeof (iso8859_1_map) / sizeof (iso8859_1_map[0])) + +encoding_type encoding_table[] = { + { no_encoding, "(no encoding)", NULL }, + { ISO_8859_1, "ISO-8859-1", (iso_map_type *) iso8859_1_map }, + { ISO_8859_2, "ISO-8859-2", NULL }, + { ISO_8859_3, "ISO-8859-3", NULL }, + { ISO_8859_4, "ISO-8859-4", NULL }, + { ISO_8859_5, "ISO-8859-5", NULL }, + { ISO_8859_6, "ISO-8859-6", NULL }, + { ISO_8859_7, "ISO-8859-7", NULL }, + { ISO_8859_8, "ISO-8859-8", NULL }, + { ISO_8859_9, "ISO-8859-9", NULL }, + { ISO_8859_10, "ISO-8859-10", NULL }, + { ISO_8859_11, "ISO-8859-11", NULL }, + { ISO_8859_12, "ISO-8859-12", NULL }, + { ISO_8859_13, "ISO-8859-13", NULL }, + { ISO_8859_14, "ISO-8859-14", NULL }, + { ISO_8859_15, "ISO-8859-15", NULL }, + { last_encoding_code, NULL, NULL } +}; + + +language_type language_table[] = { { aa, "aa", "Afar" }, { ab, "ab", "Abkhazian" }, { af, "af", "Afrikaans" }, { am, "am", "Amharic" }, { ar, "ar", "Arabic" }, { as, "as", "Assamese" }, { ay, "ay", "Aymara" }, { az, "az", "Azerbaijani" }, { ba, "ba", "Bashkir" }, { be, "be", "Byelorussian" }, { bg, "bg", "Bulgarian" }, { bh, "bh", "Bihari" }, { bi, "bi", "Bislama" }, { bn, "bn", "Bengali; Bangla" }, { bo, "bo", "Tibetan" }, { br, "br", "Breton" }, { ca, "ca", "Catalan" }, { co, "co", "Corsican" }, { cs, "cs", "Czech" }, { cy, "cy", "Welsh" }, { da, "da", "Danish" }, { de, "de", "German" }, { dz, "dz", "Bhutani" }, { el, "el", "Greek" }, { en, "en", "English" }, { eo, "eo", "Esperanto" }, { es, "es", "Spanish" }, { et, "et", "Estonian" }, { eu, "eu", "Basque" }, { fa, "fa", "Persian" }, { fi, "fi", "Finnish" }, { fj, "fj", "Fiji" }, { fo, "fo", "Faroese" }, { fr, "fr", "French" }, { fy, "fy", "Frisian" }, { ga, "ga", "Irish" }, { gd, "gd", "Scots Gaelic" }, { gl, "gl", "Galician" }, { gn, "gn", "Guarani" }, { gu, "gu", "Gujarati" }, { ha, "ha", "Hausa" }, { he, "he", "Hebrew" } /* (formerly iw) */, { hi, "hi", "Hindi" }, { hr, "hr", "Croatian" }, { hu, "hu", "Hungarian" }, { hy, "hy", "Armenian" }, { ia, "ia", "Interlingua" }, { id, "id", "Indonesian" } /* (formerly in) */, { ie, "ie", "Interlingue" }, { ik, "ik", "Inupiak" }, { is, "is", "Icelandic" }, { it, "it", "Italian" }, { iu, "iu", "Inuktitut" }, { ja, "ja", "Japanese" }, { jw, "jw", "Javanese" }, { ka, "ka", "Georgian" }, { kk, "kk", "Kazakh" }, { kl, "kl", "Greenlandic" }, { km, "km", "Cambodian" }, { kn, "kn", "Kannada" }, { ko, "ko", "Korean" }, { ks, "ks", "Kashmiri" }, { ku, "ku", "Kurdish" }, { ky, "ky", "Kirghiz" }, { la, "la", "Latin" }, { ln, "ln", "Lingala" }, { lo, "lo", "Laothian" }, { lt, "lt", "Lithuanian" }, { lv, "lv", "Latvian, Lettish" }, { mg, "mg", "Malagasy" }, { mi, "mi", "Maori" }, { mk, "mk", "Macedonian" }, { ml, "ml", "Malayalam" }, { mn, "mn", "Mongolian" }, { mo, "mo", "Moldavian" }, { mr, "mr", "Marathi" }, { ms, "ms", "Malay" }, { mt, "mt", "Maltese" }, { my, "my", "Burmese" }, { na, "na", "Nauru" }, { ne, "ne", "Nepali" }, { nl, "nl", "Dutch" }, { no, "no", "Norwegian" }, { oc, "oc", "Occitan" }, { om, "om", "(Afan) Oromo" }, { or, "or", "Oriya" }, { pa, "pa", "Punjabi" }, { pl, "pl", "Polish" }, { ps, "ps", "Pashto, Pushto" }, { pt, "pt", "Portuguese" }, { qu, "qu", "Quechua" }, { rm, "rm", "Rhaeto-Romance" }, { rn, "rn", "Kirundi" }, { ro, "ro", "Romanian" }, { ru, "ru", "Russian" }, { rw, "rw", "Kinyarwanda" }, { sa, "sa", "Sanskrit" }, { sd, "sd", "Sindhi" }, { sg, "sg", "Sangro" }, { sh, "sh", "Serbo-Croatian" }, { si, "si", "Sinhalese" }, { sk, "sk", "Slovak" }, { sl, "sl", "Slovenian" }, { sm, "sm", "Samoan" }, { sn, "sn", "Shona" }, { so, "so", "Somali" }, { sq, "sq", "Albanian" }, { sr, "sr", "Serbian" }, { ss, "ss", "Siswati" }, { st, "st", "Sesotho" }, { su, "su", "Sundanese" }, { sv, "sv", "Swedish" }, { sw, "sw", "Swahili" }, { ta, "ta", "Tamil" }, { te, "te", "Telugu" }, { tg, "tg", "Tajik" }, { th, "th", "Thai" }, { ti, "ti", "Tigrinya" }, { tk, "tk", "Turkmen" }, { tl, "tl", "Tagalog" }, { tn, "tn", "Setswana" }, { to, "to", "Tonga" }, { tr, "tr", "Turkish" }, { ts, "ts", "Tsonga" }, { tt, "tt", "Tatar" }, { tw, "tw", "Twi" }, { ug, "ug", "Uighur" }, { uk, "uk", "Ukrainian" }, { ur, "ur", "Urdu" }, { uz, "uz", "Uzbek" }, { vi, "vi", "Vietnamese" }, { vo, "vo", "Volapuk" }, { wo, "wo", "Wolof" }, { xh, "xh", "Xhosa" }, { yi, "yi", "Yiddish" } /* (formerly ji) */, { yo, "yo", "Yoruba" }, { za, "za", "Zhuang" }, { zh, "zh", "Chinese" }, { zu, "zu", "Zulu" }, { last_language_code, NULL, NULL } }; + + /* @documentlanguage. Maybe we'll do something useful with this in the future. For now, we just recognize it. */ void cm_documentlanguage () { language_code_type c; - char *lang_arg; + char *lang_arg; /* Read the line with the language code on it. */ - get_rest_of_line (1, &lang_arg); + get_rest_of_line (0, &lang_arg); /* Linear search is fine these days. */ for (c = aa; c != last_language_code; c++) { if (strcmp (lang_arg, language_table[c].abbrev) == 0) { /* Set current language code. */ language_code = c; break; } } /* If we didn't find this code, complain. */ if (c == last_language_code) warning (_("%s is not a valid ISO 639 language code"), lang_arg); free (lang_arg); } -/* @documentencoding. Set global. */ +/* Search through the encoding table for the given character, returning + its equivalent. */ + +static int +cm_search_iso_map (html) + char *html; +{ + int i; + iso_map_type *iso = encoding_table[document_encoding_code].isotab; + + /* If no conversion table for this encoding, quit. */ + if (!iso) + return -1; + + for (i = 0; i < ISO_MAP_SIZE; i++) + { + if (strcmp (html, iso[i].html) == 0) + return i; + } + + return -1; +} + + +/* @documentencoding. Set the translation table. */ + void cm_documentencoding () { - get_rest_of_line (1, &document_encoding); + encoding_code_type enc; + char *enc_arg; + + get_rest_of_line (1, &enc_arg); + + /* See if we have this encoding. */ + for (enc = ISO_8859_1; enc != last_encoding_code; enc++) + { + if (strcasecmp (enc_arg, encoding_table[enc].ecname) == 0) + { + document_encoding_code = enc; + break; + } + } + + /* If we didn't find this code, complain. */ + if (enc == last_encoding_code) + warning (_("unrecogized encoding name `%s'"), enc_arg); + + else if (encoding_table[document_encoding_code].isotab == NULL) + warning (_("sorry, encoding `%s' not supported"), enc_arg); + + free (enc_arg); +} + + +/* If html or xml output, add HTML_STR to the output. If not html and + the user requested encoded output, add the real 8-bit character + corresponding to HTML_STR from the translation tables. Otherwise, + add INFO_STR. */ + +void +add_encoded_char (html_str, info_str) + char *html_str; + char *info_str; +{ + if (html || xml) + add_word_args ("&%s;", html_str); + else if (enable_encoding) + { + /* Look for HTML_STR in the current translation table. */ + int rc = cm_search_iso_map (html_str); + if (rc >= 0) + /* We found it, add the real character. */ + add_char (encoding_table[document_encoding_code].isotab[rc].bytecode); + else + { /* We didn't find it, that seems bad. */ + warning (_("invalid encoded character `%s'"), html_str); + add_word (info_str); + } + } + else + add_word (info_str); +} + + + +/* Output an accent for HTML or XML. */ + +static void +cm_accent_generic_html (arg, start, end, html_supported, single, + html_solo_standalone, html_solo) + int arg, start, end; + char *html_supported; + int single; + int html_solo_standalone; + char *html_solo; +{ + static int valid_html_accent; /* yikes */ + + if (arg == START) + { /* If HTML has good support for this character, use it. */ + if (strchr (html_supported, curchar ())) + { /* Yes; start with an ampersand. The character itself + will be added later in read_command (makeinfo.c). */ + valid_html_accent = 1; + add_char ('&'); + } + else + { + valid_html_accent = 0; + if (html_solo_standalone) + { /* No special HTML support, so produce standalone char. */ + add_word_args ("&%s;", html_solo); + } + else + /* If the html_solo does not exist as standalone character + (namely ˆ ` ˜), then we use + the single character version instead. */ + add_char (single); + } + } + else if (arg == END) + { /* Only if we saw a valid_html_accent can we use the full + HTML accent (umlaut, grave ...). */ + if (valid_html_accent) + { + add_word (html_solo); + add_char (';'); + } + } +} + + +static void +cm_accent_generic_no_headers (arg, start, end, single, html_solo) + int arg, start, end; + int single; + char *html_solo; +{ + if (arg == END) + { + if (no_encoding) + add_char (single); + else + { + int rc; + char *buffer = xmalloc (1 + strlen (html_solo) + 1); + buffer[0] = output_paragraph[end - 1]; + buffer[1] = 0; + strcat (buffer, html_solo); + + rc = cm_search_iso_map (buffer); + if (rc >= 0) + /* A little bit tricky ;-) + Here we replace the character which has + been inserted in read_command with + the value we have found in converting table + Does there exist a better way to do this? kama. */ + output_paragraph[end - 1] + = encoding_table[document_encoding_code].isotab[rc].bytecode; + else + { /* If we didn't find a translation for this character, + put the single instead. E.g., &Xuml; does not exist so X¨ + should be produced. */ + warning (_("%s is an invalid ISO code, using %c"), + buffer, single); + add_char (single); + } + + free (buffer); + } + } } /* Accent commands that take explicit arguments and don't have any special HTML support. */ void cm_accent (arg) int arg; { + int old_escape_html = escape_html; + escape_html = 0; if (arg == START) { /* Must come first to avoid ambiguity with overdot. */ if (strcmp (command, "udotaccent") == 0) /* underdot */ add_char ('.'); } else if (arg == END) { if (strcmp (command, "=") == 0) /* macron */ - add_word (html ? "¯" : "="); + add_word ((html || xml) ? "¯" : "="); else if (strcmp (command, "H") == 0) /* Hungarian umlaut */ add_word ("''"); else if (strcmp (command, "dotaccent") == 0) /* overdot */ add_meta_char ('.'); else if (strcmp (command, "ringaccent") == 0) /* ring */ add_char ('*'); else if (strcmp (command, "tieaccent") == 0) /* long tie */ add_char ('['); else if (strcmp (command, "u") == 0) /* breve */ add_char ('('); else if (strcmp (command, "ubaraccent") == 0) /* underbar */ add_char ('_'); else if (strcmp (command, "v") == 0) /* hacek/check */ - add_word (html ? "<" : "<"); + add_word ((html || xml) ? "<" : "<"); } + escape_html = old_escape_html; } /* Common routine for the accent characters that have support in HTML. If the character being accented is in the HTML_SUPPORTED set, then produce &CHTML_SOLO;, for example, Ä for an A-umlaut. If not in HTML_SUPPORTED, just produce &HTML_SOLO;X for the best we can do with - at an X-umlaut. Finally, if not producing HTML, just use SINGLE, a + at an X-umlaut. If not producing HTML, just use SINGLE, a character such as " which is the best plain text representation we - can manage. If HTML_SOLO_STANDALONE is zero the given HTML_SOLO - does not exist as valid standalone character in HTML. */ + can manage. If HTML_SOLO_STANDALONE is nonzero the given HTML_SOLO + exists as valid standalone character in HTML, e.g., ¨. */ static void cm_accent_generic (arg, start, end, html_supported, single, html_solo_standalone, html_solo) int arg, start, end; char *html_supported; int single; int html_solo_standalone; char *html_solo; { - if (html) - { - static int valid_html_accent; - - if (arg == START) - { /* If HTML has good support for this character, use it. */ - if (strchr (html_supported, curchar ())) - { /* Yes; start with an ampersand. The character itself - will be added later in read_command (makeinfo.c). */ - add_char ('&'); - valid_html_accent = 1; - } - else - { /* No special HTML support, so produce standalone char. */ - valid_html_accent = 0; - if (html_solo_standalone) - { - add_char ('&'); - add_word (html_solo); - add_char (';'); - } - else - /* If the html_solo does not exist as standalone character - (namely ˆ ` ˜), then we use - the single character version instead. */ - add_char (single); - } - } - else if (arg == END) - { /* Only if we saw a valid_html_accent can we use the full - HTML accent (umlaut, grave ...). */ - if (valid_html_accent) - { - add_word (html_solo); - add_char (';'); - } - } - } + if (html || xml) + cm_accent_generic_html (arg, start, end, html_supported, + single, html_solo_standalone, html_solo); + else if (no_headers) + cm_accent_generic_no_headers (arg, start, end, single, html_solo); else if (arg == END) - { /* Not producing HTML, so just use the normal character. */ - add_char (single); + { + if (enable_encoding) + /* use 8-bit if available */ + cm_accent_generic_no_headers (arg, start, end, single, html_solo); + else + /* use regular character */ + add_char (single); } } void cm_accent_umlaut (arg, start, end) int arg, start, end; { cm_accent_generic (arg, start, end, "aouAOUEeIiy", '"', 1, "uml"); } void cm_accent_acute (arg, start, end) int arg, start, end; { cm_accent_generic (arg, start, end, "AEIOUYaeiouy", '\'', 1, "acute"); } void cm_accent_cedilla (arg, start, end) int arg, start, end; { cm_accent_generic (arg, start, end, "Cc", ',', 1, "cedil"); } void cm_accent_hat (arg, start, end) int arg, start, end; { cm_accent_generic (arg, start, end, "AEIOUaeiou", '^', 0, "circ"); } void cm_accent_grave (arg, start, end) int arg, start, end; { cm_accent_generic (arg, start, end, "AEIOUaeiou", '`', 0, "grave"); } void cm_accent_tilde (arg, start, end) int arg, start, end; { - cm_accent_generic (arg, start, end, "AOano", '~', 0, "tilde"); + cm_accent_generic (arg, start, end, "ANOano", '~', 0, "tilde"); } /* Non-English letters/characters that don't insert themselves. */ void cm_special_char (arg) { + int old_escape_html = escape_html; + escape_html = 0; + if (arg == START) { if ((*command == 'L' || *command == 'l' || *command == 'O' || *command == 'o') && command[1] == 0) { /* Lslash lslash Oslash oslash. Lslash and lslash aren't supported in HTML. */ - if (html && (command[0] == 'O' || command[0] == 'o')) - add_word_args ("&%cslash;", command[0]); + if ((html || xml) && command[0] == 'O') + add_encoded_char ("Oslash", "/O"); + else if ((html || xml) && command[0] == 'o') + add_encoded_char ("oslash", "/o"); else add_word_args ("/%c", command[0]); } else if (strcmp (command, "exclamdown") == 0) - add_word (html ? "¡" : "!"); + add_encoded_char ("iexcl", "!"); else if (strcmp (command, "pounds") == 0) - add_word (html ? "£" : "#"); + add_encoded_char ("pound" , "#"); else if (strcmp (command, "questiondown") == 0) - add_word (html ? "¿" : "?"); + add_encoded_char ("iquest", "?"); else if (strcmp (command, "AE") == 0) - add_word (html ? "Æ" : command); + add_encoded_char ("AElig", command); else if (strcmp (command, "ae") == 0) - add_word (html ? "æ" : command); + add_encoded_char ("aelig", command); else if (strcmp (command, "OE") == 0) - add_word (html ? "Œ" : command); + add_word ("Œ", command); else if (strcmp (command, "oe") == 0) - add_word (html ? "œ" : command); + add_word ("œ", command); else if (strcmp (command, "AA") == 0) - add_word (html ? "Å" : command); + add_encoded_char ("Aring", command); else if (strcmp (command, "aa") == 0) - add_word (html ? "å" : command); + add_encoded_char ("aring", command); else if (strcmp (command, "ss") == 0) - add_word (html ? "ß" : command); + add_encoded_char ("szlig", command); else line_error ("cm_special_char internal error: command=@%s", command); } + escape_html = old_escape_html; } /* Dotless i or j. */ void cm_dotless (arg, start, end) int arg, start, end; { if (arg == END) { + xml_no_para --; 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. */ } + else + xml_no_para ++; } diff --git a/contrib/texinfo/makeinfo/lang.h b/contrib/texinfo/makeinfo/lang.h index 25bf0bd9c4bd..57d4946080fc 100644 --- a/contrib/texinfo/makeinfo/lang.h +++ b/contrib/texinfo/makeinfo/lang.h @@ -1,86 +1,137 @@ /* lang.h -- declarations for language codes etc. - $Id: lang.h,v 1.6 1999/03/22 20:07:34 karl Exp $ + $Id: lang.h,v 1.7 2001/09/11 18:04:29 karl Exp $ - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2001 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 Karl Heinz Marbaise . */ + Originally written by Karl Heinz Marbaise . */ #ifndef LANG_H #define LANG_H -/* The langauge code which can be changed through @documentlanguage - * Actualy Info does not support this (may be in the future) ;-) - * Default for language code is en (english!) kama - * These code should ISO 639 two letter codes. +/* The language code which can be changed through @documentlanguage + * Actually we don't currently support this (may be in the future) ;-) + * These code are the ISO-639 two letter codes. */ typedef enum { aa, ab, af, am, ar, as, ay, az, ba, be, bg, bh, bi, bn, bo, br, ca, co, cs, cy, da, de, dz, el, en, eo, es, et, eu, fa, fi, fj, fo, fr, fy, ga, gd, gl, gn, gu, ha, he, hi, hr, hu, hy, ia, id, ie, ik, is, it, iu, ja, jw, ka, kk, kl, km, kn, ko, ks, ku, ky, la, ln, lo, lt, lv, mg, mi, mk, ml, mn, mo, mr, ms, mt, my, na, ne, nl, no, oc, om, or, pa, pl, ps, pt, qu, rm, rn, ro, ru, rw, sa, sd, sg, sh, si, sk, sl, sm, sn, so, sq, sr, ss, st, su, sv, sw, ta, te, tg, th, ti, tk, tl, tn, to, tr, ts, tt, tw, ug, uk, ur, uz, vi, vo, wo, xh, yi, yo, za, zh, zu, last_language_code } language_code_type; /* The current language code. */ extern language_code_type language_code; -/* Information about all valid languages. */ + +/* Information for each language. */ typedef struct { language_code_type lc; /* language code as enum type */ char *abbrev; /* two letter language code */ char *desc; /* full name for language code */ -} language_struct; -extern language_struct language_table[]; +} language_type; + +extern language_type language_table[]; + + + +/* The document encoding. This is usefull if we working e.g. + * with german Texinfo so we can produce correct german umlaut + * while creating output (--no-headers ASCII like). + */ +typedef enum { + no_encoding, + ISO_8859_1, /* default for en, de, */ + ISO_8859_2, /* actualy not supported like the rest below */ + ISO_8859_3, + ISO_8859_4, + ISO_8859_5, + ISO_8859_6, + ISO_8859_7, + ISO_8859_8, + ISO_8859_9, + ISO_8859_10, + ISO_8859_11, + ISO_8859_12, + ISO_8859_13, + ISO_8859_14, + ISO_8859_15, + last_encoding_code +} encoding_code_type; + +/* The current document encoding, or null if not set. */ +extern encoding_code_type document_encoding_code; + -/* The encoding, or null if not set. */ -extern char *document_encoding; +/* Maps an HTML abbreviation to ISO and Unicode codes for a given code. */ + +typedef unsigned short int unicode_t; /* should be 16 bits */ +typedef unsigned char byte_t; + +typedef struct +{ + char *html; /* HTML equivalent like umlaut auml => ä */ + byte_t bytecode; /* 8-Bit Code (ISO 8859-1,...) */ + unicode_t unicode; /* Unicode in U+ convention */ +} iso_map_type; + +/* Information about the document encoding. */ +typedef struct +{ + encoding_code_type ec; /* document encoding type (see above enum) */ + char *ecname; /* encoding name like ISO-8859-1 */ + iso_map_type *isotab; /* address of ISO translation table */ +} encoding_type; +/* Table with all the encoding codes that we recognize. */ +extern encoding_type encoding_table[]; + /* The commands. */ extern void cm_documentlanguage (), cm_documentencoding (); /* Accents, other non-English characters. */ void cm_accent (), cm_special_char (), cm_dotless (); extern void cm_accent_umlaut (), cm_accent_acute (), cm_accent_cedilla (), cm_accent_hat (), cm_accent_grave (), cm_accent_tilde (); #endif /* not LANG_H */ diff --git a/contrib/texinfo/makeinfo/macro.c b/contrib/texinfo/makeinfo/macro.c index 8c89da257106..2bba3782efa2 100644 --- a/contrib/texinfo/makeinfo/macro.c +++ b/contrib/texinfo/makeinfo/macro.c @@ -1,1114 +1,1114 @@ /* macro.c -- user-defined macros for Texinfo. - $Id: macro.c,v 1.10 1999/08/17 21:06:35 karl Exp $ + $Id: macro.c,v 1.12 2002/03/02 15:05:21 karl Exp $ - Copyright (C) 1998, 99 Free Software Foundation, Inc. + Copyright (C) 1998, 99, 2002 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 "system.h" #include "cmds.h" #include "macro.h" #include "makeinfo.h" #include "insertion.h" /* If non-NULL, this is an output stream to write the full macro expansion of the input text to. The result is another texinfo file, but missing @include, @infoinclude, @macro, and macro invocations. Instead, all of the text is placed within the file. */ FILE *macro_expansion_output_stream = NULL; /* Output file for -E. */ char *macro_expansion_filename; /* Nonzero means a macro string is in execution, as opposed to a file. */ int me_executing_string = 0; /* Nonzero means we want only to expand macros and leave everything else intact. */ int only_macro_expansion = 0; static ITEXT **itext_info = NULL; static int itext_size = 0; /* Return the arglist on the current line. This can behave in two different ways, depending on the variable BRACES_REQUIRED_FOR_MACRO_ARGS. */ int braces_required_for_macro_args = 0; /* Array of macros and definitions. */ MACRO_DEF **macro_list = NULL; int macro_list_len = 0; /* Number of elements. */ int macro_list_size = 0; /* Number of slots in total. */ /* Return the length of the array in ARRAY. */ int array_len (array) char **array; { int i = 0; if (array) for (i = 0; array[i]; i++); return i; } void free_array (array) char **array; { if (array) { int i; for (i = 0; array[i]; i++) free (array[i]); free (array); } } /* Return the macro definition of NAME or NULL if NAME is not defined. */ MACRO_DEF * find_macro (name) char *name; { int i; MACRO_DEF *def; def = NULL; for (i = 0; macro_list && (def = macro_list[i]); i++) { if ((!def->inhibited) && (strcmp (def->name, name) == 0)) break; } return def; } /* Add the macro NAME with ARGLIST and BODY to the list of defined macros. SOURCE_FILE is the name of the file where this definition can be found, and SOURCE_LINENO is the line number within that file. If a macro already exists with NAME, then a warning is produced, and that previous definition is overwritten. */ void add_macro (name, arglist, body, source_file, source_lineno, flags) char *name; char **arglist; char *body; char *source_file; int source_lineno, flags; { MACRO_DEF *def; def = find_macro (name); if (!def) { if (macro_list_len + 2 >= macro_list_size) macro_list = xrealloc (macro_list, ((macro_list_size += 10) * sizeof (MACRO_DEF *))); macro_list[macro_list_len] = xmalloc (sizeof (MACRO_DEF)); macro_list[macro_list_len + 1] = NULL; def = macro_list[macro_list_len]; macro_list_len += 1; def->name = name; } else { char *temp_filename = input_filename; int temp_line = line_number; warning (_("macro `%s' previously defined"), name); input_filename = def->source_file; line_number = def->source_lineno; warning (_("here is the previous definition of `%s'"), name); input_filename = temp_filename; line_number = temp_line; if (def->arglist) { int i; for (i = 0; def->arglist[i]; i++) free (def->arglist[i]); free (def->arglist); } free (def->source_file); free (def->body); } def->source_file = xstrdup (source_file); def->source_lineno = source_lineno; def->body = body; def->arglist = arglist; def->inhibited = 0; def->flags = flags; } char ** get_brace_args (quote_single) int quote_single; { char **arglist, *word; int arglist_index, arglist_size; int character, escape_seen, start; int depth = 1; /* There is an arglist in braces here, so gather the args inside of it. */ skip_whitespace_and_newlines (); input_text_offset++; arglist = NULL; arglist_index = arglist_size = 0; get_arg: skip_whitespace_and_newlines (); start = input_text_offset; escape_seen = 0; while ((character = curchar ())) { if (character == '\\') { input_text_offset += 2; escape_seen = 1; } else if (character == '{') { depth++; input_text_offset++; } else if ((character == ',' && !quote_single) || ((character == '}') && depth == 1)) { int len = input_text_offset - start; if (len || (character != '}')) { word = xmalloc (1 + len); memcpy (word, input_text + start, len); word[len] = 0; /* Clean up escaped characters. */ if (escape_seen) { int i; for (i = 0; word[i]; i++) if (word[i] == '\\') memmove (word + i, word + i + 1, 1 + strlen (word + i + 1)); } if (arglist_index + 2 >= arglist_size) arglist = xrealloc (arglist, (arglist_size += 10) * sizeof (char *)); arglist[arglist_index++] = word; arglist[arglist_index] = NULL; } input_text_offset++; if (character == '}') break; else goto get_arg; } else if (character == '}') { depth--; input_text_offset++; } else { input_text_offset++; if (character == '\n') line_number++; } } return arglist; } char ** get_macro_args (def) MACRO_DEF *def; { int i; char *word; /* Quickly check to see if this macro has been invoked with any arguments. If not, then don't skip any of the following whitespace. */ for (i = input_text_offset; i < input_text_length; i++) if (!cr_or_whitespace (input_text[i])) break; if (input_text[i] != '{') { if (braces_required_for_macro_args) { return NULL; } else { /* Braces are not required to fill out the macro arguments. If this macro takes one argument, it is considered to be the remainder of the line, sans whitespace. */ if (def->arglist && def->arglist[0] && !def->arglist[1]) { char **arglist; get_rest_of_line (0, &word); if (input_text[input_text_offset - 1] == '\n') { input_text_offset--; line_number--; } /* canon_white (word); */ arglist = xmalloc (2 * sizeof (char *)); arglist[0] = word; arglist[1] = NULL; return arglist; } else { /* The macro either took no arguments, or took more than one argument. In that case, it must be invoked with arguments surrounded by braces. */ return NULL; } } } return get_brace_args (def->flags & ME_QUOTE_ARG); } /* Substitute actual parameters for named parameters in body. The named parameters which appear in BODY must by surrounded reverse slashes, as in \foo\. */ char * apply (named, actuals, body) char **named, **actuals, *body; { int i; int new_body_index, new_body_size; char *new_body, *text; int length_of_actuals; length_of_actuals = array_len (actuals); new_body_size = strlen (body); new_body = xmalloc (1 + new_body_size); /* Copy chars from BODY into NEW_BODY. */ i = 0; new_body_index = 0; while (body[i]) { /* Anything but a \ is easy. */ if (body[i] != '\\') new_body[new_body_index++] = body[i++]; else { /* Snarf parameter name, check against named parameters. */ char *param; int param_start, which, len; param_start = ++i; while (body[i] && body[i] != '\\') i++; len = i - param_start; param = xmalloc (1 + len); memcpy (param, body + param_start, len); param[len] = 0; if (body[i]) /* move past \ */ i++; /* Now check against named parameters. */ for (which = 0; named && named[which]; which++) if (STREQ (named[which], param)) break; if (named && named[which]) { text = which < length_of_actuals ? actuals[which] : NULL; if (!text) text = ""; len = strlen (text); } else { /* not a parameter, either it's \\ (if len==0) or an error. In either case, restore one \ at least. */ if (len) { warning (_("\\ in macro expansion followed by `%s' instead of \\ or parameter name"), param); } len++; text = xmalloc (1 + len); sprintf (text, "\\%s", param); } if (strlen (param) + 2 < len) { new_body_size += len + 1; new_body = xrealloc (new_body, new_body_size); } free (param); strcpy (new_body + new_body_index, text); new_body_index += len; if (!named || !named[which]) free (text); } } new_body[new_body_index] = 0; return new_body; } /* Expand macro passed in DEF, a pointer to a MACRO_DEF, and return its expansion as a string. */ char * expand_macro (def) MACRO_DEF *def; { char **arglist; int num_args; char *execution_string = NULL; int start_line = line_number; /* Find out how many arguments this macro definition takes. */ num_args = array_len (def->arglist); /* Gather the arguments present on the line if there are any. */ arglist = get_macro_args (def); if (num_args < array_len (arglist)) { free_array (arglist); line_error (_("Macro `%s' called on line %d with too many args"), def->name, start_line); return execution_string; } if (def->body) execution_string = apply (def->arglist, arglist, def->body); free_array (arglist); return execution_string; } /* Execute the macro passed in DEF, a pointer to a MACRO_DEF. */ void execute_macro (def) MACRO_DEF *def; { char *execution_string; int start_line = line_number, end_line; if (macro_expansion_output_stream && !executing_string && !me_inhibit_expansion) me_append_before_this_command (); execution_string = expand_macro (def); if (!execution_string) return; if (def->body) { /* Reset the line number to where the macro arguments began. This makes line numbers reported in error messages correct in case the macro arguments span several lines and the expanded arguments invoke other commands. */ end_line = line_number; line_number = start_line; if (macro_expansion_output_stream && !executing_string && !me_inhibit_expansion) { remember_itext (input_text, input_text_offset); me_execute_string (execution_string); } else execute_string ("%s", execution_string); free (execution_string); line_number = end_line; } } /* Read and remember the definition of a macro. If RECURSIVE is set, set the ME_RECURSE flag. MACTYPE is either "macro" or "rmacro", and tells us what the matching @end should be. */ static void define_macro (mactype, recursive) char *mactype; int recursive; { int i; char *name, **arglist, *body, *line, *last_end; int body_size, body_index; int depth = 1; int defining_line = line_number; int flags = 0; arglist = NULL; body = NULL; body_size = 0; body_index = 0; if (macro_expansion_output_stream && !executing_string) me_append_before_this_command (); skip_whitespace (); /* Get the name of the macro. This is the set of characters which are not whitespace and are not `{' immediately following the @macro. */ { int start = input_text_offset; int len; for (i = start; (i < input_text_length) && (input_text[i] != '{') && (!cr_or_whitespace (input_text[i])); i++); len = i - start; name = xmalloc (1 + len); memcpy (name, input_text + start, len); name[len] = 0; input_text_offset = i; } skip_whitespace (); /* It is not required that the definition of a macro includes an arglist. If not, don't try to get the named parameters, just use a null list. */ if (curchar () == '{') { int character; int arglist_index = 0, arglist_size = 0; int gathering_words = 1; char *word = NULL; /* Read the words inside of the braces which determine the arglist. These words will be replaced within the body of the macro at execution time. */ input_text_offset++; skip_whitespace_and_newlines (); while (gathering_words) { int len; for (i = input_text_offset; (character = input_text[i]); i++) { switch (character) { case '\n': line_number++; case ' ': case '\t': case ',': case '}': /* Found the end of the current arglist word. Save it. */ len = i - input_text_offset; word = xmalloc (1 + len); memcpy (word, input_text + input_text_offset, len); word[len] = 0; input_text_offset = i; /* Advance to the comma or close-brace that signified the end of the argument. */ while ((character = curchar ()) && character != ',' && character != '}') { input_text_offset++; if (character == '\n') line_number++; } /* Add the word to our list of words. */ if (arglist_index + 2 >= arglist_size) { arglist_size += 10; arglist = xrealloc (arglist, arglist_size * sizeof (char *)); } arglist[arglist_index++] = word; arglist[arglist_index] = NULL; break; } if (character == '}') { input_text_offset++; gathering_words = 0; break; } if (character == ',') { input_text_offset++; skip_whitespace_and_newlines (); i = input_text_offset - 1; } } } /* If we have exactly one argument, do @quote-arg implicitly. Not only does this match TeX's behavior (which can't feasibly be changed), but it's a good idea. */ if (arglist_index == 1) flags |= ME_QUOTE_ARG; } /* Read the text carefully until we find an "@end macro" which matches this one. The text in between is the body of the macro. */ skip_whitespace_and_newlines (); while (depth) { if ((input_text_offset + 9) > input_text_length) { - int temp_line = line_number; - line_number = defining_line; - line_error (_("%cend macro not found"), COMMAND_PREFIX); - line_number = temp_line; + file_line_error (input_filename, defining_line, + _("%cend macro not found"), COMMAND_PREFIX); return; } get_rest_of_line (0, &line); /* Handle commands only meaningful within a macro. */ if ((*line == COMMAND_PREFIX) && (depth == 1) && (strncmp (line + 1, "allow-recursion", 15) == 0) && (line[16] == 0 || whitespace (line[16]))) { for (i = 16; whitespace (line[i]); i++); strcpy (line, line + i); flags |= ME_RECURSE; if (!*line) { free (line); continue; } } if ((*line == COMMAND_PREFIX) && (depth == 1) && (strncmp (line + 1, "quote-arg", 9) == 0) && (line[10] == 0 || whitespace (line[10]))) { for (i = 10; whitespace (line[i]); i++); strcpy (line, line + i); if (arglist && arglist[0] && !arglist[1]) { flags |= ME_QUOTE_ARG; if (!*line) { free (line); continue; } } else line_error (_("@quote-arg only useful for single-argument macros")); } if (*line == COMMAND_PREFIX && (strncmp (line + 1, "macro ", 6) == 0 || strncmp (line + 1, "rmacro ", 7) == 0)) depth++; /* Incorrect implementation of nesting -- just check that the last @end matches what we started with. Since nested macros don't work in TeX anyway, this isn't worth the trouble to get right. */ if (*line == COMMAND_PREFIX && strncmp (line + 1, "end macro", 9) == 0) { depth--; last_end = "macro"; } if (*line == COMMAND_PREFIX && strncmp (line + 1, "end rmacro", 9) == 0) { depth--; last_end = "rmacro"; } if (depth) { if ((body_index + strlen (line) + 3) >= body_size) body = xrealloc (body, body_size += 3 + strlen (line)); strcpy (body + body_index, line); body_index += strlen (line); body[body_index++] = '\n'; body[body_index] = 0; } free (line); } /* Check that @end matched the macro command. */ if (!STREQ (last_end, mactype)) warning (_("mismatched @end %s with @%s"), last_end, mactype); /* If it was an empty macro like @macro foo @end macro create an empty body. (Otherwise, the macro is not expanded.) */ if (!body) { body = (char *)malloc(1); *body = 0; } /* We now have the name, the arglist, and the body. However, BODY includes the final newline which preceded the `@end macro' text. Delete it. */ if (body && strlen (body)) body[strlen (body) - 1] = 0; if (recursive) flags |= ME_RECURSE; add_macro (name, arglist, body, input_filename, defining_line, flags); if (macro_expansion_output_stream && !executing_string) remember_itext (input_text, input_text_offset); } void cm_macro () { define_macro ("macro", 0); } void cm_rmacro () { define_macro ("rmacro", 1); } /* Delete the macro with name NAME. The macro is deleted from the list, but it is also returned. If there was no macro defined, NULL is returned. */ static MACRO_DEF * delete_macro (name) char *name; { int i; MACRO_DEF *def; def = NULL; for (i = 0; macro_list && (def = macro_list[i]); i++) if (strcmp (def->name, name) == 0) { memmove (macro_list + i, macro_list + i + 1, ((macro_list_len + 1) - i) * sizeof (MACRO_DEF *)); macro_list_len--; break; } return def; } void cm_unmacro () { int i; char *line, *name; MACRO_DEF *def; if (macro_expansion_output_stream && !executing_string) me_append_before_this_command (); get_rest_of_line (0, &line); for (i = 0; line[i] && !whitespace (line[i]); i++); name = xmalloc (i + 1); memcpy (name, line, i); name[i] = 0; def = delete_macro (name); if (def) { free (def->source_file); free (def->name); free (def->body); if (def->arglist) { int i; for (i = 0; def->arglist[i]; i++) free (def->arglist[i]); free (def->arglist); } free (def); } free (line); free (name); if (macro_expansion_output_stream && !executing_string) remember_itext (input_text, input_text_offset); } /* How to output sections of the input file verbatim. */ /* Set the value of POINTER's offset to OFFSET. */ ITEXT * remember_itext (pointer, offset) char *pointer; int offset; { int i; ITEXT *itext = NULL; /* If we have no info, initialize a blank list. */ if (!itext_info) { itext_info = xmalloc ((itext_size = 10) * sizeof (ITEXT *)); for (i = 0; i < itext_size; i++) itext_info[i] = NULL; } /* If the pointer is already present in the list, then set the offset. */ for (i = 0; i < itext_size; i++) if ((itext_info[i]) && (itext_info[i]->pointer == pointer)) { itext = itext_info[i]; itext_info[i]->offset = offset; break; } if (i == itext_size) { /* Find a blank slot (or create a new one), and remember the pointer and offset. */ for (i = 0; i < itext_size; i++) if (itext_info[i] == NULL) break; /* If not found, then add some slots. */ if (i == itext_size) { int j; itext_info = xrealloc (itext_info, (itext_size += 10) * sizeof (ITEXT *)); for (j = i; j < itext_size; j++) itext_info[j] = NULL; } /* Now add the pointer and the offset. */ itext_info[i] = xmalloc (sizeof (ITEXT)); itext_info[i]->pointer = pointer; itext_info[i]->offset = offset; itext = itext_info[i]; } return itext; } /* Forget the input text associated with POINTER. */ void forget_itext (pointer) char *pointer; { int i; for (i = 0; i < itext_size; i++) if (itext_info[i] && (itext_info[i]->pointer == pointer)) { free (itext_info[i]); itext_info[i] = NULL; break; } } /* Append the text which appeared in input_text from the last offset to the character just before the command that we are currently executing. */ void me_append_before_this_command () { int i; for (i = input_text_offset; i && (input_text[i] != COMMAND_PREFIX); i--) ; maybe_write_itext (input_text, i); } /* Similar to execute_string, but only takes a single string argument, and remembers the input text location, etc. */ void me_execute_string (execution_string) char *execution_string; { int saved_escape_html = escape_html; int saved_in_paragraph = in_paragraph; escape_html = me_executing_string == 0; in_paragraph = 0; pushfile (); input_text_offset = 0; /* The following xstrdup is so we can relocate input_text at will. */ input_text = xstrdup (execution_string); input_filename = xstrdup (input_filename); input_text_length = strlen (execution_string); remember_itext (input_text, 0); me_executing_string++; reader_loop (); free (input_text); free (input_filename); popfile (); me_executing_string--; in_paragraph = saved_in_paragraph; escape_html = saved_escape_html; } /* A wrapper around me_execute_string which saves and restores variables important for output generation. This is called when we need to produce macro-expanded output for input which leaves no traces in the Info output. */ void me_execute_string_keep_state (execution_string, append_string) char *execution_string, *append_string; { int op_orig, opcol_orig, popen_orig; int fill_orig, newline_orig, indent_orig, meta_pos_orig; remember_itext (input_text, input_text_offset); op_orig = output_paragraph_offset; meta_pos_orig = meta_char_pos; opcol_orig = output_column; popen_orig = paragraph_is_open; fill_orig = filling_enabled; newline_orig = last_char_was_newline; filling_enabled = 0; indent_orig = no_indent; no_indent = 1; me_execute_string (execution_string); if (append_string) write_region_to_macro_output (append_string, 0, strlen (append_string)); output_paragraph_offset = op_orig; meta_char_pos = meta_pos_orig; output_column = opcol_orig; paragraph_is_open = popen_orig; filling_enabled = fill_orig; last_char_was_newline = newline_orig; no_indent = indent_orig; } /* Append the text which appears in input_text from the last offset to the current OFFSET. */ void append_to_expansion_output (offset) int offset; { int i; ITEXT *itext = NULL; for (i = 0; i < itext_size; i++) if (itext_info[i] && itext_info[i]->pointer == input_text) { itext = itext_info[i]; break; } if (!itext) return; if (offset > itext->offset) { write_region_to_macro_output (input_text, itext->offset, offset); remember_itext (input_text, offset); } } /* Only write this input text iff it appears in our itext list. */ void maybe_write_itext (pointer, offset) char *pointer; int offset; { int i; ITEXT *itext = NULL; for (i = 0; i < itext_size; i++) if (itext_info[i] && (itext_info[i]->pointer == pointer)) { itext = itext_info[i]; break; } if (itext && (itext->offset < offset)) { write_region_to_macro_output (itext->pointer, itext->offset, offset); remember_itext (pointer, offset); } } void write_region_to_macro_output (string, start, end) char *string; int start, end; { if (macro_expansion_output_stream) fwrite (string + start, 1, end - start, macro_expansion_output_stream); } /* Aliases. */ typedef struct alias_struct { char *alias; char *mapto; struct alias_struct *next; } alias_type; static alias_type *aliases; /* @alias */ void cm_alias () { alias_type *a = xmalloc (sizeof (alias_type)); skip_whitespace (); get_until_in_line (1, "=", &(a->alias)); + canon_white (a->alias); + discard_until ("="); skip_whitespace (); get_until_in_line (0, " ", &(a->mapto)); a->next = aliases; aliases = a; } /* Perform an alias expansion. Called from read_command. */ char * alias_expand (tok) char *tok; { alias_type *findit = aliases; while (findit) if (strcmp (findit->alias, tok) == 0) { free (tok); return alias_expand (xstrdup (findit->mapto)); } else findit = findit->next; return tok; } /* definfoenclose implementation. */ /* This structure is used to track enclosure macros. When an enclosure macro is recognized, a pointer to the enclosure block corresponding to its name is saved in the brace element for its argument. */ typedef struct enclose_struct { char *enclose; char *before; char *after; struct enclose_struct *next; } enclosure_type; static enclosure_type *enclosures; typedef struct enclosure_stack_struct { enclosure_type *current; struct enclosure_stack_struct *next; } enclosure_stack_type; static enclosure_stack_type *enclosure_stack; /* @definfoenclose */ void cm_definfoenclose () { enclosure_type *e = xmalloc (sizeof (enclosure_type)); skip_whitespace (); get_until_in_line (1, ",", &(e->enclose)); discard_until (","); get_until_in_line (0, ",", &(e->before)); discard_until (","); get_until_in_line (0, "\n", &(e->after)); e->next = enclosures; enclosures = e; } /* If TOK is an enclosure command, push it on the enclosure stack and return 1. Else return 0. */ int enclosure_command (tok) char *tok; { enclosure_type *findit = enclosures; while (findit) if (strcmp (findit->enclose, tok) == 0) { enclosure_stack_type *new = xmalloc (sizeof (enclosure_stack_type)); new->current = findit; new->next = enclosure_stack; enclosure_stack = new; return 1; } else findit = findit->next; return 0; } /* actually perform the enclosure expansion */ void enclosure_expand (arg, start, end) int arg, start, end; { if (arg == START) add_word (enclosure_stack->current->before); else { enclosure_stack_type *temp; add_word (enclosure_stack->current->after); temp = enclosure_stack; enclosure_stack = enclosure_stack->next; free (temp); } } diff --git a/contrib/texinfo/makeinfo/makeinfo.h b/contrib/texinfo/makeinfo/makeinfo.h index caff188ebe42..21aae89b4c80 100644 --- a/contrib/texinfo/makeinfo/makeinfo.h +++ b/contrib/texinfo/makeinfo/makeinfo.h @@ -1,260 +1,277 @@ /* makeinfo.h -- declarations for Makeinfo. - $Id: makeinfo.h,v 1.25 1999/09/18 18:09:22 karl Exp $ + $Id: makeinfo.h,v 1.31 2001/09/11 16:37:51 karl Exp $ - Copyright (C) 1996, 97, 98, 99 Free Software Foundation, Inc. + Copyright (C) 1996, 97, 98, 99, 2000, 01 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). */ #ifndef MAKEINFO_H #define MAKEINFO_H #ifdef COMPILING_MAKEINFO # define DECLARE(type,var,init) type var = init #else # define DECLARE(type,var,init) extern type var #endif /* Hardcoded per GNU standards, not dependent on argv[0]. */ DECLARE (char *, progname, "makeinfo"); enum reftype { menu_reference, followed_reference }; extern char *get_xref_token (); /* Nonzero means a string is in execution, as opposed to a file. */ DECLARE (int, executing_string, 0); /* Nonzero means to inhibit writing macro expansions to the output stream, because it has already been written. */ DECLARE (int, me_inhibit_expansion, 0); extern char *expansion (), *text_expansion (); /* Current output stream. */ DECLARE (FILE *, output_stream, NULL); DECLARE (char *, pretty_output_filename, NULL); /* Current output file name. */ DECLARE (char *, current_output_filename, NULL); /* Output paragraph buffer. */ DECLARE (unsigned char *, output_paragraph, NULL); /* Offset into OUTPUT_PARAGRAPH. */ DECLARE (int, output_paragraph_offset, 0); /* The output paragraph "cursor" horizontal position. */ DECLARE (int, output_column, 0); /* Position in the output file. */ DECLARE (int, output_position, 0); /* The offset into OUTPUT_PARAGRAPH where we have a meta character produced by a markup such as @code or @dfn. */ DECLARE (int, meta_char_pos, -1); /* Nonzero means output_paragraph contains text. */ DECLARE (int, paragraph_is_open, 0); /* Nonzero means that `start_paragraph' MUST be called before we pay any attention to `close_paragraph' calls. */ DECLARE (int, must_start_paragraph, 0); /* Nonzero means that we have seen "@top" once already. */ DECLARE (int, top_node_seen, 0); /* Nonzero means that we have seen a non-"@top" node already. */ DECLARE (int, non_top_node_seen, 0); /* Nonzero indicates that indentation is temporarily turned off. */ DECLARE (int, no_indent, 1); /* Nonzero indicates that filling a line also indents the new line. */ DECLARE (int, indented_fill, 0); /* Nonzero means forcing output text to be flushright. */ DECLARE (int, force_flush_right, 0); /* The amount of indentation to apply at the start of each line. */ DECLARE (int, current_indent, 0); /* The column at which long lines are broken. */ DECLARE (int, fill_column, 72); /* Nonzero means that words are not to be split, even in long lines. This gets changed for cm_w (). */ DECLARE (int, non_splitting_words, 0); /* Amount by which @example indentation increases/decreases. */ DECLARE (int, default_indentation_increment, 5); /* Nonzero means that we are currently hacking the insides of an insertion which would use a fixed width font. */ DECLARE (int, in_fixed_width_font, 0); /* Nonzero if we are currently processing a multitable command */ DECLARE (int, multitable_active, 0); /* Nonzero means that we're generating HTML. */ DECLARE (int, html, 0); +/* Nonzero means that we're generating XML. */ +DECLARE (int, xml, 0); + +/* Nonzero means that we're generating DocBook. */ +DECLARE (int, docbook, 0); + +/* Nonzero means true 8-bit output for Info and plain text. */ +DECLARE (int, enable_encoding, 0); + /* Nonzero means escape characters in HTML output. */ DECLARE (int, escape_html, 1); extern char *escape_string (); /* do HTML escapes */ /* Nonzero means that the use of paragraph_start_indent is inhibited. @example uses this to line up the left columns of the example text. A negative value for this variable is incremented each time it is used. @noindent uses this to inhibit indentation for a single paragraph. */ DECLARE (int, inhibit_paragraph_indentation, 0); /* Nonzero indicates that filling will take place on long lines. */ DECLARE (int, filling_enabled, 1); /* The current node's node name. */ DECLARE (char *, current_node, NULL); /* Command name in the process of being hacked. */ DECLARE (char *, command, NULL); +/* @documentdescription ... @end documentdescription. */ +DECLARE (char *, document_description, NULL); + /* Nonzero if the last character inserted has the syntax class of NEWLINE. */ DECLARE (int, last_char_was_newline, 1); /* The current input file state. */ DECLARE (char *, input_filename, (char *)NULL); DECLARE (char *, input_text, (char *)NULL); DECLARE (int, input_text_length, 0); DECLARE (int, input_text_offset, 0); DECLARE (int, line_number, 0); +DECLARE (char *, toplevel_output_filename, NULL); #define curchar() input_text[input_text_offset] /* A colon separated list of directories to search for files included with @include. This can be controlled with the `-I' option to makeinfo. */ DECLARE (char *, include_files_path, NULL); /* The filename of the current input file. This is never freed. */ DECLARE (char *, node_filename, NULL); /* Nonzero means do not output "Node: Foo" for node separations, that is, generate plain text. (--no-headers) */ DECLARE (int, no_headers, 0); /* Nonzero means that we process @html and @rawhtml even when not generating HTML. (--ifhtml) */ DECLARE (int, process_html, 0); /* Nonzero means that we process @ifinfo even when generating HTML. (--ifinfo) */ DECLARE (int, process_info, 1); /* Nonzero means that we process @tex and @iftex. (--iftex) */ DECLARE (int, process_tex, 0); /* Maximum number of references to a single node before complaining. (--reference-limit) */ DECLARE (int, reference_warning_limit, 1000); /* Default is to check node references. (--no-validate) */ DECLARE (int, validating, 1); /* Nonzero means print information about what is going on. (--verbose) */ DECLARE (int, verbose_mode, 0); /* Nonzero means prefix each @chapter, ... with a number like 1. (--number-sections) */ DECLARE (int, number_sections, 0); +/* Nonzero means split size. When zero, DEFAULT_SPLIT_SIZE is used. */ +DECLARE (int, split_size, 0); + /* Nonzero means expand node names and references while validating. This will avoid errors when the Texinfo document uses features like @@ and @value inconsistently in node names, but will slow the program by about 80%. You HAVE been warned. */ DECLARE (int, expensive_validation, 0); /* C's standard macros don't check to make sure that the characters being changed are within range. So I have to check explicitly. */ #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) (whitespace(c) || (c) == '\r' || (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 HTML_SAFE "$-_.+!*'()" #define URL_SAFE_CHAR(ch) (isalnum (ch) || strchr (HTML_SAFE, ch)) #define COMMAND_PREFIX '@' +#define END_VERBATIM "end verbatim" + /* 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. */ #define command_char(c) (!cr_or_whitespace(c) \ && (c) != '{' \ && (c) != '}' \ && (c) != '=') #define skip_whitespace() \ while ((input_text_offset != input_text_length) && \ whitespace (curchar())) \ input_text_offset++ #define skip_whitespace_and_newlines() \ do { \ while (input_text_offset != input_text_length \ && cr_or_whitespace (curchar ())) \ { \ if (curchar () == '\n') \ line_number++; \ input_text_offset++; \ } \ } while (0) /* Return nonzero if STRING is the text at input_text + input_text_offset, else zero. */ #define looking_at(string) \ (strncmp (input_text + input_text_offset, string, strlen (string)) == 0) - #endif /* not MAKEINFO_H */ diff --git a/contrib/texinfo/makeinfo/multi.c b/contrib/texinfo/makeinfo/multi.c index b41bb4709977..6b6ec3dafdf4 100644 --- a/contrib/texinfo/makeinfo/multi.c +++ b/contrib/texinfo/makeinfo/multi.c @@ -1,540 +1,571 @@ /* multi.c -- multitable stuff for makeinfo. - $Id: multi.c,v 1.18 1999/08/17 21:06:56 karl Exp $ + $Id: multi.c,v 1.23 2002/01/19 01:09:08 karl Exp $ - Copyright (C) 1996, 97, 98, 99 Free Software Foundation, Inc. + Copyright (C) 1996, 97, 98, 99, 2000, 01, 02 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. */ + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + Written by phr@gnu.org (Paul Rubin). */ #include "system.h" #include "insertion.h" #include "makeinfo.h" +#include "xml.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 meta_char_pos; 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; /* whether this is the first row. */ static int first_row; static void output_multitable_row (); /* Output a row. Calls insert, but also flushes the buffered output when we see a newline, since in multitable every line is a separate paragraph. */ static void out_char (ch) int ch; { if (html) add_char (ch); else { int env = select_output_environment (0); insert (ch); if (ch == '\n') { uninhibit_output_flushing (); flush_output (); inhibit_output_flushing (); } select_output_environment (env); } } void draw_horizontal_separator () { int i, j, s; if (html) { add_word ("
    "); return; } + if (xml) + return; for (s = 0; s < envs[0].current_indent; s++) out_char (' '); if (vsep) out_char ('+'); for (i = 1; i <= last_column; i++) { for (j = 0; j <= envs[i].fill_column; j++) out_char ('-'); if (vsep) out_char ('+'); } out_char ('\n'); } /* multitable strategy: for each item { for each column in an item { initialize a new paragraph do ordinary formatting into the new paragraph save the paragraph away repeat if there are more paragraphs in the column } dump out the saved paragraphs and free the storage } For HTML we construct a simple HTML 3.2 table with
    s inserted to help non-tables browsers. `@item' inserts a and `@tab' inserts ; we also try to close . The only real alternative is to rely on the info formatting engine and present preformatted text. */ void do_multitable () { int ncolumns; if (multitable_active) { line_error ("Multitables cannot be nested"); return; } close_single_paragraph (); /* scan the current item function to get the field widths and number of columns, and set up the output environment list accordingly. */ + /* if (docbook)*/ /* 05-08 */ + if (xml) + xml_no_para = 1; ncolumns = setup_multitable_parameters (); first_row = 1; /*

    for non-tables browsers. @multitable implicitly ends the current paragraph, so this is ok. */ if (html) add_word ("

    "); + /* else if (docbook)*/ /* 05-08 */ + else if (xml) + { + int *widths = xmalloc (ncolumns * sizeof (int)); + int i; + for (i=0; i 0); template = substring (start + 1, *params - 1); /* omit braces */ xtemplate = expansion (template, 0); len = strlen (xtemplate); free (template); free (xtemplate); return len; } /* Read the parameters for a multitable from the current command line, save the parameters away, and return the number of columns. */ int setup_multitable_parameters () { char *params = insertion_stack->item_function; int nchars; float columnfrac; char command[200]; /* xx no fixed limits */ 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, "%200s", command); nchars = strlen (command); 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 output, so don't mess with it. */ for ( ; i <= MAXCOLS; i++) { if (sscanf (params, "%f", &columnfrac) < 1) goto done; /* Unfortunately, can't use %n since m68k-hp-bsd libc (at least) doesn't support it. So skip whitespace (preceding the number) and then non-whitespace (the number). */ while (*params && (*params == ' ' || *params == '\t')) params++; /* Hmm, but what about @columnfractions 3foo. Well, I suppose it's invalid input anyway. */ while (*params && *params != ' ' && *params != '\t' && *params != '\n' && *params != '@') params++; setup_output_environment (i, (int) (columnfrac * (fill_column - current_indent) + .5)); } } } else if (*params == '{') { unsigned template_width = find_template_width (¶ms); /* This gives us two spaces between columns. Seems reasonable. How to take into account current_indent here? */ setup_output_environment (i++, template_width + 2); } 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->meta_char_pos = meta_char_pos; 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; meta_char_pos = e->meta_char_pos; 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 */ void nselect_next_environment () { if (current_env_no >= last_column) { line_error (_("Too many columns in multitable item (max %d)"), last_column); return; } select_output_environment (current_env_no + 1); } /* do anything needed at the beginning of processing a multitable column. */ void init_column () { /* don't indent 1st paragraph in the item */ cm_noindent (); /* throw away possible whitespace after @item or @tab command */ skip_whitespace (); } /* start a new item (row) of a multitable */ int multitable_item () { if (!multitable_active) { line_error ("multitable_item internal error: no active multitable"); xexit (1); } if (html) { if (!first_row) - add_word ("
    "); /*
    for non-tables browsers. */ - add_word ("
    "); /*
    for non-tables browsers. */ + add_word ("
    "); + add_word ("
    "); first_row = 0; - return; + return 0; + } + /* else if (docbook)*/ /* 05-08 */ + else if (xml) + { + xml_end_multitable_row (first_row); + first_row = 0; + return 0; } first_row = 0; 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 (1); } init_column (); return 0; } static void output_multitable_row () { /* offset in the output paragraph of the next char needing to be output for that column. */ int offset[MAXCOLS]; int i, j, s, remaining; int had_newline = 0; for (i = 0; i <= last_column; i++) offset[i] = 0; /* 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++) { if (envs[i].output_paragraph_offset) while (cr_or_whitespace (CHAR_AT (envs[i].output_paragraph_offset - 1))) envs[i].output_paragraph_offset--; if (i == current_env_no) output_paragraph_offset = envs[i].output_paragraph_offset; } /* read the current line from each column, outputting them all 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; for (s = 0; s < envs[0].current_indent; s++) out_char (' '); if (vsep) out_char ('|'); for (i = 1; i <= last_column; i++) { for (s = 0; s < envs[i].current_indent; s++) out_char (' '); for (j = 0; CHAR_ADDR (j) < envs[i].output_paragraph_offset; j++) { if (CHAR_AT (j) == '\n') break; out_char (CHAR_AT (j)); } offset[i] += j + 1; /* skip last text plus skip the newline */ /* Do not output trailing blanks if we're in the last column and there will be no trailing |. */ if (i < last_column && !vsep) for (; j <= envs[i].fill_column; j++) out_char (' '); if (vsep) out_char ('|'); /* draw column separator */ } out_char ('\n'); /* end of line */ had_newline = 1; } /* If completely blank item, get blank line despite no other output. */ if (!had_newline) out_char ('\n'); /* end of line */ if (hsep) draw_horizontal_separator (); /* 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 /* select a new column in current row of multitable */ void cm_tab () { if (!multitable_active) error (_("ignoring @tab outside of multitable")); if (html) - add_word (""); + add_word (""); + /* else if (docbook)*/ /* 05-08 */ + else if (xml) + xml_end_multitable_column (); else nselect_next_environment (); init_column (); } /* close a multitable, flushing its output and resetting whatever needs resetting */ void end_multitable () { - if (!html) + if (!html && !docbook) 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); multitable_active = 0; uninhibit_output_flushing (); close_insertion_paragraph (); if (html) - add_word ("
    \n"); + add_word ("
    \n"); + /* else if (docbook)*/ /* 05-08 */ + else if (xml) + xml_end_multitable (); #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/contrib/texinfo/makeinfo/node.c b/contrib/texinfo/makeinfo/node.c index 8dbbd422846b..3c7a27d5d4cd 100644 --- a/contrib/texinfo/makeinfo/node.c +++ b/contrib/texinfo/makeinfo/node.c @@ -1,1568 +1,1823 @@ /* node.c -- nodes for Texinfo. - $Id: node.c,v 1.23 1999/09/20 12:31:21 karl Exp $ + $Id: node.c,v 1.31 2002/02/23 19:12:15 karl Exp $ - Copyright (C) 1998, 99 Free Software Foundation, Inc. + Copyright (C) 1998, 99, 2000, 01, 02 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 "system.h" #include "cmds.h" #include "files.h" #include "footnote.h" #include "macro.h" #include "makeinfo.h" #include "node.h" +#include "html.h" #include "sectioning.h" #include "insertion.h" +#include "xml.h" /* See comments in node.h. */ NODE_REF *node_references = NULL; NODE_REF *node_node_references = NULL; TAG_ENTRY *tag_table = NULL; int node_number = -1; int current_section = 0; int outstanding_node = 0; /* Adding nodes, and making tags. */ /* Start a new tag table. */ void init_tag_table () { while (tag_table) { TAG_ENTRY *temp = tag_table; free (temp->node); free (temp->prev); free (temp->next); free (temp->up); tag_table = tag_table->next_ent; free (temp); } } /* Write out the contents of the existing tag table. INDIRECT_P says how to format the output (it depends on whether the table is direct or indirect). */ static void write_tag_table_internal (indirect_p) int indirect_p; { TAG_ENTRY *node; int old_indent = no_indent; + if (xml) + { + flush_output (); + return; + } + no_indent = 1; filling_enabled = 0; must_start_paragraph = 0; close_paragraph (); if (!indirect_p) { no_indent = 1; insert ('\n'); } add_word_args ("\037\nTag Table:\n%s", indirect_p ? "(Indirect)\n" : ""); /* Do not collapse -- to -, etc., in node names. */ in_fixed_width_font++; for (node = tag_table; node; node = node->next_ent) { if (node->flags & TAG_FLAG_ANCHOR) { /* This reference is to an anchor. */ execute_string ("Ref: %s", node->node); } else { /* This reference is to a node. */ execute_string ("Node: %s", node->node); } add_word_args ("\177%d\n", node->position); } add_word ("\037\nEnd Tag Table\n"); /* Do not collapse -- to -, etc., in node names. */ in_fixed_width_font--; flush_output (); no_indent = old_indent; } void write_tag_table () { write_tag_table_internal (0); /* Not indirect. */ } void write_tag_table_indirect () { write_tag_table_internal (1); } /* Convert "top" and friends into "Top". */ static void normalize_node_name (string) char *string; { if (strcasecmp (string, "Top") == 0) strcpy (string, "Top"); } char * get_node_token (expand) int expand; { char *string; get_until_in_line (expand, ",", &string); if (curchar () == ',') input_text_offset++; fix_whitespace (string); /* Force all versions of "top" to be "Top". */ normalize_node_name (string); return string; } /* Expand any macros and other directives in a node name, and return the expanded name as an malloc'ed string. */ char * expand_node_name (node) char *node; { char *result = node; if (node) { /* Don't expand --, `` etc., in case somebody will want to print the result. */ in_fixed_width_font++; result = expansion (node, 0); in_fixed_width_font--; fix_whitespace (result); normalize_node_name (result); } return result; } /* Look up NAME in the tag table, and return the associated tag_entry. If the node is not in the table return NULL. */ TAG_ENTRY * find_node (name) char *name; { TAG_ENTRY *tag = tag_table; char *expanded_name; char n1 = name[0]; while (tag) { if (tag->node[0] == n1 && strcmp (tag->node, name) == 0) return tag; tag = tag->next_ent; } if (!expensive_validation) return NULL; /* Try harder. Maybe TAG_TABLE has the expanded NAME, or maybe NAME is expanded while TAG_TABLE has its unexpanded form. This may slow down the search, but if they want this feature, let them pay! If they want it fast, they should write every node name consistently (either always expanded or always unexpaned). */ expanded_name = expand_node_name (name); for (tag = tag_table; tag; tag = tag->next_ent) { if (STREQ (tag->node, expanded_name)) break; /* If the tag name doesn't have the command prefix, there's no chance it could expand into anything but itself. */ if (strchr (tag->node, COMMAND_PREFIX)) { char *expanded_node = expand_node_name (tag->node); if (STREQ (expanded_node, expanded_name)) { free (expanded_node); break; } free (expanded_node); } } free (expanded_name); return tag; } -/* Similarly for next etc. references in a @node command, where we +/* Look in the tag table for a node whose file name is FNAME, and + return the associated tag_entry. If there's no such node in the + table, return NULL. */ +TAG_ENTRY * +find_node_by_fname (fname) + char *fname; +{ + TAG_ENTRY *tag = tag_table; + while (tag) + { + if (tag->html_fname && FILENAME_CMP (tag->html_fname, fname) == 0) + return tag; + tag = tag->next_ent; + } + + return tag; +} + +/* Remember next, prev, etc. references in a @node command, where we don't care about most of the entries. */ static void remember_node_node_reference (node) char *node; { NODE_REF *temp = xmalloc (sizeof (NODE_REF)); int number; if (!node) return; temp->next = node_node_references; temp->node = xstrdup (node); temp->type = followed_reference; number = number_of_node (node); if (number) temp->number = number; /* Already assigned. */ else { node_number++; temp->number = node_number; } node_node_references = temp; } /* Remember NODE and associates. */ void -remember_node (node, prev, next, up, position, line_no, flags) - char *node, *prev, *next, *up; +remember_node (node, prev, next, up, position, line_no, fname, flags) + char *node, *prev, *next, *up, *fname; int position, line_no, flags; { /* Check for existence of this tag already. */ if (validating) { TAG_ENTRY *tag = find_node (node); if (tag) { line_error (_("Node `%s' previously defined at line %d"), node, tag->line_no); return; } } if (!(flags & TAG_FLAG_ANCHOR)) { /* Make this the current node. */ current_node = node; } /* Add it to the list. */ { int number = number_of_node (node); TAG_ENTRY *new = xmalloc (sizeof (TAG_ENTRY)); new->node = node; new->prev = prev; new->next = next; new->up = up; new->position = position; new->line_no = line_no; new->filename = node_filename; new->touched = 0; new->flags = flags; if (number) new->number = number; /* Already assigned. */ else { node_number++; new->number = node_number; } + new->html_fname = fname; new->next_ent = tag_table; tag_table = new; } if (html) { /* Note the references to the next etc. nodes too. */ remember_node_node_reference (next); remember_node_node_reference (prev); remember_node_node_reference (up); } } /* Remember this node name for later validation use. This is used to remember menu references while reading the input file. After the output file has been written, if validation is on, then we use the contents of `node_references' as a list of nodes to validate. */ void remember_node_reference (node, line, type) char *node; int line; enum reftype type; { NODE_REF *temp = xmalloc (sizeof (NODE_REF)); int number = number_of_node (node); temp->next = node_references; temp->node = xstrdup (node); temp->line_no = line; temp->section = current_section; temp->type = type; temp->containing_node = xstrdup (current_node ? current_node : ""); temp->filename = node_filename; if (number) temp->number = number; /* Already assigned. */ else { node_number++; temp->number = node_number; } node_references = temp; } static void isolate_nodename (nodename) char *nodename; { int i, c; int paren_seen, paren; if (!nodename) return; canon_white (nodename); paren_seen = paren = i = 0; if (*nodename == '.' || !*nodename) { *nodename = 0; return; } if (*nodename == '(') { paren++; paren_seen++; i++; } for (; (c = nodename[i]); i++) { if (paren) { if (c == '(') paren++; else if (c == ')') paren--; continue; } /* If the character following the close paren is a space, then this node has no more characters associated with it. */ if (c == '\t' || c == '\n' || c == ',' || ((paren_seen && nodename[i - 1] == ')') && (c == ' ' || c == '.')) || (c == '.' && ((!nodename[i + 1] || (cr_or_whitespace (nodename[i + 1])) || (nodename[i + 1] == ')'))))) break; } nodename[i] = 0; } /* This function gets called at the start of every line while inside a menu. It checks to see if the line starts with "* ", and if so and REMEMBER_REF is nonzero, remembers the node reference as type REF_TYPE that this menu refers to. input_text_offset is at the \n just before the menu line. If REMEMBER_REF is zero, REF_TYPE is unused. */ #define MENU_STARTER "* " char * glean_node_from_menu (remember_ref, ref_type) int remember_ref; enum reftype ref_type; { int i, orig_offset = input_text_offset; char *nodename; char *line, *expanded_line; char *old_input = input_text; - size_t old_size = input_text_length; + int old_size = input_text_length; if (strncmp (&input_text[input_text_offset + 1], MENU_STARTER, strlen (MENU_STARTER)) != 0) return NULL; else input_text_offset += strlen (MENU_STARTER) + 1; /* The menu entry might include macro calls, so we need to expand them. */ get_until ("\n", &line); only_macro_expansion++; /* only expand macros in menu entries */ expanded_line = expansion (line, 0); only_macro_expansion--; free (line); input_text = expanded_line; input_text_offset = 0; input_text_length = strlen (expanded_line); get_until_in_line (0, ":", &nodename); if (curchar () == ':') input_text_offset++; if (curchar () != ':') { free (nodename); get_until_in_line (0, "\n", &nodename); isolate_nodename (nodename); } input_text = old_input; input_text_offset = orig_offset; input_text_length = old_size; free (expanded_line); fix_whitespace (nodename); normalize_node_name (nodename); i = strlen (nodename); if (i && nodename[i - 1] == ':') nodename[i - 1] = 0; if (remember_ref) remember_node_reference (nodename, line_number, ref_type); return nodename; } /* Set the name of the current output file. */ void set_current_output_filename (fname) const char *fname; { if (current_output_filename) free (current_output_filename); current_output_filename = xstrdup (fname); } /* The order is: nodename, nextnode, prevnode, upnode. If all of the NEXT, PREV, and UP fields are empty, they are defaulted. You must follow a node command which has those fields defaulted with a sectioning command (e.g. @chapter) giving the "level" of that node. It is an error not to do so. The defaults come from the menu in this node's parent. */ void cm_node () { + static long epilogue_len = 0L; char *node, *prev, *next, *up; int new_node_pos, defaulting, this_section; int no_warn = 0; + char *fname_for_this_node = NULL; + char *tem; + TAG_ENTRY *tag = NULL; if (strcmp (command, "nwnode") == 0) no_warn = TAG_FLAG_NO_WARN; /* Get rid of unmatched brace arguments from previous commands. */ discard_braces (); /* There also might be insertions left lying around that haven't been ended yet. Do that also. */ discard_insertions (1); if (!html && !already_outputting_pending_notes) { + if (!xml) close_paragraph (); output_pending_notes (); } - if (html && splitting && top_node_seen) - { - /* End the current split output file. */ - close_paragraph (); - output_pending_notes (); - start_paragraph (); - /* Fixme: html: need a navigation bar here. */ - add_word ("\n"); - close_paragraph (); - fclose (output_stream); - output_stream = NULL; - } - - filling_enabled = indented_fill = 0; new_node_pos = output_position; - if (!html || (html && splitting)) - current_footnote_number = 1; if (macro_expansion_output_stream && !executing_string) append_to_expansion_output (input_text_offset + 1); /* Do not collapse -- to -, etc., in node names. */ in_fixed_width_font++; /* While expanding the @node line, leave any non-macros intact, so that the macro-expanded output includes them. */ only_macro_expansion++; node = get_node_token (1); only_macro_expansion--; next = get_node_token (0); prev = get_node_token (0); up = get_node_token (0); + if (html && splitting + /* If there is a Top node, it always goes into index.html. So + don't start a new HTML file for Top. */ + && (top_node_seen || strcasecmp (node, "Top") != 0)) + { + /* We test *node here so that @node without a valid name won't + start a new file name with a bogus name such as ".html". + This could happen if we run under "--force", where we cannot + simply bail out. Continuing to use the same file sounds like + the best we can do in such cases. */ + if (current_output_filename && output_stream && *node) + { + char *fname_for_prev_node; + + if (current_node) + { + /* NOTE: current_node at this point still holds the name + of the previous node. */ + tem = expand_node_name (current_node); + fname_for_prev_node = nodename_to_filename (tem); + free (tem); + } + else /* could happen if their top node isn't named "Top" */ + fname_for_prev_node = filename_part (current_output_filename); + tem = expand_node_name (node); + fname_for_this_node = nodename_to_filename (tem); + free (tem); + /* Don't close current output file, if next output file is + to have the same name. This may happen at top level, or + if two nodes produce the same file name under --split. */ + if (FILENAME_CMP (fname_for_this_node, fname_for_prev_node) != 0) + { + long pos1 = 0; + + /* End the current split output file. */ + close_paragraph (); + output_pending_notes (); + start_paragraph (); + /* Compute the length of the HTML file's epilogue. We + cannot know the value until run time, due to the + text/binary nuisance on DOS/Windows platforms, where + 2 `\r' characters could be added to the epilogue when + it is written in text mode. */ + if (epilogue_len == 0) + { + flush_output (); + pos1 = ftell (output_stream); + } + add_word ("\n"); + close_paragraph (); + if (epilogue_len == 0) + epilogue_len = ftell (output_stream) - pos1; + fclose (output_stream); + output_stream = NULL; + tag = find_node_by_fname (fname_for_this_node); + } + free (fname_for_prev_node); + } + } + + filling_enabled = indented_fill = 0; + if (!html || (html && splitting)) + current_footnote_number = 1; + if (verbose_mode) printf (_("Formatting node %s...\n"), node); if (macro_expansion_output_stream && !executing_string) remember_itext (input_text, input_text_offset); no_indent = 1; - if (!no_headers && !html) + if (xml) + { + xml_begin_document (); + xml_begin_node (); + if (!docbook) + { + xml_insert_element (NODENAME, START); + if (macro_expansion_output_stream && !executing_string) + me_execute_string (node); + else + execute_string ("%s", node); + xml_insert_element (NODENAME, END); + } + else + xml_node_id = xml_id (node); + } + else if (!no_headers && !html) { add_word_args ("\037\nFile: %s, Node: ", pretty_output_filename); if (macro_expansion_output_stream && !executing_string) me_execute_string (node); else execute_string ("%s", node); filling_enabled = indented_fill = 0; } /* Check for defaulting of this node's next, prev, and up fields. */ defaulting = (*next == 0 && *prev == 0 && *up == 0); this_section = what_section (input_text + input_text_offset); /* If we are defaulting, then look at the immediately following sectioning command (error if none) to determine the node's level. Find the node that contains the menu mentioning this node that is one level up (error if not found). That node is the "Up" of this node. Default the "Next" and "Prev" from the menu. */ if (defaulting) { NODE_REF *last_ref = NULL; NODE_REF *ref = node_references; if (this_section < 0 && !STREQ (node, "Top")) { char *polite_section_name = "top"; int i; for (i = 0; section_alist[i].name; i++) if (section_alist[i].level == current_section + 1) { polite_section_name = section_alist[i].name; break; } line_error (_("Node `%s' requires a sectioning command (e.g. %c%s)"), node, COMMAND_PREFIX, polite_section_name); } else { if (strcmp (node, "Top") == 0) { /* Default the NEXT pointer to be the first menu item in this node, if there is a menu in this node. We have to try very hard to find the menu, as it may be obscured by execution_strings which are on the filestack. For every member of the filestack which has a FILENAME member which is identical to the current INPUT_FILENAME, search forward from that offset. */ int saved_input_text_offset = input_text_offset; int saved_input_text_length = input_text_length; char *saved_input_text = input_text; FSTACK *next_file = filestack; int orig_offset, orig_size; /* No matter what, make this file point back at `(dir)'. */ free (up); up = xstrdup ("(dir)"); /* html fixxme */ while (1) { orig_offset = input_text_offset; orig_size = search_forward (node_search_string, orig_offset); if (orig_size < 0) orig_size = input_text_length; input_text_offset = search_forward ("\n@menu", orig_offset); if (input_text_offset > -1 && cr_or_whitespace (input_text[input_text_offset + 6])) { char *nodename_from_menu = NULL; input_text_offset = search_forward ("\n* ", input_text_offset); if (input_text_offset != -1) nodename_from_menu = glean_node_from_menu (0, 0); if (nodename_from_menu) { free (next); next = nodename_from_menu; break; } } /* We got here, so it hasn't been found yet. Try the next file on the filestack if there is one. */ if (next_file && FILENAME_CMP (next_file->filename, input_filename) == 0) { input_text = next_file->text; input_text_offset = next_file->offset; input_text_length = next_file->size; next_file = next_file->next; } else { /* No more input files to check. */ break; } } input_text = saved_input_text; input_text_offset = saved_input_text_offset; input_text_length = saved_input_text_length; } } /* Fix the level of the menu references in the Top node, iff it was declared with @top, and no subsequent reference was found. */ if (top_node_seen && !non_top_node_seen) { /* Then this is the first non-@top node seen. */ int level; level = set_top_section_level (this_section - 1); non_top_node_seen = 1; while (ref) { if (ref->section == level) ref->section = this_section - 1; ref = ref->next; } ref = node_references; } while (ref) { if (ref->section == (this_section - 1) && ref->type == menu_reference && strcmp (ref->node, node) == 0) { char *containing_node = ref->containing_node; free (up); up = xstrdup (containing_node); if (last_ref && last_ref->type == menu_reference && strcmp (last_ref->containing_node, containing_node) == 0) { free (next); next = xstrdup (last_ref->node); } while (ref->section == this_section - 1 && ref->next && ref->next->type != menu_reference) ref = ref->next; if (ref->next && ref->type == menu_reference && strcmp (ref->next->containing_node, containing_node) == 0) { free (prev); prev = xstrdup (ref->next->node); } else if (!ref->next && strcasecmp (ref->containing_node, "Top") == 0) { free (prev); prev = xstrdup (ref->containing_node); } break; } last_ref = ref; ref = ref->next; } } /* Insert the correct args if we are expanding macros, and the node's pointers weren't defaulted. */ if (macro_expansion_output_stream && !executing_string && !defaulting) { char *temp; int op_orig = output_paragraph_offset; int meta_pos_orig = meta_char_pos; int extra = html ? strlen (node) : 0; temp = xmalloc (7 + extra + strlen (next) + strlen (prev) + strlen (up)); sprintf (temp, "%s, %s, %s, %s", html ? node : "", next, prev, up); me_execute_string (temp); free (temp); output_paragraph_offset = op_orig; meta_char_pos = meta_pos_orig; } if (!*node) { line_error (_("No node name specified for `%c%s' command"), COMMAND_PREFIX, command); free (node); free (next); next = NULL; free (prev); prev= NULL; free (up); up = NULL; node_number++; /* else it doesn't get bumped */ } else { if (!*next) { free (next); next = NULL; } if (!*prev) { free (prev); prev = NULL; } if (!*up) { free (up); up = NULL; } - remember_node (node, prev, next, up, new_node_pos, line_number, no_warn); + remember_node (node, prev, next, up, new_node_pos, line_number, + fname_for_this_node, no_warn); outstanding_node = 1; } if (html) { - char *tem; - - if (splitting) - { /* this code not operational, we do not currently split html */ - char filename[20]; - - sprintf (filename, "node%d.html", number_of_node (node)); - output_stream = fopen (filename, "w"); + if (splitting && *node && output_stream == NULL) + { + char *dirname; + char filename[PATH_MAX]; + + dirname = pathname_part (current_output_filename); + strcpy (filename, dirname); + strcat (filename, fname_for_this_node); + free (dirname); + + /* See if the node name converted to a file name clashes + with other nodes or anchors. If it clashes with an + anchor, we complain and nuke that anchor's file. */ + if (!tag) + { + output_stream = fopen (filename, "w"); + html_output_head_p = 0; /* so that we generate HTML preamble */ + html_output_head (); + } + else if ((tag->flags & TAG_FLAG_ANCHOR) != 0) + { + line_error (_("Anchor `%s' and node `%s' map to the same file name"), + tag->node, node); + file_line_error (tag->filename, tag->line_no, + _("This @anchor command ignored; references to it will not work")); + file_line_error (tag->filename, tag->line_no, + _("Rename this anchor or use the `--no-split' option")); + /* Nuke the file name recorded in anchor's tag. + Since we are about to nuke the file itself, we + don't want find_node_by_fname to consider this + anchor anymore. */ + free (tag->html_fname); + tag->html_fname = NULL; + output_stream = fopen (filename, "w"); + html_output_head_p = 0; /* so that we generate HTML preamble */ + html_output_head (); + } + else + { + /* This node's file name clashes with another node. + We put them both on the same file. */ + output_stream = fopen (filename, "r+"); + if (output_stream) + { + static char html_end[] = "\n"; + char end_line[sizeof(html_end)]; + int fpos = fseek (output_stream, -epilogue_len, + SEEK_END); + + if (fpos < 0 + || fgets (end_line, sizeof (html_end), + output_stream) == NULL + /* Paranoia: did someone change the way HTML + files are finished up? */ + || strcasecmp (end_line, html_end) != 0) + { + line_error (_("Unexpected string at end of split-HTML file `%s'"), + fname_for_this_node); + fclose (output_stream); + xexit (1); + } + fseek (output_stream, -epilogue_len, SEEK_END); + } + } if (output_stream == NULL) { fs_error (filename); xexit (1); } set_current_output_filename (filename); - /* FIXME: when this code is operational, we will need to - expand node, next, prev, and up before output. */ - add_word_args ("%s", node); - if (next) add_link (next, "rel=next"); - if (prev) add_link (prev, "rel=previous"); - if (up) add_link (up, "rel=up"); - add_word ("\n\n"); } if (!splitting && no_headers) { /* cross refs need a name="#anchor" even if we're not writing headers*/ add_word (""); free (tem); } if (splitting || !no_headers) { /* Navigation bar. The

    avoids the links area running on with old Lynxen. */ add_word_args ("

    %s\n", splitting ? "" : "


    "); add_word_args ("%s%s", tem); free (tem); if (next) { - add_word (",\n"); - add_word (_("Next:")); - add_word ("", tem); + add_word (",\n"); + add_word (_("Next:")); + add_word ("", tem); free (tem); } if (prev) { - add_word (",\n"); - add_word (_("Previous:")); - add_word ("%s", tem); + add_word (",\n"); + add_word (_("Previous:")); + add_word ("%s", tem); free (tem); } if (up) { - add_word (",\n"); - add_word (_("Up:")); - add_word ("%s", tem); + add_word (",\n"); + add_word (_("Up:")); + add_word ("%s", tem); free (tem); } /* html fixxme: we want a `top' or `contents' link here. */ add_word_args ("\n%s
    \n", splitting ? "
    " : ""); } } - + else if (docbook) + ; + else if (xml) + { + if (next) + { + xml_insert_element (NODENEXT, START); + execute_string ("%s", next); + xml_insert_element (NODENEXT, END); + } + if (prev) + { + xml_insert_element (NODEPREV, START); + execute_string ("%s", prev); + xml_insert_element (NODEPREV, END); + } + if (up) + { + xml_insert_element (NODEUP, START); + execute_string ("%s", up); + xml_insert_element (NODEUP, END); + } + } else if (!no_headers) { if (macro_expansion_output_stream) me_inhibit_expansion++; /* These strings are not translatable. */ if (next) { execute_string (", Next: %s", next); filling_enabled = indented_fill = 0; } if (prev) { execute_string (", Prev: %s", prev); filling_enabled = indented_fill = 0; } if (up) { execute_string (", Up: %s", up); filling_enabled = indented_fill = 0; } if (macro_expansion_output_stream) me_inhibit_expansion--; } close_paragraph (); no_indent = 0; /* Change the section only if there was a sectioning command. */ if (this_section >= 0) current_section = this_section; if (current_node && STREQ (current_node, "Top")) top_node_seen = 1; filling_enabled = 1; in_fixed_width_font--; } /* Cross-reference target at an arbitrary spot. */ void cm_anchor (arg) int arg; { char *anchor; + char *fname_for_anchor = NULL; if (arg == END) return; /* Parse the anchor text. */ anchor = get_xref_token (1); /* In HTML mode, need to actually produce some output. */ if (html) { /* If this anchor is at the beginning of a new paragraph, make sure a new paragraph is indeed started. */ if (!paragraph_is_open) { + if (!executing_string && html) + html_output_head (); start_paragraph (); if (!in_fixed_width_font || in_menu || in_detailmenu) { insert_string ("

    "); in_paragraph = 1; } } add_word (""); + if (splitting) + { + /* If we are splitting, cm_xref will produce a reference to + a file whose name is derived from the anchor name. So we + must create a file when we see an @anchor, otherwise + xref's to anchors won't work. The file we create simply + redirects to the file of this anchor's node. */ + TAG_ENTRY *tag; + + fname_for_anchor = nodename_to_filename (anchor); + /* See if the anchor name converted to a file name clashes + with other anchors or nodes. */ + tag = find_node_by_fname (fname_for_anchor); + if (tag) + { + if ((tag->flags & TAG_FLAG_ANCHOR) != 0) + line_error (_("Anchors `%s' and `%s' map to the same file name"), + anchor, tag->node); + else + line_error (_("Anchor `%s' and node `%s' map to the same file name"), + anchor, tag->node); + line_error (_("@anchor command ignored; references to it will not work")); + line_error (_("Rename this anchor or use the `--no-split' option")); + free (fname_for_anchor); + /* We will not be creating a file for this anchor, so + set its name to NULL, so that remember_node stores a + NULL and find_node_by_fname won't consider this + anchor for clashes. */ + fname_for_anchor = NULL; + } + else + { + char *dirname, *p; + char filename[PATH_MAX]; + FILE *anchor_stream; + + dirname = pathname_part (current_output_filename); + strcpy (filename, dirname); + strcat (filename, fname_for_anchor); + free (dirname); + + anchor_stream = fopen (filename, "w"); + if (anchor_stream == NULL) + { + fs_error (filename); + xexit (1); + } + /* The HTML magic below will cause the browser to + immediately go to the anchor's node's file. Lynx + seems not to support this redirection, but it looks + like a bug in Lynx, and they can work around it by + clicking on the link once more. */ + fputs ("\n", anchor_stream); + fclose (anchor_stream); + } + } + } + else if (xml) + { + xml_insert_element_with_attribute (ANCHOR, START, "name=\"%s\"", anchor); + xml_insert_element (ANCHOR, END); } - /* Save it in the tag table. */ remember_node (anchor, NULL, NULL, NULL, output_position + output_column, - line_number, TAG_FLAG_ANCHOR); + line_number, fname_for_anchor, TAG_FLAG_ANCHOR); } /* Find NODE in REF_LIST. */ static NODE_REF * find_node_reference (node, ref_list) char *node; NODE_REF *ref_list; { NODE_REF *orig_ref_list = ref_list; char *expanded_node; while (ref_list) { if (strcmp (node, ref_list->node) == 0) break; ref_list = ref_list->next; } if (ref_list || !expensive_validation) return ref_list; /* Maybe NODE is not expanded yet. This may be SLOW. */ expanded_node = expand_node_name (node); for (ref_list = orig_ref_list; ref_list; ref_list = ref_list->next) { if (STREQ (expanded_node, ref_list->node)) break; if (strchr (ref_list->node, COMMAND_PREFIX)) { char *expanded_ref = expand_node_name (ref_list->node); if (STREQ (expanded_node, expanded_ref)) { free (expanded_ref); break; } free (expanded_ref); } } free (expanded_node); return ref_list; } void free_node_references () { NODE_REF *list, *temp; list = node_references; while (list) { temp = list; free (list->node); free (list->containing_node); list = list->next; free (temp); } node_references = NULL; } void free_node_node_references () { NODE_REF *list, *temp; list = node_references; while (list) { temp = list; free (list->node); list = list->next; free (temp); } node_node_references = NULL; } /* Return the number assigned to a named node in either the tag_table or node_references list or zero if no number has been assigned. */ int number_of_node (node) char *node; { NODE_REF *temp_ref; TAG_ENTRY *temp_node = find_node (node); if (temp_node) return temp_node->number; else if ((temp_ref = find_node_reference (node, node_references))) return temp_ref->number; else if ((temp_ref = find_node_reference (node, node_node_references))) return temp_ref->number; else return 0; } /* validation */ /* Return 1 if TAG (at LINE) correctly validated, or 0 if not. LABEL is the (translated) description of the type of reference -- Menu, Cross, Next, etc. */ static int validate (tag, line, label) char *tag; int line; char *label; { TAG_ENTRY *result; /* If there isn't a tag to verify, or if the tag is in another file, then it must be okay. */ if (!tag || !*tag || *tag == '(') return 1; /* Otherwise, the tag must exist. */ result = find_node (tag); if (!result) { line_number = line; line_error (_("%s reference to nonexistent node `%s'"), label, tag); return 0; } result->touched++; return 1; } /* The strings here are followed in the message by `reference to...' in the `validate' routine. They are only used in messages, thus are translated. */ static char * reftype_type_string (type) enum reftype type; { switch (type) { case menu_reference: return _("Menu"); case followed_reference: return _("Cross"); default: return "Internal-bad-reference-type"; } } static void validate_other_references (ref_list) NODE_REF *ref_list; { char *old_input_filename = input_filename; while (ref_list) { input_filename = ref_list->filename; validate (ref_list->node, ref_list->line_no, reftype_type_string (ref_list->type)); ref_list = ref_list->next; } input_filename = old_input_filename; } /* Validation of an info file. Scan through the list of tag entries touching the Prev, Next, and Up elements of each. It is an error not to be able to touch one of them, except in the case of external node references, such as "(DIR)". If the Prev is different from the Up, then the Prev node must have a Next pointing at this node. Every node except Top must have an Up. The Up node must contain some sort of reference, other than a Next, to this node. If the Next is different from the Next of the Up, then the Next node must have a Prev pointing at this node. */ void validate_file (tag_table) TAG_ENTRY *tag_table; { char *old_input_filename = input_filename; TAG_ENTRY *tags = tag_table; while (tags) { TAG_ENTRY *temp_tag; char *tem1, *tem2; input_filename = tags->filename; line_number = tags->line_no; /* If this is a "no warn" node, don't validate it in any way. */ if (tags->flags & TAG_FLAG_NO_WARN) { tags = tags->next_ent; continue; } /* If this node has a Next, then make sure that the Next exists. */ if (tags->next) { validate (tags->next, tags->line_no, _("Next")); /* If the Next node exists, and there is no Up, then make sure that the Prev of the Next points back. But do nothing if we aren't supposed to issue warnings about this node. */ temp_tag = find_node (tags->next); if (temp_tag && !(temp_tag->flags & TAG_FLAG_NO_WARN)) { char *prev = temp_tag->prev; int you_lose = !prev || !STREQ (prev, tags->node); if (you_lose && expensive_validation) { tem1 = expand_node_name (prev); tem2 = expand_node_name (tags->node); if (STREQ (tem1, tem2)) you_lose = 0; free (tem1); free (tem2); } if (you_lose) { line_error (_("Next field of node `%s' not pointed to"), tags->node); - line_number = temp_tag->line_no; - input_filename = temp_tag->filename; - line_error (_("This node (%s) has the bad Prev"), - temp_tag->node); - input_filename = tags->filename; - line_number = tags->line_no; + file_line_error (temp_tag->filename, temp_tag->line_no, + _("This node (%s) has the bad Prev"), + temp_tag->node); temp_tag->flags |= TAG_FLAG_PREV_ERROR; } } } /* Validate the Prev field if there is one, and we haven't already complained about it in some way. You don't have to have a Prev field at this stage. */ if (!(tags->flags & TAG_FLAG_PREV_ERROR) && tags->prev) { int valid_p = validate (tags->prev, tags->line_no, _("Prev")); if (!valid_p) tags->flags |= TAG_FLAG_PREV_ERROR; else { /* If the Prev field is not the same as the Up field, then the node pointed to by the Prev field must have a Next field which points to this node. */ int prev_equals_up = !tags->up || STREQ (tags->prev, tags->up); if (!prev_equals_up && expensive_validation) { tem1 = expand_node_name (tags->prev); tem2 = expand_node_name (tags->up); prev_equals_up = STREQ (tem1, tem2); free (tem1); free (tem2); } if (!prev_equals_up) { temp_tag = find_node (tags->prev); /* If we aren't supposed to issue warnings about the target node, do nothing. */ if (!temp_tag || (temp_tag->flags & TAG_FLAG_NO_WARN)) /* Do nothing. */ ; else { int you_lose = !temp_tag->next || !STREQ (temp_tag->next, tags->node); if (temp_tag->next && you_lose && expensive_validation) { tem1 = expand_node_name (temp_tag->next); tem2 = expand_node_name (tags->node); if (STREQ (tem1, tem2)) you_lose = 0; free (tem1); free (tem2); } if (you_lose) { line_error (_("Prev field of node `%s' not pointed to"), tags->node); - line_number = temp_tag->line_no; - input_filename = temp_tag->filename; - line_error (_("This node (%s) has the bad Next"), - temp_tag->node); - input_filename = tags->filename; - line_number = tags->line_no; + file_line_error (temp_tag->filename, + temp_tag->line_no, + _("This node (%s) has the bad Next"), + temp_tag->node); temp_tag->flags |= TAG_FLAG_NEXT_ERROR; } } } } } if (!tags->up && !(tags->flags & TAG_FLAG_ANCHOR) && strcasecmp (tags->node, "Top") != 0) line_error (_("`%s' has no Up field"), tags->node); else if (tags->up) { int valid_p = validate (tags->up, tags->line_no, _("Up")); /* If node X has Up: Y, then warn if Y fails to have a menu item or note pointing at X, if Y isn't of the form "(Y)". */ if (valid_p && *tags->up != '(') { NODE_REF *nref; NODE_REF *tref = NULL; NODE_REF *list = node_references; for (;;) { nref = find_node_reference (tags->node, list); if (!nref) break; if (strcmp (nref->containing_node, tags->up) == 0) { if (nref->type != menu_reference) { tref = nref; list = nref->next; } else break; } list = nref->next; } if (!nref) { if (!tref && expensive_validation) { /* Sigh... This might be AWFULLY slow, but if they want this feature, they'll have to pay! We do all the loop again expanding each containing_node reference as we go. */ char *tags_up = expand_node_name (tags->up); char *tem; list = node_references; for (;;) { nref = find_node_reference (tags->node, list); if (!nref) break; tem = expand_node_name (nref->containing_node); if (STREQ (tem, tags_up)) { if (nref->type != menu_reference) tref = nref; else { free (tem); break; } } free (tem); list = nref->next; } } if (!nref && !tref) { temp_tag = find_node (tags->up); - line_number = temp_tag->line_no; - input_filename = temp_tag->filename; - line_error ( + file_line_error (temp_tag->filename, temp_tag->line_no, _("Node `%s' lacks menu item for `%s' despite being its Up target"), tags->up, tags->node); - line_number = tags->line_no; - input_filename = tags->filename; } } } } tags = tags->next_ent; } validate_other_references (node_references); /* We have told the user about the references which didn't exist. Now tell him about the nodes which aren't referenced. */ for (tags = tag_table; tags; tags = tags->next_ent) { /* If this node is a "no warn" node, do nothing. */ if (tags->flags & TAG_FLAG_NO_WARN) { tags = tags->next_ent; continue; } /* Special hack. If the node in question appears to have been referenced more than REFERENCE_WARNING_LIMIT times, give a warning. */ if (tags->touched > reference_warning_limit) { input_filename = tags->filename; line_number = tags->line_no; warning (_("node `%s' has been referenced %d times"), tags->node, tags->touched); } if (tags->touched == 0) { input_filename = tags->filename; line_number = tags->line_no; /* Notice that the node "Top" is special, and doesn't have to be referenced. Anchors don't have to be referenced either, you might define them for another document. */ if (strcasecmp (tags->node, "Top") != 0 && !(tags->flags & TAG_FLAG_ANCHOR)) warning (_("unreferenced node `%s'"), tags->node); } } input_filename = old_input_filename; } /* Splitting */ /* Return true if the tag entry pointed to by TAGS is the last node. This means only anchors follow. */ static int last_node_p (tags) TAG_ENTRY *tags; { int last = 1; while (tags->next_ent) { tags = tags->next_ent; if (tags->flags & TAG_FLAG_ANCHOR) ; else { last = 0; break; } } return last; } /* Split large output files into a series of smaller files. Each file is pointed to in the tag table, which then gets written out as the original file. The new files have the same name as the original file with a "-num" attached. SIZE is the largest number of bytes to allow in any single split file. */ void split_file (filename, size) char *filename; int size; { char *root_filename, *root_pathname; char *the_file, *filename_part (); struct stat fileinfo; long file_size; char *the_header; int header_size; int dos_file_names = 0; /* if nonzero, don't exceed 8+3 limits */ /* Can only do this to files with tag tables. */ if (!tag_table) return; if (size == 0) size = DEFAULT_SPLIT_SIZE; if ((stat (filename, &fileinfo) != 0) || (((long) fileinfo.st_size) < SPLIT_SIZE_THRESHOLD)) return; file_size = (long) fileinfo.st_size; the_file = find_and_load (filename); if (!the_file) return; root_filename = filename_part (filename); root_pathname = pathname_part (filename); /* Do we need to generate names of subfiles which don't exceed 8+3 limits? */ dos_file_names = !HAVE_LONG_FILENAMES (root_pathname ? root_pathname : "."); if (!root_pathname) root_pathname = xstrdup (""); /* Start splitting the file. Walk along the tag table outputting sections of the file. When we have written all of the nodes in the tag table, make the top-level pointer file, which contains indirect pointers and tags for the nodes. */ { int which_file = 1; TAG_ENTRY *tags = tag_table; char *indirect_info = NULL; /* Remember the `header' of this file. The first tag in the file is the bottom of the header; the top of the file is the start. */ the_header = xmalloc (1 + (header_size = tags->position)); memcpy (the_header, the_file, header_size); while (tags) { int file_top, file_bot, limit; /* Have to include the Control-_. */ file_top = file_bot = tags->position; limit = file_top + size; /* If the rest of this file is only one node, then that is the entire subfile. */ if (last_node_p (tags)) { int i = tags->position + 1; char last_char = the_file[i]; while (i < file_size) { if ((the_file[i] == '\037') && ((last_char == '\n') || (last_char == '\014'))) break; else last_char = the_file[i]; i++; } file_bot = i; tags = tags->next_ent; goto write_region; } /* Otherwise, find the largest number of nodes that can fit in this subfile. */ for (; tags; tags = tags->next_ent) { if (last_node_p (tags)) { /* This entry is the last node. Search forward for the end of this node, and that is the end of this file. */ int i = tags->position + 1; char last_char = the_file[i]; while (i < file_size) { if ((the_file[i] == '\037') && ((last_char == '\n') || (last_char == '\014'))) break; else last_char = the_file[i]; i++; } file_bot = i; if (file_bot < limit) { tags = tags->next_ent; goto write_region; } else { /* Here we want to write out everything before the last node, and then write the last node out in a file by itself. */ file_bot = tags->position; goto write_region; } } /* Write region only if this was a node, not an anchor. */ if (tags->next_ent->position > limit && !(tags->flags & TAG_FLAG_ANCHOR)) { if (tags->position == file_top) tags = tags->next_ent; file_bot = tags->position; write_region: { int fd; char *split_filename, *split_basename; unsigned root_len = strlen (root_filename); split_filename = xmalloc (10 + strlen (root_pathname) + root_len); split_basename = xmalloc (10 + root_len); sprintf (split_basename, "%s-%d", root_filename, which_file); if (dos_file_names) { char *dot = strchr (split_basename, '.'); unsigned base_len = strlen (split_basename); if (dot) { /* Make foobar.i1, .., foobar.i99, foobar.100, ... */ dot[1] = 'i'; memmove (which_file <= 99 ? dot + 2 : dot + 1, split_basename + root_len + 1, strlen (split_basename + root_len + 1) + 1); } else if (base_len > 8) { /* Make foobar-1, .., fooba-10, .., foob-100, ... */ unsigned numlen = base_len - root_len; memmove (split_basename + 8 - numlen, split_basename + root_len, numlen + 1); } } sprintf (split_filename, "%s%s", root_pathname, split_basename); fd = open (split_filename, O_WRONLY|O_TRUNC|O_CREAT, 0666); if (fd < 0 || write (fd, the_header, header_size) != header_size || write (fd, the_file + file_top, file_bot - file_top) != (file_bot - file_top) || (close (fd)) < 0) { perror (split_filename); if (fd != -1) close (fd); xexit (1); } if (!indirect_info) { indirect_info = the_file + file_top; sprintf (indirect_info, "\037\nIndirect:\n"); indirect_info += strlen (indirect_info); } sprintf (indirect_info, "%s: %d\n", split_basename, file_top); free (split_basename); free (split_filename); indirect_info += strlen (indirect_info); which_file++; break; } } } } /* We have sucessfully created the subfiles. Now write out the original again. We must use `output_stream', or write_tag_table_indirect () won't know where to place the output. */ output_stream = fopen (filename, "w"); if (!output_stream) { perror (filename); xexit (1); } { int distance = indirect_info - the_file; fwrite (the_file, 1, distance, output_stream); /* Inhibit newlines. */ paragraph_is_open = 0; write_tag_table_indirect (); fclose (output_stream); free (the_header); free (the_file); return; } } } diff --git a/contrib/texinfo/makeinfo/node.h b/contrib/texinfo/makeinfo/node.h index e2fc883d73aa..735a23131628 100644 --- a/contrib/texinfo/makeinfo/node.h +++ b/contrib/texinfo/makeinfo/node.h @@ -1,111 +1,113 @@ /* node.h -- declarations for Node. - $Id: node.h,v 1.5 1999/07/11 16:50:19 karl Exp $ + $Id: node.h,v 1.6 2002/01/16 15:52:45 karl Exp $ - Copyright (C) 1996, 97, 98, 99 Free Software Foundation, Inc. + Copyright (C) 1996, 97, 98, 99, 2002 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). */ #ifndef NODE_H #define NODE_H /* The various references that we know about. */ /* What we remember for each node. */ typedef struct tentry { struct tentry *next_ent; char *node; /* Name of this node. */ char *prev; /* Name of "Prev:" for this node. */ char *next; /* Name of "Next:" for this node. */ char *up; /* Name of "Up:" for this node. */ int position; /* Output file position of this node. */ int line_no; /* Defining line in source file. */ char *filename; /* The file that this node was found in. */ int touched; /* Nonzero means this node has been referenced. */ int flags; int number; /* Number for this node, relevant for HTML splitting -- from use+define order, not just define. */ + char *html_fname; /* The HTML file to which this node is written + (non-NULL only for HTML splitting). */ } TAG_ENTRY; /* If node-a has a "Next" for node-b, but node-b has no "Prev" for node-a, we turn on this flag bit in node-b's tag entry. This means that when it is time to validate node-b, we don't report an additional error if there was no "Prev" field. */ #define TAG_FLAG_PREV_ERROR 1 #define TAG_FLAG_NEXT_ERROR 2 #define TAG_FLAG_UP_ERROR 4 #define TAG_FLAG_NO_WARN 8 #define TAG_FLAG_IS_TOP 16 #define TAG_FLAG_ANCHOR 32 /* Menu reference, *note reference, and validation hacking. */ /* A structure to remember references with. A reference to a node is either an entry in a menu, or a cross-reference made with [px]ref. */ typedef struct node_ref { struct node_ref *next; char *node; /* Name of node referred to. */ char *containing_node; /* Name of node containing this reference. */ int line_no; /* Line number where the reference occurs. */ int section; /* Section level where the reference occurs. */ char *filename; /* Name of file where the reference occurs. */ enum reftype type; /* Type of reference, either menu or note. */ int number; /* Number for this node, relevant for HTML splitting -- from use+define order, not just define. */ } NODE_REF; /* The linked list of such structures. */ extern NODE_REF *node_references; /* A similar list for references occuring in @node next and similar references, needed for HTML. */ extern NODE_REF *node_node_references; /* List of all nodes. */ extern TAG_ENTRY *tag_table; /* Counter for setting node_ref.number; zero is Top. */ extern int node_number; /* The current node's section level. */ extern int current_section; /* Nonzero when the next sectioning command should generate an anchor corresponding to the current node in HTML mode. */ extern int outstanding_node; extern TAG_ENTRY *find_node (); /* A search string which is used to find a line defining a node. */ DECLARE (char *, node_search_string, "\n@node "); /* Extract node name from a menu item. */ extern char *glean_node_from_menu (); /* Remember a node for later validation. */ extern void remember_node_reference (); /* Remember the name of the current output file. */ extern void set_current_output_filename (); /* Expand macros and commands in the node name and canonicalize whitespace in the resulting expansion. */ extern char *expand_node_name (); #endif /* NODE_H */ diff --git a/contrib/texinfo/makeinfo/sectioning.c b/contrib/texinfo/makeinfo/sectioning.c index b06785b94b62..850fc4654ba9 100644 --- a/contrib/texinfo/makeinfo/sectioning.c +++ b/contrib/texinfo/makeinfo/sectioning.c @@ -1,691 +1,704 @@ /* sectioning.c -- all related stuff @chapter, @section... @contents - $Id: sectioning.c,v 1.12 1999/08/17 21:06:50 karl Exp $ + $Id: sectioning.c,v 1.17 2002/02/09 00:54:51 karl Exp $ - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 02 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 Karl Heinz Marbaise . */ #include "system.h" #include "cmds.h" #include "macro.h" #include "makeinfo.h" #include "node.h" #include "toc.h" #include "sectioning.h" +#include "xml.h" /* See comment in sectioning.h. */ section_alist_type section_alist[] = { { "unnumberedsubsubsec", 5, ENUM_SECT_NO, TOC_YES }, { "unnumberedsubsec", 4, ENUM_SECT_NO, TOC_YES }, { "unnumberedsec", 3, ENUM_SECT_NO, TOC_YES }, { "unnumbered", 2, ENUM_SECT_NO, TOC_YES }, { "appendixsubsubsec", 5, ENUM_SECT_APP, TOC_YES }, /* numbered like A.X.X.X */ { "appendixsubsec", 4, ENUM_SECT_APP, TOC_YES }, { "appendixsec", 3, ENUM_SECT_APP, TOC_YES }, { "appendixsection", 3, ENUM_SECT_APP, TOC_YES }, { "appendix", 2, ENUM_SECT_APP, TOC_YES }, { "subsubsec", 5, ENUM_SECT_YES, TOC_YES }, { "subsubsection", 5, ENUM_SECT_YES, TOC_YES }, { "subsection", 4, ENUM_SECT_YES, TOC_YES }, { "section", 3, ENUM_SECT_YES, TOC_YES }, { "chapter", 2, ENUM_SECT_YES, TOC_YES }, { "subsubheading", 5, ENUM_SECT_NO, TOC_NO }, { "subheading", 4, ENUM_SECT_NO, TOC_NO }, { "heading", 3, ENUM_SECT_NO, TOC_NO }, { "chapheading", 2, ENUM_SECT_NO, TOC_NO }, { "majorheading", 2, ENUM_SECT_NO, TOC_NO }, { "top", 1, ENUM_SECT_NO, TOC_YES }, { NULL, 0, 0, 0 } }; /* The argument of @settitle, used for HTML. */ char *title = NULL; #define APPENDIX_MAGIC 1024 #define UNNUMBERED_MAGIC 2048 /* Number memory for every level @chapter, @section, @subsection, @subsubsection. */ static int numbers [] = { 0, 0, 0, 0 }; /* enum_marker == APPENDIX_MAGIC then we are counting appendencies enum_marker == UNNUMBERED_MAGIC then we are within unnumbered area. Handling situations like this: @unnumbered .. @section ... */ static int enum_marker = 0; /* Organized by level commands. That is, "*" == chapter, "=" == section. */ static char *scoring_characters = "*=-."; /* Amount to offset the name of sectioning commands to levels by. */ static int section_alist_offset = 0; /* num == ENUM_SECT_NO means unnumbered (should never call this) num == ENUM_SECT_YES means numbered num == ENUM_SECT_APP means numbered like A.1 and so on */ char * get_sectioning_number (level, num) int level; int num; { static char s[100]; /* should ever be enough for 99.99.99.99 Appendix A.1 */ char *p; int i; s[0] = 0; /* create enumeration in front of chapter, section, subsection and so on. */ for (i = 0; i < level; i++) { p = s + strlen (s); if ((i == 0) && (enum_marker == APPENDIX_MAGIC)) sprintf (p, "%c.", numbers[i] + 64); /* Should be changed to be more portable */ else sprintf (p, "%d.", numbers[i]); } /* the last number is never followed by a dot */ p = s + strlen (s); if ((num == ENUM_SECT_APP) && (i == 0) && (enum_marker == APPENDIX_MAGIC)) sprintf (p, _("Appendix %c "), numbers[i] + 64); else sprintf (p, "%d ", numbers[i]); return s; } /* Set the level of @top to LEVEL. Return the old level of @top. */ int set_top_section_level (level) int level; { int i, result = -1; for (i = 0; section_alist[i].name; i++) if (strcmp (section_alist[i].name, "top") == 0) { result = section_alist[i].level; section_alist[i].level = level; break; } return result; } /* return the index of the given sectioning command in section_alist */ int search_sectioning (text) char *text; { int i; char *t; /* ignore the optional command prefix */ if (text[0] == COMMAND_PREFIX) text++; for (i = 0; (t = section_alist[i].name); i++) { if (strcmp (t, text) == 0) { return i; } } return -1; } /* Return an integer which identifies the type section present in TEXT. */ int what_section (text) char *text; { int index, j; char *temp; int return_val; find_section_command: for (j = 0; text[j] && cr_or_whitespace (text[j]); j++); if (text[j] != COMMAND_PREFIX) return -1; text = text + j + 1; /* We skip @c, @comment, and @?index commands. */ if ((strncmp (text, "comment", strlen ("comment")) == 0) || (text[0] == 'c' && cr_or_whitespace (text[1])) || (strcmp (text + 1, "index") == 0)) { while (*text++ != '\n'); goto find_section_command; } /* Handle italicized sectioning commands. */ if (*text == 'i') text++; for (j = 0; text[j] && !cr_or_whitespace (text[j]); j++); temp = xmalloc (1 + j); strncpy (temp, text, j); temp[j] = 0; index = search_sectioning (temp); free (temp); if (index >= 0) { return_val = section_alist[index].level + section_alist_offset; if (return_val < 0) return_val = 0; else if (return_val > 5) return_val = 5; return return_val; } return -1; } - void sectioning_underscore (cmd) char *cmd; { + if (xml) + { + char *temp; + int level; + temp = xmalloc (2 + strlen (cmd)); + temp[0] = COMMAND_PREFIX; + strcpy (&temp[1], cmd); + level = what_section (temp); + level -= 2; + free (temp); + xml_close_sections (level); + /* Mark the beginning of the section + If the next command is printindex, we will remove + the section and put an Index instead */ + flush_output (); + xml_last_section_output_position = output_paragraph_offset; + + xml_insert_element (xml_element (cmd), START); + xml_insert_element (TITLE, START); + xml_open_section (level, cmd); + get_rest_of_line (0, &temp); + execute_string ("%s\n", temp); + free (temp); + xml_insert_element (TITLE, END); + } + else + { char character; char *temp; int level; temp = xmalloc (2 + strlen (cmd)); temp[0] = COMMAND_PREFIX; strcpy (&temp[1], cmd); level = what_section (temp); free (temp); level -= 2; if (level < 0) level = 0; if (html) sectioning_html (level, cmd); else { character = scoring_characters[level]; insert_and_underscore (level, character, cmd); + } } } /* insert_and_underscore and sectioning_html are the only functions which call this. I have created this, because it was exactly the same code in both functions. */ static char * handle_enum_increment (level, index) int level; int index; { /* special for unnumbered */ if (number_sections && section_alist[index].num == ENUM_SECT_NO) { if (level == 0 && enum_marker != UNNUMBERED_MAGIC) enum_marker = UNNUMBERED_MAGIC; } /* enumerate only things which are allowed */ if (number_sections && section_alist[index].num) { /* reset the marker if we get into enumerated areas */ if (section_alist[index].num == ENUM_SECT_YES && level == 0 && enum_marker == UNNUMBERED_MAGIC) enum_marker = 0; /* This is special for appendix; if we got the first time an appendix command then we are entering appendix. Thats the point we have to start countint with A, B and so on. */ if (section_alist[index].num == ENUM_SECT_APP && level == 0 && enum_marker != APPENDIX_MAGIC) { enum_marker = APPENDIX_MAGIC; numbers [0] = 0; /* this means we start with Appendix A */ } /* only increment counters if we are not in unnumbered area. This handles situations like this: @unnumbered .... This sets enum_marker to UNNUMBERED_MAGIC @section .... */ if (enum_marker != UNNUMBERED_MAGIC) { int i; /* reset all counters which are one level deeper */ for (i = level; i < 3; i++) numbers [i + 1] = 0; numbers[level]++; return xstrdup (get_sectioning_number (level, section_alist[index].num)); } } /* if (number_sections)... */ return xstrdup (""); } /* Insert the text following input_text_offset up to the end of the line in a new, separate paragraph. Directly underneath it, insert a line of WITH_CHAR, the same length of the inserted text. */ void insert_and_underscore (level, with_char, cmd) int level; int with_char; char *cmd; { int i, len; int index; int old_no_indent; unsigned char *starting_pos, *ending_pos; char *temp; close_paragraph (); filling_enabled = indented_fill = 0; old_no_indent = no_indent; no_indent = 1; if (macro_expansion_output_stream && !executing_string) append_to_expansion_output (input_text_offset + 1); get_rest_of_line (0, &temp); starting_pos = output_paragraph + output_paragraph_offset; index = search_sectioning (cmd); if (index < 0) { /* should never happen, but a poor guy, named Murphy ... */ warning (_("Internal error (search_sectioning) \"%s\"!"), cmd); return; } /* This is a bit tricky: we must produce "X.Y SECTION-NAME" in the Info output and in TOC, but only SECTION-NAME in the macro-expanded output. */ /* Step 1: produce "X.Y" and add it to Info output. */ add_word (handle_enum_increment (level, index)); /* Step 2: add "SECTION-NAME" to both Info and macro-expanded output. */ if (macro_expansion_output_stream && !executing_string) { char *temp1 = xmalloc (2 + strlen (temp)); sprintf (temp1, "%s\n", temp); remember_itext (input_text, input_text_offset); me_execute_string (temp1); free (temp1); } else execute_string ("%s\n", temp); /* Step 3: pluck "X.Y SECTION-NAME" from the output buffer and insert it into the TOC. */ ending_pos = output_paragraph + output_paragraph_offset; if (section_alist[index].toc == TOC_YES) toc_add_entry (substring (starting_pos, ending_pos - 1), level, current_node, NULL); free (temp); len = (ending_pos - starting_pos) - 1; for (i = 0; i < len; i++) add_char (with_char); insert ('\n'); close_paragraph (); filling_enabled = 1; no_indent = old_no_indent; } /* Insert the text following input_text_offset up to the end of the line as an HTML heading element of the appropriate `level' and tagged as an anchor for the current node.. */ void sectioning_html (level, cmd) int level; char *cmd; { static int toc_ref_count = 0; int index; int old_no_indent; unsigned char *starting_pos, *ending_pos; char *temp, *toc_anchor = NULL; close_paragraph (); filling_enabled = indented_fill = 0; old_no_indent = no_indent; no_indent = 1; - add_word_args ("", level + 1); /* level 0 is

    */ + add_word_args ("", level + 2); /* level 0 (chapter) is

    */ /* If we are outside of any node, produce an anchor that the TOC could refer to. */ if (!current_node || !*current_node) { + static const char a_name[] = "", toc_ref_count++); - toc_anchor = substring (starting_pos + 9, + add_word_args ("%sTOC%d\">", a_name, toc_ref_count++); + toc_anchor = substring (starting_pos + sizeof (a_name) - 1, output_paragraph + output_paragraph_offset); + /* This must be added after toc_anchor is extracted, since + toc_anchor cannot include the closing . For details, + see toc.c:toc_add_entry and toc.c:contents_update_html. */ + add_word (""); } starting_pos = output_paragraph + output_paragraph_offset; if (macro_expansion_output_stream && !executing_string) append_to_expansion_output (input_text_offset + 1); get_rest_of_line (0, &temp); index = search_sectioning (cmd); if (index < 0) { /* should never happen, but a poor guy, named Murphy ... */ warning (_("Internal error (search_sectioning) \"%s\"!"), cmd); return; } /* Produce "X.Y" and add it to HTML output. */ add_word (handle_enum_increment (level, index)); /* add the section name to both HTML and macro-expanded output. */ if (macro_expansion_output_stream && !executing_string) { remember_itext (input_text, input_text_offset); me_execute_string (temp); write_region_to_macro_output ("\n", 0, 1); } else execute_string ("%s", temp); ending_pos = output_paragraph + output_paragraph_offset; /* Pluck ``X.Y SECTION-NAME'' from the output buffer and insert it into the TOC. */ if (section_alist[index].toc == TOC_YES) toc_add_entry (substring (starting_pos, ending_pos), level, current_node, toc_anchor); - + free (temp); if (outstanding_node) outstanding_node = 0; - add_word_args ("", level+1); + add_word_args ("", level + 2); close_paragraph(); filling_enabled = 1; no_indent = old_no_indent; } /* Shift the meaning of @section to @chapter. */ void cm_raisesections () { discard_until ("\n"); section_alist_offset--; } /* Shift the meaning of @chapter to @section. */ void cm_lowersections () { discard_until ("\n"); section_alist_offset++; } /* The command still works, but prints a warning message in addition. */ void cm_ideprecated (arg, start, end) int arg, start, end; { warning (_("%c%s is obsolete; use %c%s instead"), COMMAND_PREFIX, command, COMMAND_PREFIX, command + 1); sectioning_underscore (command + 1); } /* Treat this just like @unnumbered. The only difference is in node defaulting. */ void cm_top () { /* It is an error to have more than one @top. */ if (top_node_seen && strcmp (current_node, "Top") != 0) { TAG_ENTRY *tag = tag_table; line_error (_("Node with %ctop as a section already exists"), COMMAND_PREFIX); while (tag) { if (tag->flags & TAG_FLAG_IS_TOP) { - int old_line_number = line_number; - char *old_input_filename = input_filename; - - line_number = tag->line_no; - input_filename = tag->filename; - line_error (_("Here is the %ctop node"), COMMAND_PREFIX); - input_filename = old_input_filename; - line_number = old_line_number; + file_line_error (tag->filename, tag->line_no, + _("Here is the %ctop node"), COMMAND_PREFIX); return; } tag = tag->next_ent; } } else { TAG_ENTRY *top_node = find_node ("Top"); top_node_seen = 1; - /* It is an error to use @top before you have used @node. */ + /* It is an error to use @top before using @node. */ if (!tag_table) { char *top_name; get_rest_of_line (0, &top_name); line_error (_("%ctop used before %cnode, defaulting to %s"), COMMAND_PREFIX, COMMAND_PREFIX, top_name); execute_string ("@node Top, , (dir), (dir)\n@top %s\n", top_name); free (top_name); return; } - else if (html && splitting) - { - char *next = top_node ? top_node->next : NULL; - - add_word ("

    "); - if (next) - { - add_word (_("Next:")); - add_word ("\n"); - } - } cm_unnumbered (); /* The most recently defined node is the top node. */ tag_table->flags |= TAG_FLAG_IS_TOP; /* Now set the logical hierarchical level of the Top node. */ { int orig_offset = input_text_offset; input_text_offset = search_forward (node_search_string, orig_offset); if (input_text_offset > 0) { int this_section; /* We have encountered a non-top node, so mark that one exists. */ non_top_node_seen = 1; /* Move to the end of this line, and find out what the sectioning command is here. */ while (input_text[input_text_offset] != '\n') input_text_offset++; if (input_text_offset < input_text_length) input_text_offset++; this_section = what_section (input_text + input_text_offset); /* If we found a sectioning command, then give the top section a level of this section - 1. */ if (this_section != -1) set_top_section_level (this_section - 1); } input_text_offset = orig_offset; } } } /* The remainder of the text on this line is a chapter heading. */ void cm_chapter () { sectioning_underscore ("chapter"); } /* The remainder of the text on this line is a section heading. */ void cm_section () { sectioning_underscore ("section"); } /* The remainder of the text on this line is a subsection heading. */ void cm_subsection () { sectioning_underscore ("subsection"); } /* The remainder of the text on this line is a subsubsection heading. */ void cm_subsubsection () { sectioning_underscore ("subsubsection"); } /* The remainder of the text on this line is an unnumbered heading. */ void cm_unnumbered () { sectioning_underscore ("unnumbered"); } /* The remainder of the text on this line is an unnumbered section heading. */ void cm_unnumberedsec () { sectioning_underscore ("unnumberedsec"); } /* The remainder of the text on this line is an unnumbered subsection heading. */ void cm_unnumberedsubsec () { sectioning_underscore ("unnumberedsubsec"); } /* The remainder of the text on this line is an unnumbered subsubsection heading. */ void cm_unnumberedsubsubsec () { sectioning_underscore ("unnumberedsubsubsec"); } /* The remainder of the text on this line is an appendix heading. */ void cm_appendix () { sectioning_underscore ("appendix"); } /* The remainder of the text on this line is an appendix section heading. */ void cm_appendixsec () { sectioning_underscore ("appendixsec"); } /* The remainder of the text on this line is an appendix subsection heading. */ void cm_appendixsubsec () { sectioning_underscore ("appendixsubsec"); } /* The remainder of the text on this line is an appendix subsubsection heading. */ void cm_appendixsubsubsec () { sectioning_underscore ("appendixsubsubsec"); } /* Compatibility functions substitute for chapter, section, etc. */ void cm_majorheading () { sectioning_underscore ("majorheading"); } void cm_chapheading () { sectioning_underscore ("chapheading"); } void cm_heading () { sectioning_underscore ("heading"); } void cm_subheading () { sectioning_underscore ("subheading"); } void cm_subsubheading () { sectioning_underscore ("subsubheading"); } diff --git a/contrib/texinfo/makeinfo/texinfo.dtd b/contrib/texinfo/makeinfo/texinfo.dtd new file mode 100644 index 000000000000..ead278a065e1 --- /dev/null +++ b/contrib/texinfo/makeinfo/texinfo.dtd @@ -0,0 +1,345 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/contrib/texinfo/makeinfo/texinfo.xsl b/contrib/texinfo/makeinfo/texinfo.xsl new file mode 100644 index 000000000000..401e9be06a89 --- /dev/null +++ b/contrib/texinfo/makeinfo/texinfo.xsl @@ -0,0 +1,242 @@ + + + + + + + + + + + <xsl:apply-templates select="TEXINFO/SETTITLE" mode="head"/> + + + + + + + + + + + + + + + + + + + +

    + + + + + + + +

    +
    + + + + + + + +

    + + + + + +

    Footnotes

    +
      + +
    +

    +
    + + +

    + + + + + + +

    +
    + + + + + + [ Previous: + + + # + + + + ] + + + + + + [ Up: + + + # + + + + ] + + + + + + [ Next: + + + # + + + + ] + + + + + + +

    Menu

    + +
    + + + + + # + + + + : + +

    +
    + + + + + + + + + + + + + + + + + + +

    +
    + + + +
      + +
    +
    + + +
  • + +
  • +
    + + +
      + +
    +
    + + +
  • + +
  • +
    + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    +  
    + 
    +
    + + + + + + + + + + + +
  • +
    + + + diff --git a/contrib/texinfo/makeinfo/toc.c b/contrib/texinfo/makeinfo/toc.c index 41c5ffb8edcf..0340f4a9f69f 100644 --- a/contrib/texinfo/makeinfo/toc.c +++ b/contrib/texinfo/makeinfo/toc.c @@ -1,476 +1,532 @@ /* toc.c -- table of contents handling. - $Id: toc.c,v 1.14 1999/08/09 20:28:18 karl Exp $ + $Id: toc.c,v 1.21 2002/02/23 19:12:15 karl Exp $ - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 01, 02 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 Karl Heinz Marbaise . */ #include "system.h" #include "makeinfo.h" #include "cmds.h" #include "files.h" #include "macro.h" #include "node.h" +#include "html.h" #include "lang.h" #include "makeinfo.h" #include "sectioning.h" #include "toc.h" - /* array of toc entries */ static TOC_ENTRY_ELT **toc_entry_alist = NULL; /* toc_counter start from 0 ... n for every @chapter, @section ... */ static int toc_counter = 0; /* the file where we found the @contents directive */ char *contents_filename; /* the file where we found the @shortcontents directive */ char *shortcontents_filename; static const char contents_placebo[] = "\n...Table of Contents...\n"; static const char shortcontents_placebo[] = "\n...Short Contents...\n"; static const char lots_of_stars[] = "***************************************************************************"; /* Routine to add an entry to the table of contents */ int toc_add_entry (tocname, level, node_name, anchor) char *tocname; int level; char *node_name; char *anchor; { char *tocname_and_node, *expanded_node, *s, *d; + char *filename = NULL; if (!node_name) node_name = ""; /* I assume that xrealloc behaves like xmalloc if toc_entry_alist is NULL */ toc_entry_alist = xrealloc (toc_entry_alist, (toc_counter + 1) * sizeof (TOC_ENTRY_ELT *)); toc_entry_alist[toc_counter] = xmalloc (sizeof (TOC_ENTRY_ELT)); if (html) { /* We need to insert the expanded node name into the TOC, so - that when we eventually output the TOC, its that separates node from tocname. */ + expansion of HTML-escaping is for the & character, which is + output as "&". 2 is for "> that separates node from tocname. */ d = tocname_and_node = (char *)xmalloc (2 + 5 * strlen (expanded_node) - + strlen (tocname) + 1); + + strlen (tocname) + 1); if (!anchor) - { - for (; *s; s++) - { - if (*s == '&') - { - strcpy (d, "&"); - d += 5; - } - else if (! URL_SAFE_CHAR (*s)) - { - sprintf (d, "%%%x", (unsigned char) *s); - /* do this manually since sprintf returns char * on - SunOS 4 and other old systems. */ - while (*d) - d++; - } - else - *d++ = *s; - } - strcpy (d, "\">"); - } + { + for (; *s; s++) + { + if (*s == '&') + { + strcpy (d, "&"); + d += 5; + } + else if (! URL_SAFE_CHAR (*s)) + { + sprintf (d, "%%%x", (unsigned char) *s); + /* do this manually since sprintf returns char * on + SunOS 4 and other old systems. */ + while (*d) + d++; + } + else + *d++ = *s; + } + strcpy (d, "\">"); + } else - /* Section outside any node, they provided explicit anchor. */ - strcpy (d, anchor); + /* Section outside any node, they provided explicit anchor. */ + strcpy (d, anchor); strcat (d, tocname); free (tocname); /* it was malloc'ed by substring() */ free (expanded_node); toc_entry_alist[toc_counter]->name = tocname_and_node; } else toc_entry_alist[toc_counter]->name = tocname; /* WARNING! The node name saved in containing_node member must be the node name with _only_ macros expanded (the macros in the node name are expanded by cm_node when it grabs the name from the @node directive). Non-macros, like @value, @@ and other @-commands must NOT be expanded in containing_node, because toc_find_section_of_node looks up the node name where they are also unexpanded. You *have* been warned! */ toc_entry_alist[toc_counter]->containing_node = xstrdup (node_name); toc_entry_alist[toc_counter]->level = level; toc_entry_alist[toc_counter]->number = toc_counter; + toc_entry_alist[toc_counter]->html_file = filename; /* have to be done at least */ return toc_counter++; } /* Return the name of a chapter/section/subsection etc. that corresponds to the node NODE. If the node isn't found, return NULL. WARNING! This function relies on NODE being unexpanded except for macros (i.e., @value, @@, and other non-macros should NOT be expanded), because the containing_node member stores unexpanded node names. Note that this function returns the first section whose containing node is NODE. Thus, they will lose if they use more than a single chapter structioning command in a node, or if they have a node without any structuring commands. */ char * toc_find_section_of_node (node) char *node; { int i; if (!node) node = ""; for (i = 0; i < toc_counter; i++) if (STREQ (node, toc_entry_alist[i]->containing_node)) return toc_entry_alist[i]->name; return NULL; } /* free up memory used by toc entries */ void toc_free () { int i; if (toc_counter) { for (i = 0; i < toc_counter; i++) { free (toc_entry_alist[i]->name); free (toc_entry_alist[i]->containing_node); free (toc_entry_alist[i]); } free (toc_entry_alist); toc_entry_alist = NULL; /* to be sure ;-) */ toc_counter = 0; /* to be absolutley sure ;-) */ } } -/* print table of contents in HTML, may be we can produce a standalone - HTML file? */ +/* Print table of contents in HTML. */ + static void contents_update_html (fp) FILE *fp; { int i; int k; int last_level; /* does exist any toc? */ if (!toc_counter) /* no, so return to sender ;-) */ return; flush_output (); /* in case we are writing stdout */ - fprintf (fp, "\n

    %s

    \n
    \n\n", fp); } /* print table of contents in ASCII (--no-headers) May be we should create a new command line switch --ascii ? */ static void contents_update_info (fp) FILE *fp; { int i; int k; if (!toc_counter) return; flush_output (); /* in case we are writing stdout */ fprintf (fp, "%s\n%.*s\n\n", _("Table of Contents"), (int) strlen (_("Table of Contents")), lots_of_stars); for (i = 0; i < toc_counter; i++) { if (toc_entry_alist[i]->level == 0) fputs ("\n", fp); /* indention with two spaces per level, should this changed? */ for (k = 0; k < toc_entry_alist[i]->level; k++) fputs (" ", fp); fprintf (fp, "%s\n", toc_entry_alist[i]->name); } fputs ("\n\n", fp); } /* shortcontents in HTML; Should this produce a standalone file? */ static void shortcontents_update_html (fp) FILE *fp; { int i; + char *toc_file; /* does exist any toc? */ if (!toc_counter) return; - + flush_output (); /* in case we are writing stdout */ - fprintf (fp, "\n

    %s

    \n