* texinfo: Remove directory from GCC.
From-SVN: r38384
This commit is contained in:
parent
051a55e097
commit
c387606fe8
228 changed files with 4 additions and 149672 deletions
|
@ -1,3 +1,7 @@
|
|||
2000-12-19 Joseph S. Myers <jsm28@cam.ac.uk>
|
||||
|
||||
* texinfo: Remove directory from GCC.
|
||||
|
||||
2000-12-18 Joseph S. Myers <jsm28@cam.ac.uk>
|
||||
|
||||
* COPYING: Update to current
|
||||
|
|
|
@ -1,225 +0,0 @@
|
|||
Notes on the Free Translation Project
|
||||
*************************************
|
||||
|
||||
Free software is going international! The Free Translation Project
|
||||
is a way to get maintainers of free software, translators, and users all
|
||||
together, so that will gradually become able to speak many languages.
|
||||
A few packages already provide translations for their messages.
|
||||
|
||||
If you found this `ABOUT-NLS' file inside a distribution, you may
|
||||
assume that the distributed package does use GNU `gettext' internally,
|
||||
itself available at your nearest GNU archive site. But you do *not*
|
||||
need to install GNU `gettext' prior to configuring, installing or using
|
||||
this package with messages translated.
|
||||
|
||||
Installers will find here some useful hints. These notes also
|
||||
explain how users should proceed for getting the programs to use the
|
||||
available translations. They tell how people wanting to contribute and
|
||||
work at translations should contact the appropriate team.
|
||||
|
||||
When reporting bugs in the `intl/' directory or bugs which may be
|
||||
related to internationalization, you should tell about the version of
|
||||
`gettext' which is used. The information can be found in the
|
||||
`intl/VERSION' file, in internationalized packages.
|
||||
|
||||
One advise in advance
|
||||
=====================
|
||||
|
||||
If you want to exploit the full power of internationalization, you
|
||||
should configure it using
|
||||
|
||||
./configure --with-included-gettext
|
||||
|
||||
to force usage of internationalizing routines provided within this
|
||||
package, despite the existence of internationalizing capabilities in the
|
||||
operating system where this package is being installed. So far, only
|
||||
the `gettext' implementation in the GNU C library version 2 provides as
|
||||
many features (such as locale alias or message inheritance) as the
|
||||
implementation here. It is also not possible to offer this additional
|
||||
functionality on top of a `catgets' implementation. Future versions of
|
||||
GNU `gettext' will very likely convey even more functionality. So it
|
||||
might be a good idea to change to GNU `gettext' as soon as possible.
|
||||
|
||||
So you need not provide this option if you are using GNU libc 2 or
|
||||
you have installed a recent copy of the GNU gettext package with the
|
||||
included `libintl'.
|
||||
|
||||
INSTALL Matters
|
||||
===============
|
||||
|
||||
Some packages are "localizable" when properly installed; the
|
||||
programs they contain can be made to speak your own native language.
|
||||
Most such packages use GNU `gettext'. Other packages have their own
|
||||
ways to internationalization, predating GNU `gettext'.
|
||||
|
||||
By default, this package will be installed to allow translation of
|
||||
messages. It will automatically detect whether the system provides
|
||||
usable `catgets' (if using this is selected by the installer) or
|
||||
`gettext' functions. If neither is available, the GNU `gettext' own
|
||||
library will be used. This library is wholly contained within this
|
||||
package, usually in the `intl/' subdirectory, so prior installation of
|
||||
the GNU `gettext' package is *not* required. Installers may use
|
||||
special options at configuration time for changing the default
|
||||
behaviour. The commands:
|
||||
|
||||
./configure --with-included-gettext
|
||||
./configure --with-catgets
|
||||
./configure --disable-nls
|
||||
|
||||
will respectively bypass any pre-existing `catgets' or `gettext' to use
|
||||
the internationalizing routines provided within this package, enable
|
||||
the use of the `catgets' functions (if found on the locale system), or
|
||||
else, *totally* disable translation of messages.
|
||||
|
||||
When you already have GNU `gettext' installed on your system and run
|
||||
configure without an option for your new package, `configure' will
|
||||
probably detect the previously built and installed `libintl.a' file and
|
||||
will decide to use this. This might be not what is desirable. You
|
||||
should use the more recent version of the GNU `gettext' library. I.e.
|
||||
if the file `intl/VERSION' shows that the library which comes with this
|
||||
package is more recent, you should use
|
||||
|
||||
./configure --with-included-gettext
|
||||
|
||||
to prevent auto-detection.
|
||||
|
||||
By default the configuration process will not test for the `catgets'
|
||||
function and therefore they will not be used. The reasons are already
|
||||
given above: the emulation on top of `catgets' cannot provide all the
|
||||
extensions provided by the GNU `gettext' library. If you nevertheless
|
||||
want to use the `catgets' functions use
|
||||
|
||||
./configure --with-catgets
|
||||
|
||||
to enable the test for `catgets' (this causes no harm if `catgets' is
|
||||
not available on your system). If you really select this option we
|
||||
would like to hear about the reasons because we cannot think of any
|
||||
good one ourself.
|
||||
|
||||
Internationalized packages have usually many `po/LL.po' files, where
|
||||
LL gives an ISO 639 two-letter code identifying the language. Unless
|
||||
translations have been forbidden at `configure' time by using the
|
||||
`--disable-nls' switch, all available translations are installed
|
||||
together with the package. However, the environment variable `LINGUAS'
|
||||
may be set, prior to configuration, to limit the installed set.
|
||||
`LINGUAS' should then contain a space separated list of two-letter
|
||||
codes, stating which languages are allowed.
|
||||
|
||||
Using This Package
|
||||
==================
|
||||
|
||||
As a user, if your language has been installed for this package, you
|
||||
only have to set the `LANG' environment variable to the appropriate
|
||||
ISO 639 `LL' two-letter code prior to using the programs in the
|
||||
package. For example, let's suppose that you speak German. At the
|
||||
shell prompt, merely execute `setenv LANG de' (in `csh'),
|
||||
`export LANG; LANG=de' (in `sh') or `export LANG=de' (in `bash'). This
|
||||
can be done from your `.login' or `.profile' file, once and for all.
|
||||
|
||||
An operating system might already offer message localization for
|
||||
many of its programs, while other programs have been installed locally
|
||||
with the full capabilities of GNU `gettext'. Just using `gettext'
|
||||
extended syntax for `LANG' would break proper localization of already
|
||||
available operating system programs. In this case, users should set
|
||||
both `LANGUAGE' and `LANG' variables in their environment, as programs
|
||||
using GNU `gettext' give preference to `LANGUAGE'. For example, some
|
||||
Swedish users would rather read translations in German than English for
|
||||
when Swedish is not available. This is easily accomplished by setting
|
||||
`LANGUAGE' to `sv:de' while leaving `LANG' to `sv'.
|
||||
|
||||
Translating Teams
|
||||
=================
|
||||
|
||||
For the Free Translation Project to be a success, we need interested
|
||||
people who like their own language and write it well, and who are also
|
||||
able to synergize with other translators speaking the same language.
|
||||
Each translation team has its own mailing list, courtesy of Linux
|
||||
International. You may reach your translation team at the address
|
||||
`LL@li.org', replacing LL by the two-letter ISO 639 code for your
|
||||
language. Language codes are *not* the same as the country codes given
|
||||
in ISO 3166. The following translation teams exist, as of August 1997:
|
||||
|
||||
Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en',
|
||||
Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian
|
||||
`hu', Irish `ga', Italian `it', Indonesian `id', Japanese `ja',
|
||||
Korean `ko', Latin `la', Norwegian `no', Persian `fa', Polish
|
||||
`pl', Portuguese `pt', Russian `ru', Slovenian `sl', Spanish `es',
|
||||
Swedish `sv', and Turkish `tr'.
|
||||
|
||||
For example, you may reach the Chinese translation team by writing to
|
||||
`zh@li.org'.
|
||||
|
||||
If you'd like to volunteer to *work* at translating messages, you
|
||||
should become a member of the translating team for your own language.
|
||||
The subscribing address is *not* the same as the list itself, it has
|
||||
`-request' appended. For example, speakers of Swedish can send a
|
||||
message to `sv-request@li.org', having this message body:
|
||||
|
||||
subscribe
|
||||
|
||||
Keep in mind that team members are expected to participate
|
||||
*actively* in translations, or at solving translational difficulties,
|
||||
rather than merely lurking around. If your team does not exist yet and
|
||||
you want to start one, or if you are unsure about what to do or how to
|
||||
get started, please write to `translation@iro.umontreal.ca' to reach the
|
||||
coordinator for all translator teams.
|
||||
|
||||
The English team is special. It works at improving and uniformizing
|
||||
the terminology in use. Proven linguistic skill are praised more than
|
||||
programming skill, here.
|
||||
|
||||
Available Packages
|
||||
==================
|
||||
|
||||
Languages are not equally supported in all packages. The following
|
||||
matrix shows the current state of internationalization, as of August
|
||||
1997. The matrix shows, in regard of each package, for which languages
|
||||
PO files have been submitted to translation coordination.
|
||||
|
||||
Ready PO files cs da de en es fi fr it ja ko nl no pl pt sl sv
|
||||
.-------------------------------------------------.
|
||||
bash | [] [] [] | 3
|
||||
bison | [] [] [] | 3
|
||||
clisp | [] [] [] [] | 4
|
||||
cpio | [] [] [] [] [] | 5
|
||||
diffutils | [] [] [] [] [] | 5
|
||||
enscript | [] [] [] [] [] [] | 6
|
||||
fileutils | [] [] [] [] [] [] [] [] [] [] | 10
|
||||
findutils | [] [] [] [] [] [] [] [] | 8
|
||||
flex | [] [] [] [] | 4
|
||||
gcal | [] [] [] [] [] | 5
|
||||
gettext | [] [] [] [] [] [] [] [] [] [] | 11
|
||||
grep | [] [] [] [] [] [] [] [] [] | 9
|
||||
hello | [] [] [] [] [] [] [] [] [] [] | 10
|
||||
id-utils | [] [] [] | 3
|
||||
indent | [] [] [] [] | 4
|
||||
libc | [] [] [] [] [] [] [] | 7
|
||||
m4 | [] [] [] [] [] | 5
|
||||
make | [] [] [] [] [] [] | 6
|
||||
music | [] [] | 2
|
||||
ptx | [] [] [] [] [] [] [] [] | 8
|
||||
recode | [] [] [] [] [] [] [] [] [] | 9
|
||||
sh-utils | [] [] [] [] [] [] [] | 7
|
||||
sharutils | [] [] [] [] [] | 5
|
||||
tar | [] [] [] [] [] [] [] [] [] [] | 10
|
||||
texinfo | [] | 1
|
||||
textutils | [] [] [] [] [] [] [] [] [] | 9
|
||||
wdiff | [] [] [] [] [] [] [] [] | 8
|
||||
`-------------------------------------------------'
|
||||
16 languages cs da de en es fi fr it ja ko nl no pl pt sl sv
|
||||
27 packages 3 2 24 1 17 1 26 2 1 11 20 9 19 7 7 17 167
|
||||
|
||||
Some counters in the preceding matrix are higher than the number of
|
||||
visible blocks let us expect. This is because a few extra PO files are
|
||||
used for implementing regional variants of languages, or language
|
||||
dialects.
|
||||
|
||||
For a PO file in the matrix above to be effective, the package to
|
||||
which it applies should also have been internationalized and
|
||||
distributed as such by its maintainer. There might be an observable
|
||||
lag between the mere existence a PO file and its wide availability in a
|
||||
distribution.
|
||||
|
||||
If August 1997 seems to be old, you may fetch a more recent copy of
|
||||
this `ABOUT-NLS' file on most GNU archive sites.
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
Richard Stallman, Brian Fox, Bob Chassell, Noah Friedman, Paul Rubin,
|
||||
Karl Berry, and no doubt many others.
|
||||
|
340
texinfo/COPYING
340
texinfo/COPYING
|
@ -1,340 +0,0 @@
|
|||
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.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
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 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.
|
||||
|
||||
<signature of Ty Coon>, 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.
|
3537
texinfo/ChangeLog
3537
texinfo/ChangeLog
File diff suppressed because it is too large
Load diff
184
texinfo/INSTALL
184
texinfo/INSTALL
|
@ -1,184 +0,0 @@
|
|||
Note most of this information is out of date and superceded by the EGCS
|
||||
install procedures. It is provided for historical reference only.
|
||||
|
||||
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.
|
||||
|
||||
`--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.
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
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
|
||||
|
||||
If you are using GNU Emacs, you may want to install the Emacs Lisp files
|
||||
permanently. Move them to a directory in the load-path for Emacs;
|
||||
otherwise Emacs will not be able to load the autoloaded support files, such
|
||||
as `texinfmt.el'.
|
||||
|
||||
The `texinfo.el' file contains the autoload commands; it is the only
|
||||
file that needs to be loaded initially. If your Emacs does not
|
||||
automatically load `texinfo.el', you can tell it to do so by placing
|
||||
the following in `default.el' or in your `.emacs' file:
|
||||
|
||||
(load "texinfo")
|
||||
|
||||
|
||||
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:
|
||||
|
||||
$ make texinfo.dvi
|
||||
$ (cd info; make info.dvi info-stnd.dvi)
|
||||
$ (cd makeinfo; make makeinfo.dvi)
|
||||
|
||||
You can then print the resulting .dvi files with the `lpr' command (on BSD
|
||||
systems. On SysV systems the command is `lp'. Consult your man pages for
|
||||
more information).
|
||||
|
||||
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.
|
|
@ -1,21 +0,0 @@
|
|||
## Makefile.am for texinfo.
|
||||
## $Id: Makefile.am,v 1.5 1998/04/10 00:37:57 law Exp $
|
||||
## Process this file with automake to produce Makefile.in in all directories.
|
||||
|
||||
# Be sure we're using the right version of Automake.
|
||||
# 1.2f was the first version that supported .txi as a Texinfo suffix.
|
||||
AUTOMAKE_OPTIONS = 1.2f
|
||||
|
||||
# Additional files to distribute.
|
||||
EXTRA_DIST = INTRODUCTION dir-example
|
||||
|
||||
# All subdirectories.
|
||||
# Do intl/ and lib/ first since the C programs depend on them.
|
||||
# Do doc/ last so makeinfo will be built when we get there.
|
||||
# Others are alphabetical.
|
||||
SUBDIRS = intl lib info makeinfo po util doc
|
||||
# ??? For EGCS, only build the stuff we actually need. This eliminates the
|
||||
# need for xgettext that exists in the po subdirectory. We do need util in
|
||||
# order to get install-info, which is used as part of the gcc build/install
|
||||
# process.
|
||||
SUBDIRS = intl lib makeinfo util
|
|
@ -1,355 +0,0 @@
|
|||
# Makefile.in generated automatically by automake 1.3 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# Be sure we're using the right version of Automake.
|
||||
# 1.2f was the first version that supported .txi as a Texinfo suffix.
|
||||
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DISTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = .
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
CATALOGS = @CATALOGS@
|
||||
CATOBJEXT = @CATOBJEXT@
|
||||
CC = @CC@
|
||||
DATADIRNAME = @DATADIRNAME@
|
||||
EXEEXT = @EXEEXT@
|
||||
GENCAT = @GENCAT@
|
||||
GMOFILES = @GMOFILES@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GT_NO = @GT_NO@
|
||||
GT_YES = @GT_YES@
|
||||
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTOBJEXT = @INSTOBJEXT@
|
||||
INTLDEPS = @INTLDEPS@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTLOBJS = @INTLOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
PACKAGE = @PACKAGE@
|
||||
POFILES = @POFILES@
|
||||
POSUB = @POSUB@
|
||||
RANLIB = @RANLIB@
|
||||
TERMLIBS = @TERMLIBS@
|
||||
TEXCONFIG = @TEXCONFIG@
|
||||
TEXMF = @TEXMF@
|
||||
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
l = @l@
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.2f
|
||||
|
||||
# Additional files to distribute.
|
||||
EXTRA_DIST = INTRODUCTION dir-example
|
||||
|
||||
# All subdirectories.
|
||||
# Do intl/ and lib/ first since the C programs depend on them.
|
||||
# Do doc/ last so makeinfo will be built when we get there.
|
||||
# Others are alphabetical.
|
||||
SUBDIRS = intl lib info makeinfo po util doc
|
||||
# ??? For EGCS, only build the stuff we actually need. This eliminates the
|
||||
# need for xgettext that exists in the po subdirectory. We do need util in
|
||||
# order to get install-info, which is used as part of the gcc build/install
|
||||
# process.
|
||||
SUBDIRS = intl lib makeinfo util
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_COMMON = README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL \
|
||||
Makefile.am Makefile.in NEWS THANKS TODO acconfig.h acinclude.m4 \
|
||||
aclocal.m4 config.guess config.h.in config.sub configure configure.in \
|
||||
missing mkinstalldirs stamp-h.in texinfo.tex
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP = --best
|
||||
all: all-recursive-am all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
$(ACLOCAL_M4): @MAINT@ configure.in acinclude.m4
|
||||
cd $(srcdir) && $(ACLOCAL)
|
||||
|
||||
config.status: $(srcdir)/configure
|
||||
$(SHELL) ./config.status --recheck
|
||||
$(srcdir)/configure: @MAINT@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
|
||||
config.h: stamp-h
|
||||
@:
|
||||
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
|
||||
$(SHELL) ./config.status
|
||||
@echo timestamp > stamp-h
|
||||
$(srcdir)/config.h.in: @MAINT@$(srcdir)/stamp-h.in
|
||||
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
@echo timestamp > $(srcdir)/stamp-h.in
|
||||
|
||||
mostlyclean-hdr:
|
||||
|
||||
clean-hdr:
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h
|
||||
|
||||
maintainer-clean-hdr:
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
all-recursive install-data-recursive install-exec-recursive \
|
||||
installdirs-recursive install-recursive uninstall-recursive \
|
||||
check-recursive installcheck-recursive info-recursive dvi-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
(cd $$subdir && $(MAKE) $$target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
rev="$$subdir $$rev"; \
|
||||
done; \
|
||||
for subdir in $$rev; do \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
(cd $$subdir && $(MAKE) $$target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
(cd $$subdir && $(MAKE) tags); \
|
||||
done
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
-rm -rf $(distdir)
|
||||
GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
|
||||
mkdir $(distdir)/=build
|
||||
mkdir $(distdir)/=inst
|
||||
dc_install_base=`cd $(distdir)/=inst && pwd`; \
|
||||
cd $(distdir)/=build \
|
||||
&& ../configure --with-included-gettext --srcdir=.. --prefix=$$dc_install_base \
|
||||
&& $(MAKE) \
|
||||
&& $(MAKE) dvi \
|
||||
&& $(MAKE) check \
|
||||
&& $(MAKE) install \
|
||||
&& $(MAKE) installcheck \
|
||||
&& $(MAKE) dist
|
||||
-rm -rf $(distdir)
|
||||
@echo "========================"; \
|
||||
echo "$(distdir).tar.gz is ready for distribution"; \
|
||||
echo "========================"
|
||||
dist: distdir
|
||||
-chmod -R a+r $(distdir)
|
||||
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||
-rm -rf $(distdir)
|
||||
dist-all: distdir
|
||||
-chmod -R a+r $(distdir)
|
||||
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||
-rm -rf $(distdir)
|
||||
distdir: $(DISTFILES)
|
||||
-rm -rf $(distdir)
|
||||
mkdir $(distdir)
|
||||
-chmod 777 $(distdir)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file; \
|
||||
done
|
||||
for subdir in $(SUBDIRS); do \
|
||||
test -d $(distdir)/$$subdir \
|
||||
|| mkdir $(distdir)/$$subdir \
|
||||
|| exit 1; \
|
||||
chmod 777 $(distdir)/$$subdir; \
|
||||
(cd $$subdir && $(MAKE) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|
||||
|| exit 1; \
|
||||
done
|
||||
info: info-recursive
|
||||
dvi: dvi-recursive
|
||||
check: all-am
|
||||
$(MAKE) check-recursive
|
||||
installcheck: installcheck-recursive
|
||||
all-recursive-am: config.h
|
||||
$(MAKE) all-recursive
|
||||
|
||||
all-am: Makefile config.h
|
||||
|
||||
install-exec: install-exec-recursive
|
||||
@$(NORMAL_INSTALL)
|
||||
|
||||
install-data: install-data-recursive
|
||||
@$(NORMAL_INSTALL)
|
||||
|
||||
install: install-recursive
|
||||
@:
|
||||
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
installdirs: installdirs-recursive
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(DISTCLEANFILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
|
||||
|
||||
clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
|
||||
|
||||
distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
|
||||
maintainer-clean-generic distclean-am
|
||||
|
||||
mostlyclean: mostlyclean-recursive mostlyclean-am
|
||||
|
||||
clean: clean-recursive clean-am
|
||||
|
||||
distclean: distclean-recursive distclean-am
|
||||
-rm -f config.status
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive maintainer-clean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
-rm -f config.status
|
||||
|
||||
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
|
||||
install-data-recursive uninstall-data-recursive install-exec-recursive \
|
||||
uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
|
||||
all-recursive check-recursive installcheck-recursive info-recursive \
|
||||
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
|
||||
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
|
||||
distclean-tags clean-tags maintainer-clean-tags distdir info dvi \
|
||||
installcheck all-recursive-am all-am install-exec install-data install \
|
||||
uninstall all installdirs mostlyclean-generic distclean-generic \
|
||||
clean-generic maintainer-clean-generic clean mostlyclean distclean \
|
||||
maintainer-clean
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
335
texinfo/NEWS
335
texinfo/NEWS
|
@ -1,335 +0,0 @@
|
|||
This file records noteworthy changes.
|
||||
|
||||
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.
|
||||
|
||||
texinfo-3.0: first release of Texinfo version 2, with many new commands.
|
||||
|
||||
|
||||
Here is the separate NEWS for old releases of Info:
|
||||
|
||||
Version 2.11, Sat Apr 1 09:15:21 1995
|
||||
|
||||
Changes since 2.7 beta:
|
||||
|
||||
Although the basic code remains the same, there are numerous nits
|
||||
fixed, including some display bugs, and a memory leak. Some changes
|
||||
that have taken place with larger impact include the way in which the
|
||||
(dir) node is built; I have added in support for "localdir"
|
||||
directories among other things. Info files may be stored in
|
||||
compressed formats, and in their own subdirectories; menu items which
|
||||
do not explicitly name the node to which they are attached have the
|
||||
menu item name looked up as an Info file if it is not found within the
|
||||
current document. This means that the menu item:
|
||||
|
||||
* Info:: The Info documentation reader.
|
||||
|
||||
in (dir) refers to the info node "(info)Top".
|
||||
|
||||
Please see the ChangeLog and documentation for details on other
|
||||
changes.
|
||||
|
||||
Version 2.7 beta, Wed Dec 30 02:02:38 1992
|
||||
Version 2.6 beta, Tue Dec 22 03:58:07 1992
|
||||
Version 2.5 beta, Tue Dec 8 14:50:35 1992
|
||||
Version 2.4 beta, Sat Nov 28 14:34:02 1992
|
||||
Version 2.3 beta, Fri Nov 27 01:04:13 1992
|
||||
Version 2.2 beta, Tue Nov 24 09:36:08 1992
|
||||
Version 2.1 beta, Tue Nov 17 23:29:36 1992
|
||||
|
||||
Changes since 2.5 beta:
|
||||
|
||||
Note that versions 2.6 and 2.7 Beta were only released to a select group.
|
||||
|
||||
* "info-" removed from the front of M-x commands.
|
||||
|
||||
* Automatic footnote display. When you enter a node which contains
|
||||
footnotes, and the variable "automatic-footnotes" is "On", Info pops
|
||||
up a window containing the footnotes. Likewise, when you leave that
|
||||
node, the window containing the footnotes goes away.
|
||||
|
||||
* Cleaner built in documentation, and documentation functions.
|
||||
|
||||
Use:
|
||||
o `M-x describe-variable' to read a variable's documenation
|
||||
o `M-x describe-key' to find out what a particular keystroke does.
|
||||
o `M-x describe-function' to read a function's documentation.
|
||||
o `M-x where-is' to find out what keys invoke a particular function.
|
||||
|
||||
* Info can "tile" the displayed windows (via "M-x tile-windows"). If
|
||||
the variable "automatic-tiling" is "On", then splitting a window or
|
||||
deleting a window causes the remaining windows to be retiled.
|
||||
|
||||
* You can save every keystroke you type in a "dribble file" by using the
|
||||
`--dribble FILENAME' option. You can initially read keystrokes from an
|
||||
alternate input stream with `--restore FILENAME', or by redirecting
|
||||
input on the command line `info < old-dribble'.
|
||||
|
||||
* New behaviour of menu items. If the label is the same as the
|
||||
target node name, and the node couldn't be found in the current file,
|
||||
treat the label as a file name. For example, a menu entry in "DIR"
|
||||
might contain:
|
||||
|
||||
* Emacs:: Cool text-editor.
|
||||
|
||||
Info would not find the node "(dir)Emacs", so just plain "(emacs)"
|
||||
would be tried.
|
||||
|
||||
* New variable "ISO-Latin" allows you to use European machines with
|
||||
8-bit character sets.
|
||||
|
||||
* Cleanups in echo area reading, and redisplay. Cleanups in handling the
|
||||
window which shows possible completions.
|
||||
|
||||
* Info can now read files that have been compressed. An array in filesys.c
|
||||
maps extensions to programs that can decompress stdin, and write the results
|
||||
to stdout. Currently, ".Z"/uncompress, ".z"/gunzip, and ".Y"/unyabba are
|
||||
supported. The modeline for a compressed file shows "zz" in it.
|
||||
|
||||
* There is a new variable "gc-compressed-files" which, if non-zero, says
|
||||
it is okay to reclaim the file buffer space allocated to a file which
|
||||
was compressed, if, and only if, that file's contents do not appear in
|
||||
any history node.
|
||||
|
||||
* New file `nodemenu.c' implements a few functions for manipulating
|
||||
previously visited nodes. `C-x C-b' (list-visited-nodes) produces a
|
||||
menu of the nodes that could be reached by info-history-node in some
|
||||
window. `C-x b' (select-visited-node) is similar, but reads one of
|
||||
the node names with completion.
|
||||
|
||||
* Keystroke `M-r' (move_to_screen_line) allows the user to place the cursor at
|
||||
the start of a specific screen line. Without a numeric argument, place the
|
||||
cursor on the center line; with an arg, place the cursor on that line.
|
||||
|
||||
* Interruptible display implemented. Basic display speedups and hacks.
|
||||
* The message "*** Tags Out of Date ***" now means what it says.
|
||||
* Index searching with `,' (info-index-next) has been improved.
|
||||
* When scrolling with C-v, C-M-v, or M-v, only "Page Only" scrolling
|
||||
will happen.
|
||||
|
||||
* Continous scrolling (along with `]' (info-global-next) and `['
|
||||
(info-global-prev) works better. `]' and `[' accept numeric
|
||||
arguments, moving that many nodes in that case.
|
||||
|
||||
* `C-x w' (info-toggle-wrap) controls how lines wider than the width
|
||||
of the screen are displayed. If a line is too long, a `$' is
|
||||
displayed in the rightmost column of the window.
|
||||
|
||||
* There are some new variables for controlling the behaviour of Info
|
||||
interactively. The current list of variables is as follows:
|
||||
|
||||
Variable Name Default Value Description
|
||||
------------- ------------- -----------
|
||||
`automatic-footnotes' On When "On", footnotes appear and
|
||||
disappear automatically.
|
||||
|
||||
`automatic-tiling' Off When "On", creating of deleting a
|
||||
window resizes other windows.
|
||||
|
||||
`visible-bell' Off If non-zero, try to use a visible bell.
|
||||
|
||||
`errors-ring-bell' On If non-zero, errors cause a ring.
|
||||
|
||||
`show-index-match' On If non-zero, the portion of the string
|
||||
matched is highlighted by changing its
|
||||
case.
|
||||
|
||||
`scroll-behaviour' Continuous One of "Continuous", "Next Only", or
|
||||
"Page Only". "Page Only" prevents you from
|
||||
scrolling past the bottom or top of a node.
|
||||
"Next Only" causes the Next or Prev node to
|
||||
be selected when you scroll past the bottom
|
||||
or top of a node. "Continous" moves
|
||||
linearly through the files hierchichal
|
||||
structure.
|
||||
|
||||
`scroll-step' 0 Controls how scrolling is done for you when
|
||||
the cursor moves out of the current window.
|
||||
Non-zero means it is the number of lines
|
||||
you would like the screen to shift. A
|
||||
value of 0 means to center the line
|
||||
containing the cursor in the window.
|
||||
|
||||
`gc-compressed-files' Off If non-zero means it is okay to reclaim the
|
||||
file buffer space allocated to a file which
|
||||
was compressed, if, and only if, that
|
||||
file's contents do not appear in the node
|
||||
list of any window.
|
||||
|
||||
`ISO-Latin' Off Non-zero means that you are using an ISO
|
||||
Latin character set. By default, standard
|
||||
ASCII characters are assumed.
|
||||
________________________________________
|
||||
This release of Info is version 2.5 beta.
|
||||
|
||||
Changes since 2.4 beta:
|
||||
|
||||
* Index (i) and (,) commands fully implemented.
|
||||
* "configure" script now shipped with Info.
|
||||
* New function "set-variable" allows users to set various variables.
|
||||
* User-settable behaviour on end or beginning of node scrolling. This
|
||||
supercedes the SPC and DEL changes in 2.3 beta.
|
||||
|
||||
________________________________________
|
||||
This release of Info is version 2.4 beta.
|
||||
|
||||
Changes since 2.3 beta:
|
||||
|
||||
* info-last-node now means move to the last node of this info file.
|
||||
* info-history-node means move backwards through this window's node history.
|
||||
* info-first-node moves to the first node in the Info file. This node is
|
||||
not necessarily "Top"!
|
||||
* SPC and DEL can select the Next or Prev node after printing an informative
|
||||
message when pressed at the end/beg of a node.
|
||||
|
||||
----------------------------------------
|
||||
This release of Info is version 2.3 beta.
|
||||
|
||||
Changes since 2.2 beta:
|
||||
|
||||
* M-x command lines if NAMED_COMMANDS is #defined. Variable in Makefile.
|
||||
* Screen height changes made quite robust.
|
||||
* Interactive function "set-screen-height" implements user height changes.
|
||||
* Scrolling on some terminals is faster now.
|
||||
* C-l with numeric arguement is fixed.
|
||||
|
||||
----------------------------------------
|
||||
This release of Info is version 2.2 beta.
|
||||
|
||||
Changes since 2.0:
|
||||
|
||||
* C-g can now interrupt multi-file searches.
|
||||
* Incremental search is fully implemented.
|
||||
* Loading large tag tables is much faster now.
|
||||
* makedoc.c replaces shell script, speeding incremental builds.
|
||||
* Scrolling in redisplay is implemented.
|
||||
* Recursive uses of the echo area made more robust.
|
||||
* Garbage collection of unreferenced nodes.
|
||||
|
127
texinfo/README
127
texinfo/README
|
@ -1,127 +0,0 @@
|
|||
This is the README file for the GNU Texinfo distribution.
|
||||
The primary distribution point is ftp://ftp.gnu.org/pub/gnu.
|
||||
|
||||
Please email bugs or suggestions to bug-texinfo@gnu.org. (If you wish,
|
||||
you can join this list by sending a subscribe message to
|
||||
bug-texinfo-request@gnu.org.) Patches are welcome; if possible, please
|
||||
make them with diff -c and include ChangeLog entries.
|
||||
|
||||
Programs within this distribution have their own version numbers. When
|
||||
you refer to a file, please mention its own version, as well as the
|
||||
version number of the Texinfo distribution.
|
||||
|
||||
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 for informative purposes.
|
||||
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, it might contain the
|
||||
command @afourpaper. See the `Preparing for TeX' node in
|
||||
texinfo.texi for more details.
|
||||
|
||||
* If your info files are not in $prefix/info, you may wish to add a line
|
||||
#define DEFAULT_INFOPATH "/mydir1:/mydir2:/etc"
|
||||
to config.h after running configure.
|
||||
|
||||
|
||||
This distribution includes (but is not limited to) the following files:
|
||||
|
||||
README This file.
|
||||
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.texi This manual 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. Must be used if the
|
||||
source document uses Texinfo @macros.
|
||||
|
||||
|
||||
Source files for standalone C programs (./lib, ./makeinfo, ./info):
|
||||
|
||||
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.c This file contains the source for
|
||||
the `info' program that you can use to
|
||||
view Info files on an ASCII terminal.
|
||||
|
||||
getopt.c Various support files
|
||||
getopt1.c
|
||||
getopt.h
|
||||
|
||||
|
||||
Installation files:
|
||||
|
||||
configure This file 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 (util):
|
||||
|
||||
NEWS This contains a summary of new
|
||||
features since the first edition
|
||||
of Texinfo.
|
||||
|
||||
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.
|
|
@ -1,11 +0,0 @@
|
|||
Please report bugs in this alpha distribution to
|
||||
texinfo-pretest@cs.umb.edu
|
||||
rather than bug-texinfo@prep. Thanks.
|
||||
|
||||
You can get on texinfo-pretest, if you're not already,
|
||||
by sending a message whose body is
|
||||
subscribe you@your.preferred.email.address
|
||||
|
||||
to texinfo-pretest-request@cs.umb.edu.
|
||||
And you can get off the list by sending an unsubscribe message.
|
||||
(I use majordomo to maintain the list.)
|
|
@ -1,9 +0,0 @@
|
|||
Thanks to these contributors and many more ...
|
||||
|
||||
Dave Love
|
||||
Donald Knuth
|
||||
Erick Branderhorst
|
||||
Karl Eichwalder
|
||||
Laurent Bourbeau
|
||||
Stephen Gildea
|
||||
William Bader
|
79
texinfo/TODO
79
texinfo/TODO
|
@ -1,79 +0,0 @@
|
|||
If you are interested in working on any of these, email bug-texinfo@gnu.org.
|
||||
|
||||
* Makeinfo:
|
||||
- HTML output is being actively worked on, and with luck will be in
|
||||
the next release.
|
||||
- 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.
|
||||
|
||||
* 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.
|
||||
|
||||
* General:
|
||||
- Better i18n support, including support for 8-bit input characters,
|
||||
and 8-bit output in info. Perhaps have to use the ec fonts.
|
||||
- Support compressed image files, automatic generation of .txt
|
||||
or .jpg from .eps by Ghostscript.
|
||||
- Repeat TeX run until cross-references stabilize, not just twice.
|
||||
(Document this in manual and fix texi2dvi.)
|
||||
- Handle reference card creation, perhaps by only paying attention to
|
||||
sectioning and @def... commands.
|
||||
- Allow : in node names for info files, for names like `class::method'.
|
||||
- Get Info declared as a MIME Content-Type.
|
||||
|
||||
* Language:
|
||||
- @figure:
|
||||
@figure [xref-label]
|
||||
@figureinclude <filename>, [<height>], [<width>]
|
||||
@figurehsize <dimen>
|
||||
@figurevsize <dimen>
|
||||
@caption ... @end caption
|
||||
<arbitrary Texinfo commands>
|
||||
@end figure
|
||||
- @flushboth to combine @flushleft and @flushright, for RFC's.
|
||||
- @part sectioning command.
|
||||
- Anchors a la HTML?
|
||||
- Allow subitems and `see' and `see also' in indices.
|
||||
- @exercise/@answer command for, e.g., gawk.
|
||||
- Allow @hsep/@vsep at @item, instead of just in template.
|
||||
- The dark corner symbol for the gawk manual.
|
||||
- Change bars. This is difficult or impossible in TeX,
|
||||
unfortunately. To do it right requires device driver support.
|
||||
|
||||
* Doc:
|
||||
- Include a complete functional summary, as in a reference card, in
|
||||
the manual.
|
||||
- Improve the manuals for makeinfo, standalone info, etc.
|
||||
- Page 39, need a new section on doing dedication pages. See gawk.texi
|
||||
for an example of doing it in both the tex and info versions.
|
||||
|
||||
* Info:
|
||||
- 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, etc.
|
||||
- q within help should quit help like C-x 0.
|
||||
- Full-text search on all available info files.
|
||||
- Incorporate an X-based viewer, perhaps tkinfo:
|
||||
http://www.math.ucsb.edu/~boldt/tkinfo/.
|
||||
- Perhaps process Texinfo files directly instead of converting to Info:
|
||||
ftp://ftp.cs.berkeley.edu/ucb/people/phelps/tcltk/tkman.tar.Z
|
||||
+ ftp://ftp.cs.berkeley.edu/ucb/people/phelps/tcltk/rman.tar.Z
|
||||
+ Tcl/Tk 8.0 from ftp.smli.com in the /pub/tcl directory.
|
||||
From: phelps@ecstasy.CS.Berkeley.EDU (Tom Phelps)
|
||||
|
||||
* Install-info:
|
||||
- be able to copy the info file to compile-time $(infodir), to
|
||||
simplify by-hand installation.
|
|
@ -1,50 +0,0 @@
|
|||
/* acconfig.h
|
||||
This file is in the public domain.
|
||||
|
||||
Descriptive text for the C preprocessor macros that
|
||||
the distributed Autoconf macros can define.
|
||||
No software package will use all of them; autoheader copies the ones
|
||||
your configure.in uses into your configuration header file templates.
|
||||
|
||||
The entries are in sort -df order: alphabetical, case insensitive,
|
||||
ignoring punctuation (such as underscores). Although this order
|
||||
can split up related entries, it makes it easier to check whether
|
||||
a given entry is in the file.
|
||||
|
||||
Leave the following blank line there!! Autoheader needs it. */
|
||||
|
||||
|
||||
@TOP@
|
||||
|
||||
/* 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
|
||||
|
||||
@BOTTOM@
|
||||
|
||||
/* For gettext (NLS) */
|
||||
#define _(String) gettext (String)
|
||||
#define N_(String) (String)
|
||||
|
||||
|
||||
/* Leave that blank line there!! Autoheader needs it.
|
||||
If you're adding to this file, keep in mind:
|
||||
The entries are in sort -df order: alphabetical, case insensitive,
|
||||
ignoring punctuation (such as underscores). */
|
|
@ -1,377 +0,0 @@
|
|||
# Macro to add for using GNU gettext.
|
||||
# Ulrich Drepper <drepper@cygnus.com>, 1995.
|
||||
#
|
||||
# This file can be copied and used freely without restrictions. It can
|
||||
# be used in projects which are not available under the GNU Public License
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
|
||||
# serial 3
|
||||
|
||||
AC_DEFUN(AM_WITH_NLS,
|
||||
[AC_MSG_CHECKING([whether NLS is requested])
|
||||
dnl Default is enabled NLS
|
||||
AC_ARG_ENABLE(nls,
|
||||
[ --disable-nls do not use Native Language Support],
|
||||
USE_NLS=$enableval, USE_NLS=yes)
|
||||
AC_MSG_RESULT($USE_NLS)
|
||||
AC_SUBST(USE_NLS)
|
||||
|
||||
USE_INCLUDED_LIBINTL=no
|
||||
|
||||
dnl If we use NLS figure out what method
|
||||
if test "$USE_NLS" = "yes"; then
|
||||
AC_DEFINE(ENABLE_NLS)
|
||||
AC_MSG_CHECKING([whether included gettext is requested])
|
||||
AC_ARG_WITH(included-gettext,
|
||||
[ --with-included-gettext use the GNU gettext library included here],
|
||||
nls_cv_force_use_gnu_gettext=$withval,
|
||||
nls_cv_force_use_gnu_gettext=no)
|
||||
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
|
||||
|
||||
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
|
||||
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
|
||||
dnl User does not insist on using GNU NLS library. Figure out what
|
||||
dnl to use. If gettext or catgets are available (in this order) we
|
||||
dnl use this. Else we have to fall back to GNU NLS library.
|
||||
dnl catgets is only used if permitted by option --with-catgets.
|
||||
nls_cv_header_intl=
|
||||
nls_cv_header_libgt=
|
||||
CATOBJEXT=NONE
|
||||
|
||||
AC_CHECK_HEADER(libintl.h,
|
||||
[AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
|
||||
[AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
|
||||
gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
|
||||
|
||||
if test "$gt_cv_func_gettext_libc" != "yes"; then
|
||||
AC_CHECK_LIB(intl, bindtextdomain,
|
||||
[AC_CACHE_CHECK([for gettext in libintl],
|
||||
gt_cv_func_gettext_libintl,
|
||||
[AC_TRY_LINK([], [return (int) gettext ("")],
|
||||
gt_cv_func_gettext_libintl=yes,
|
||||
gt_cv_func_gettext_libintl=no)])])
|
||||
fi
|
||||
|
||||
if test "$gt_cv_func_gettext_libc" = "yes" \
|
||||
|| test "$gt_cv_func_gettext_libintl" = "yes"; then
|
||||
AC_DEFINE(HAVE_GETTEXT)
|
||||
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
|
||||
if test "$MSGFMT" != "no"; then
|
||||
AC_CHECK_FUNCS(dcgettext)
|
||||
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
|
||||
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
|
||||
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
|
||||
return _nl_msg_cat_cntr],
|
||||
[CATOBJEXT=.gmo
|
||||
DATADIRNAME=share],
|
||||
[CATOBJEXT=.mo
|
||||
DATADIRNAME=lib])
|
||||
INSTOBJEXT=.mo
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
if test "$CATOBJEXT" = "NONE"; then
|
||||
AC_MSG_CHECKING([whether catgets can be used])
|
||||
AC_ARG_WITH(catgets,
|
||||
[ --with-catgets use catgets functions if available],
|
||||
nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
|
||||
AC_MSG_RESULT($nls_cv_use_catgets)
|
||||
|
||||
if test "$nls_cv_use_catgets" = "yes"; then
|
||||
dnl No gettext in C library. Try catgets next.
|
||||
AC_CHECK_LIB(i, main)
|
||||
AC_CHECK_FUNC(catgets,
|
||||
[AC_DEFINE(HAVE_CATGETS)
|
||||
INTLOBJS="\$(CATOBJS)"
|
||||
AC_PATH_PROG(GENCAT, gencat, no)dnl
|
||||
if test "$GENCAT" != "no"; then
|
||||
AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
|
||||
if test "$GMSGFMT" = "no"; then
|
||||
AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
|
||||
fi
|
||||
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
|
||||
USE_INCLUDED_LIBINTL=yes
|
||||
CATOBJEXT=.cat
|
||||
INSTOBJEXT=.cat
|
||||
DATADIRNAME=lib
|
||||
INTLDEPS='$(top_builddir)/intl/libintl.a'
|
||||
INTLLIBS=$INTLDEPS
|
||||
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
|
||||
nls_cv_header_intl=intl/libintl.h
|
||||
nls_cv_header_libgt=intl/libgettext.h
|
||||
fi])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$CATOBJEXT" = "NONE"; then
|
||||
dnl Neither gettext nor catgets in included in the C library.
|
||||
dnl Fall back on GNU gettext library.
|
||||
nls_cv_use_gnu_gettext=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$nls_cv_use_gnu_gettext" = "yes"; then
|
||||
dnl Mark actions used to generate GNU NLS library.
|
||||
INTLOBJS="\$(GETTOBJS)"
|
||||
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
|
||||
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
|
||||
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
|
||||
AC_SUBST(MSGFMT)
|
||||
USE_INCLUDED_LIBINTL=yes
|
||||
CATOBJEXT=.gmo
|
||||
INSTOBJEXT=.mo
|
||||
DATADIRNAME=share
|
||||
INTLDEPS='$(top_builddir)/intl/libintl.a'
|
||||
INTLLIBS=$INTLDEPS
|
||||
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
|
||||
nls_cv_header_intl=intl/libintl.h
|
||||
nls_cv_header_libgt=intl/libgettext.h
|
||||
fi
|
||||
|
||||
dnl Test whether we really found GNU xgettext.
|
||||
if test "$XGETTEXT" != ":"; then
|
||||
dnl If it is no GNU xgettext we define it as : so that the
|
||||
dnl Makefiles still can work.
|
||||
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
|
||||
: ;
|
||||
else
|
||||
AC_MSG_RESULT(
|
||||
[found xgettext programs is not GNU xgettext; ignore it])
|
||||
XGETTEXT=":"
|
||||
fi
|
||||
fi
|
||||
|
||||
# We need to process the po/ directory.
|
||||
POSUB=po
|
||||
else
|
||||
DATADIRNAME=share
|
||||
nls_cv_header_intl=intl/libintl.h
|
||||
nls_cv_header_libgt=intl/libgettext.h
|
||||
fi
|
||||
|
||||
# If this is used in GNU gettext we have to set USE_NLS to `yes'
|
||||
# because some of the sources are only built for this goal.
|
||||
if test "$PACKAGE" = gettext; then
|
||||
USE_NLS=yes
|
||||
USE_INCLUDED_LIBINTL=yes
|
||||
fi
|
||||
|
||||
dnl These rules are solely for the distribution goal. While doing this
|
||||
dnl we only have to keep exactly one list of the available catalogs
|
||||
dnl in configure.in.
|
||||
for lang in $ALL_LINGUAS; do
|
||||
GMOFILES="$GMOFILES $lang.gmo"
|
||||
POFILES="$POFILES $lang.po"
|
||||
done
|
||||
|
||||
dnl Make all variables we use known to autoconf.
|
||||
AC_SUBST(USE_INCLUDED_LIBINTL)
|
||||
AC_SUBST(CATALOGS)
|
||||
AC_SUBST(CATOBJEXT)
|
||||
AC_SUBST(DATADIRNAME)
|
||||
AC_SUBST(GMOFILES)
|
||||
AC_SUBST(INSTOBJEXT)
|
||||
AC_SUBST(INTLDEPS)
|
||||
AC_SUBST(INTLLIBS)
|
||||
AC_SUBST(INTLOBJS)
|
||||
AC_SUBST(POFILES)
|
||||
AC_SUBST(POSUB)
|
||||
])
|
||||
|
||||
AC_DEFUN(AM_GNU_GETTEXT,
|
||||
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_PROG_RANLIB])dnl
|
||||
AC_REQUIRE([AC_ISC_POSIX])dnl
|
||||
AC_REQUIRE([AC_HEADER_STDC])dnl
|
||||
AC_REQUIRE([AC_C_CONST])dnl
|
||||
AC_REQUIRE([AC_C_INLINE])dnl
|
||||
AC_REQUIRE([AC_TYPE_OFF_T])dnl
|
||||
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
|
||||
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
|
||||
AC_REQUIRE([AC_FUNC_MMAP])dnl
|
||||
|
||||
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
|
||||
unistd.h values.h sys/param.h])
|
||||
AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
|
||||
__argz_count __argz_stringify __argz_next])
|
||||
|
||||
if test "${ac_cv_func_stpcpy+set}" != "set"; then
|
||||
AC_CHECK_FUNCS(stpcpy)
|
||||
fi
|
||||
if test "${ac_cv_func_stpcpy}" = "yes"; then
|
||||
AC_DEFINE(HAVE_STPCPY)
|
||||
fi
|
||||
|
||||
AM_LC_MESSAGES
|
||||
AM_WITH_NLS
|
||||
|
||||
if test "x$CATOBJEXT" != "x"; then
|
||||
if test "x$ALL_LINGUAS" = "x"; then
|
||||
LINGUAS=
|
||||
else
|
||||
AC_MSG_CHECKING(for catalogs to be installed)
|
||||
NEW_LINGUAS=
|
||||
for lang in ${LINGUAS=$ALL_LINGUAS}; do
|
||||
case "$ALL_LINGUAS" in
|
||||
*$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
|
||||
esac
|
||||
done
|
||||
LINGUAS=$NEW_LINGUAS
|
||||
AC_MSG_RESULT($LINGUAS)
|
||||
fi
|
||||
|
||||
dnl Construct list of names of catalog files to be constructed.
|
||||
if test -n "$LINGUAS"; then
|
||||
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl The reference to <locale.h> in the installed <libintl.h> file
|
||||
dnl must be resolved because we cannot expect the users of this
|
||||
dnl to define HAVE_LOCALE_H.
|
||||
if test $ac_cv_header_locale_h = yes; then
|
||||
INCLUDE_LOCALE_H="#include <locale.h>"
|
||||
else
|
||||
INCLUDE_LOCALE_H="\
|
||||
/* The system does not provide the header <locale.h>. Take care yourself. */"
|
||||
fi
|
||||
AC_SUBST(INCLUDE_LOCALE_H)
|
||||
|
||||
dnl Determine which catalog format we have (if any is needed)
|
||||
dnl For now we know about two different formats:
|
||||
dnl Linux libc-5 and the normal X/Open format
|
||||
test -d intl || mkdir intl
|
||||
if test "$CATOBJEXT" = ".cat"; then
|
||||
AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
|
||||
|
||||
dnl Transform the SED scripts while copying because some dumb SEDs
|
||||
dnl cannot handle comments.
|
||||
sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
|
||||
fi
|
||||
dnl po2tbl.sed is always needed.
|
||||
sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
|
||||
$srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
|
||||
|
||||
dnl In the intl/Makefile.in we have a special dependency which makes
|
||||
dnl only sense for gettext. We comment this out for non-gettext
|
||||
dnl packages.
|
||||
if test "$PACKAGE" = "gettext"; then
|
||||
GT_NO="#NO#"
|
||||
GT_YES=
|
||||
else
|
||||
GT_NO=
|
||||
GT_YES="#YES#"
|
||||
fi
|
||||
AC_SUBST(GT_NO)
|
||||
AC_SUBST(GT_YES)
|
||||
|
||||
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
|
||||
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
|
||||
dnl Try to locate is.
|
||||
MKINSTALLDIRS=
|
||||
if test -n "$ac_aux_dir"; then
|
||||
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
|
||||
fi
|
||||
if test -z "$MKINSTALLDIRS"; then
|
||||
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
|
||||
fi
|
||||
AC_SUBST(MKINSTALLDIRS)
|
||||
|
||||
dnl *** For now the libtool support in intl/Makefile is not for real.
|
||||
l=
|
||||
AC_SUBST(l)
|
||||
|
||||
dnl Generate list of files to be processed by xgettext which will
|
||||
dnl be included in po/Makefile.
|
||||
test -d po || mkdir po
|
||||
if test "x$srcdir" != "x."; then
|
||||
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
|
||||
posrcprefix="$srcdir/"
|
||||
else
|
||||
posrcprefix="../$srcdir/"
|
||||
fi
|
||||
else
|
||||
posrcprefix="../"
|
||||
fi
|
||||
rm -f po/POTFILES
|
||||
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
|
||||
< $srcdir/po/POTFILES.in > po/POTFILES
|
||||
])
|
||||
|
||||
# Search path for a program which passes the given test.
|
||||
# Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||
#
|
||||
# This file can be copied and used freely without restrictions. It can
|
||||
# be used in projects which are not available under the GNU Public License
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
|
||||
# serial 1
|
||||
|
||||
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
|
||||
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
|
||||
AC_DEFUN(AM_PATH_PROG_WITH_TEST,
|
||||
[# Extract the first word of "$2", so it can be a program name with args.
|
||||
set dummy $2; ac_word=[$]2
|
||||
AC_MSG_CHECKING([for $ac_word])
|
||||
AC_CACHE_VAL(ac_cv_path_$1,
|
||||
[case "[$]$1" in
|
||||
/*)
|
||||
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in ifelse([$5], , $PATH, [$5]); do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/$ac_word; then
|
||||
if [$3]; then
|
||||
ac_cv_path_$1="$ac_dir/$ac_word"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
dnl If no 4th arg is given, leave the cache variable unset,
|
||||
dnl so AC_PATH_PROGS will keep looking.
|
||||
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
|
||||
])dnl
|
||||
;;
|
||||
esac])dnl
|
||||
$1="$ac_cv_path_$1"
|
||||
if test -n "[$]$1"; then
|
||||
AC_MSG_RESULT([$]$1)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AC_SUBST($1)dnl
|
||||
])
|
||||
|
||||
# Check whether LC_MESSAGES is available in <locale.h>.
|
||||
# Ulrich Drepper <drepper@cygnus.com>, 1995.
|
||||
#
|
||||
# This file can be copied and used freely without restrictions. It can
|
||||
# be used in projects which are not available under the GNU Public License
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
|
||||
# serial 1
|
||||
|
||||
AC_DEFUN(AM_LC_MESSAGES,
|
||||
[if test $ac_cv_header_locale_h = yes; then
|
||||
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
|
||||
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
|
||||
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
|
||||
if test $am_cv_val_LC_MESSAGES = yes; then
|
||||
AC_DEFINE(HAVE_LC_MESSAGES)
|
||||
fi
|
||||
fi])
|
||||
|
657
texinfo/aclocal.m4
vendored
657
texinfo/aclocal.m4
vendored
|
@ -1,657 +0,0 @@
|
|||
dnl aclocal.m4 generated automatically by aclocal 1.2e
|
||||
|
||||
dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
dnl This Makefile.in is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
dnl PARTICULAR PURPOSE.
|
||||
|
||||
# Macro to add for using GNU gettext.
|
||||
# Ulrich Drepper <drepper@cygnus.com>, 1995.
|
||||
#
|
||||
# This file can be copied and used freely without restrictions. It can
|
||||
# be used in projects which are not available under the GNU Public License
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
|
||||
# serial 3
|
||||
|
||||
AC_DEFUN(AM_WITH_NLS,
|
||||
[AC_MSG_CHECKING([whether NLS is requested])
|
||||
dnl Default is enabled NLS
|
||||
AC_ARG_ENABLE(nls,
|
||||
[ --disable-nls do not use Native Language Support],
|
||||
USE_NLS=$enableval, USE_NLS=yes)
|
||||
AC_MSG_RESULT($USE_NLS)
|
||||
AC_SUBST(USE_NLS)
|
||||
|
||||
USE_INCLUDED_LIBINTL=no
|
||||
|
||||
dnl If we use NLS figure out what method
|
||||
if test "$USE_NLS" = "yes"; then
|
||||
AC_DEFINE(ENABLE_NLS)
|
||||
AC_MSG_CHECKING([whether included gettext is requested])
|
||||
AC_ARG_WITH(included-gettext,
|
||||
[ --with-included-gettext use the GNU gettext library included here],
|
||||
nls_cv_force_use_gnu_gettext=$withval,
|
||||
nls_cv_force_use_gnu_gettext=no)
|
||||
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
|
||||
|
||||
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
|
||||
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
|
||||
dnl User does not insist on using GNU NLS library. Figure out what
|
||||
dnl to use. If gettext or catgets are available (in this order) we
|
||||
dnl use this. Else we have to fall back to GNU NLS library.
|
||||
dnl catgets is only used if permitted by option --with-catgets.
|
||||
nls_cv_header_intl=
|
||||
nls_cv_header_libgt=
|
||||
CATOBJEXT=NONE
|
||||
|
||||
AC_CHECK_HEADER(libintl.h,
|
||||
[AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
|
||||
[AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
|
||||
gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
|
||||
|
||||
if test "$gt_cv_func_gettext_libc" != "yes"; then
|
||||
AC_CHECK_LIB(intl, bindtextdomain,
|
||||
[AC_CACHE_CHECK([for gettext in libintl],
|
||||
gt_cv_func_gettext_libintl,
|
||||
[AC_TRY_LINK([], [return (int) gettext ("")],
|
||||
gt_cv_func_gettext_libintl=yes,
|
||||
gt_cv_func_gettext_libintl=no)])])
|
||||
fi
|
||||
|
||||
if test "$gt_cv_func_gettext_libc" = "yes" \
|
||||
|| test "$gt_cv_func_gettext_libintl" = "yes"; then
|
||||
AC_DEFINE(HAVE_GETTEXT)
|
||||
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
|
||||
if test "$MSGFMT" != "no"; then
|
||||
AC_CHECK_FUNCS(dcgettext)
|
||||
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
|
||||
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
|
||||
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
|
||||
return _nl_msg_cat_cntr],
|
||||
[CATOBJEXT=.gmo
|
||||
DATADIRNAME=share],
|
||||
[CATOBJEXT=.mo
|
||||
DATADIRNAME=lib])
|
||||
INSTOBJEXT=.mo
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
if test "$CATOBJEXT" = "NONE"; then
|
||||
AC_MSG_CHECKING([whether catgets can be used])
|
||||
AC_ARG_WITH(catgets,
|
||||
[ --with-catgets use catgets functions if available],
|
||||
nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
|
||||
AC_MSG_RESULT($nls_cv_use_catgets)
|
||||
|
||||
if test "$nls_cv_use_catgets" = "yes"; then
|
||||
dnl No gettext in C library. Try catgets next.
|
||||
AC_CHECK_LIB(i, main)
|
||||
AC_CHECK_FUNC(catgets,
|
||||
[AC_DEFINE(HAVE_CATGETS)
|
||||
INTLOBJS="\$(CATOBJS)"
|
||||
AC_PATH_PROG(GENCAT, gencat, no)dnl
|
||||
if test "$GENCAT" != "no"; then
|
||||
AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
|
||||
if test "$GMSGFMT" = "no"; then
|
||||
AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
|
||||
fi
|
||||
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
|
||||
USE_INCLUDED_LIBINTL=yes
|
||||
CATOBJEXT=.cat
|
||||
INSTOBJEXT=.cat
|
||||
DATADIRNAME=lib
|
||||
INTLDEPS='$(top_builddir)/intl/libintl.a'
|
||||
INTLLIBS=$INTLDEPS
|
||||
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
|
||||
nls_cv_header_intl=intl/libintl.h
|
||||
nls_cv_header_libgt=intl/libgettext.h
|
||||
fi])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$CATOBJEXT" = "NONE"; then
|
||||
dnl Neither gettext nor catgets in included in the C library.
|
||||
dnl Fall back on GNU gettext library.
|
||||
nls_cv_use_gnu_gettext=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$nls_cv_use_gnu_gettext" = "yes"; then
|
||||
dnl Mark actions used to generate GNU NLS library.
|
||||
INTLOBJS="\$(GETTOBJS)"
|
||||
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
|
||||
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
|
||||
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
|
||||
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
|
||||
AC_SUBST(MSGFMT)
|
||||
USE_INCLUDED_LIBINTL=yes
|
||||
CATOBJEXT=.gmo
|
||||
INSTOBJEXT=.mo
|
||||
DATADIRNAME=share
|
||||
INTLDEPS='$(top_builddir)/intl/libintl.a'
|
||||
INTLLIBS=$INTLDEPS
|
||||
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
|
||||
nls_cv_header_intl=intl/libintl.h
|
||||
nls_cv_header_libgt=intl/libgettext.h
|
||||
fi
|
||||
|
||||
dnl Test whether we really found GNU xgettext.
|
||||
if test "$XGETTEXT" != ":"; then
|
||||
dnl If it is no GNU xgettext we define it as : so that the
|
||||
dnl Makefiles still can work.
|
||||
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
|
||||
: ;
|
||||
else
|
||||
AC_MSG_RESULT(
|
||||
[found xgettext programs is not GNU xgettext; ignore it])
|
||||
XGETTEXT=":"
|
||||
fi
|
||||
fi
|
||||
|
||||
# We need to process the po/ directory.
|
||||
POSUB=po
|
||||
else
|
||||
DATADIRNAME=share
|
||||
nls_cv_header_intl=intl/libintl.h
|
||||
nls_cv_header_libgt=intl/libgettext.h
|
||||
fi
|
||||
|
||||
# If this is used in GNU gettext we have to set USE_NLS to `yes'
|
||||
# because some of the sources are only built for this goal.
|
||||
if test "$PACKAGE" = gettext; then
|
||||
USE_NLS=yes
|
||||
USE_INCLUDED_LIBINTL=yes
|
||||
fi
|
||||
|
||||
dnl These rules are solely for the distribution goal. While doing this
|
||||
dnl we only have to keep exactly one list of the available catalogs
|
||||
dnl in configure.in.
|
||||
for lang in $ALL_LINGUAS; do
|
||||
GMOFILES="$GMOFILES $lang.gmo"
|
||||
POFILES="$POFILES $lang.po"
|
||||
done
|
||||
|
||||
dnl Make all variables we use known to autoconf.
|
||||
AC_SUBST(USE_INCLUDED_LIBINTL)
|
||||
AC_SUBST(CATALOGS)
|
||||
AC_SUBST(CATOBJEXT)
|
||||
AC_SUBST(DATADIRNAME)
|
||||
AC_SUBST(GMOFILES)
|
||||
AC_SUBST(INSTOBJEXT)
|
||||
AC_SUBST(INTLDEPS)
|
||||
AC_SUBST(INTLLIBS)
|
||||
AC_SUBST(INTLOBJS)
|
||||
AC_SUBST(POFILES)
|
||||
AC_SUBST(POSUB)
|
||||
])
|
||||
|
||||
AC_DEFUN(AM_GNU_GETTEXT,
|
||||
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_PROG_RANLIB])dnl
|
||||
AC_REQUIRE([AC_ISC_POSIX])dnl
|
||||
AC_REQUIRE([AC_HEADER_STDC])dnl
|
||||
AC_REQUIRE([AC_C_CONST])dnl
|
||||
AC_REQUIRE([AC_C_INLINE])dnl
|
||||
AC_REQUIRE([AC_TYPE_OFF_T])dnl
|
||||
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
|
||||
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
|
||||
AC_REQUIRE([AC_FUNC_MMAP])dnl
|
||||
|
||||
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
|
||||
unistd.h values.h sys/param.h])
|
||||
AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
|
||||
__argz_count __argz_stringify __argz_next])
|
||||
|
||||
if test "${ac_cv_func_stpcpy+set}" != "set"; then
|
||||
AC_CHECK_FUNCS(stpcpy)
|
||||
fi
|
||||
if test "${ac_cv_func_stpcpy}" = "yes"; then
|
||||
AC_DEFINE(HAVE_STPCPY)
|
||||
fi
|
||||
|
||||
AM_LC_MESSAGES
|
||||
AM_WITH_NLS
|
||||
|
||||
if test "x$CATOBJEXT" != "x"; then
|
||||
if test "x$ALL_LINGUAS" = "x"; then
|
||||
LINGUAS=
|
||||
else
|
||||
AC_MSG_CHECKING(for catalogs to be installed)
|
||||
NEW_LINGUAS=
|
||||
for lang in ${LINGUAS=$ALL_LINGUAS}; do
|
||||
case "$ALL_LINGUAS" in
|
||||
*$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
|
||||
esac
|
||||
done
|
||||
LINGUAS=$NEW_LINGUAS
|
||||
AC_MSG_RESULT($LINGUAS)
|
||||
fi
|
||||
|
||||
dnl Construct list of names of catalog files to be constructed.
|
||||
if test -n "$LINGUAS"; then
|
||||
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl The reference to <locale.h> in the installed <libintl.h> file
|
||||
dnl must be resolved because we cannot expect the users of this
|
||||
dnl to define HAVE_LOCALE_H.
|
||||
if test $ac_cv_header_locale_h = yes; then
|
||||
INCLUDE_LOCALE_H="#include <locale.h>"
|
||||
else
|
||||
INCLUDE_LOCALE_H="\
|
||||
/* The system does not provide the header <locale.h>. Take care yourself. */"
|
||||
fi
|
||||
AC_SUBST(INCLUDE_LOCALE_H)
|
||||
|
||||
dnl Determine which catalog format we have (if any is needed)
|
||||
dnl For now we know about two different formats:
|
||||
dnl Linux libc-5 and the normal X/Open format
|
||||
test -d intl || mkdir intl
|
||||
if test "$CATOBJEXT" = ".cat"; then
|
||||
AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
|
||||
|
||||
dnl Transform the SED scripts while copying because some dumb SEDs
|
||||
dnl cannot handle comments.
|
||||
sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
|
||||
fi
|
||||
dnl po2tbl.sed is always needed.
|
||||
sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
|
||||
$srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
|
||||
|
||||
dnl In the intl/Makefile.in we have a special dependency which makes
|
||||
dnl only sense for gettext. We comment this out for non-gettext
|
||||
dnl packages.
|
||||
if test "$PACKAGE" = "gettext"; then
|
||||
GT_NO="#NO#"
|
||||
GT_YES=
|
||||
else
|
||||
GT_NO=
|
||||
GT_YES="#YES#"
|
||||
fi
|
||||
AC_SUBST(GT_NO)
|
||||
AC_SUBST(GT_YES)
|
||||
|
||||
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
|
||||
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
|
||||
dnl Try to locate is.
|
||||
MKINSTALLDIRS=
|
||||
if test -n "$ac_aux_dir"; then
|
||||
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
|
||||
fi
|
||||
if test -z "$MKINSTALLDIRS"; then
|
||||
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
|
||||
fi
|
||||
AC_SUBST(MKINSTALLDIRS)
|
||||
|
||||
dnl *** For now the libtool support in intl/Makefile is not for real.
|
||||
l=
|
||||
AC_SUBST(l)
|
||||
|
||||
dnl Generate list of files to be processed by xgettext which will
|
||||
dnl be included in po/Makefile.
|
||||
test -d po || mkdir po
|
||||
if test "x$srcdir" != "x."; then
|
||||
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
|
||||
posrcprefix="$srcdir/"
|
||||
else
|
||||
posrcprefix="../$srcdir/"
|
||||
fi
|
||||
else
|
||||
posrcprefix="../"
|
||||
fi
|
||||
rm -f po/POTFILES
|
||||
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
|
||||
< $srcdir/po/POTFILES.in > po/POTFILES
|
||||
])
|
||||
|
||||
# Search path for a program which passes the given test.
|
||||
# Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||
#
|
||||
# This file can be copied and used freely without restrictions. It can
|
||||
# be used in projects which are not available under the GNU Public License
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
|
||||
# serial 1
|
||||
|
||||
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
|
||||
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
|
||||
AC_DEFUN(AM_PATH_PROG_WITH_TEST,
|
||||
[# Extract the first word of "$2", so it can be a program name with args.
|
||||
set dummy $2; ac_word=[$]2
|
||||
AC_MSG_CHECKING([for $ac_word])
|
||||
AC_CACHE_VAL(ac_cv_path_$1,
|
||||
[case "[$]$1" in
|
||||
/*)
|
||||
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in ifelse([$5], , $PATH, [$5]); do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/$ac_word; then
|
||||
if [$3]; then
|
||||
ac_cv_path_$1="$ac_dir/$ac_word"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
dnl If no 4th arg is given, leave the cache variable unset,
|
||||
dnl so AC_PATH_PROGS will keep looking.
|
||||
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
|
||||
])dnl
|
||||
;;
|
||||
esac])dnl
|
||||
$1="$ac_cv_path_$1"
|
||||
if test -n "[$]$1"; then
|
||||
AC_MSG_RESULT([$]$1)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AC_SUBST($1)dnl
|
||||
])
|
||||
|
||||
# Check whether LC_MESSAGES is available in <locale.h>.
|
||||
# Ulrich Drepper <drepper@cygnus.com>, 1995.
|
||||
#
|
||||
# This file can be copied and used freely without restrictions. It can
|
||||
# be used in projects which are not available under the GNU Public License
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
|
||||
# serial 1
|
||||
|
||||
AC_DEFUN(AM_LC_MESSAGES,
|
||||
[if test $ac_cv_header_locale_h = yes; then
|
||||
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
|
||||
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
|
||||
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
|
||||
if test $am_cv_val_LC_MESSAGES = yes; then
|
||||
AC_DEFINE(HAVE_LC_MESSAGES)
|
||||
fi
|
||||
fi])
|
||||
|
||||
|
||||
# Like AC_CONFIG_HEADER, but automatically create stamp file.
|
||||
|
||||
AC_DEFUN(AM_CONFIG_HEADER,
|
||||
[AC_PREREQ([2.12])
|
||||
AC_CONFIG_HEADER([$1])
|
||||
dnl When config.status generates a header, we must update the stamp-h file.
|
||||
dnl This file resides in the same directory as the config header
|
||||
dnl that is generated. We must strip everything past the first ":",
|
||||
dnl and everything past the last "/".
|
||||
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
|
||||
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
|
||||
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
|
||||
<<am_indx=1
|
||||
for am_file in <<$1>>; do
|
||||
case " <<$>>CONFIG_HEADERS " in
|
||||
*" <<$>>am_file "*<<)>>
|
||||
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
|
||||
;;
|
||||
esac
|
||||
am_indx=`expr "<<$>>am_indx" + 1`
|
||||
done<<>>dnl>>)
|
||||
changequote([,]))])
|
||||
|
||||
# Do all the work for Automake. This macro actually does too much --
|
||||
# some checks are only needed if your package does certain things.
|
||||
# But this isn't really a big deal.
|
||||
|
||||
# serial 1
|
||||
|
||||
dnl Usage:
|
||||
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
|
||||
|
||||
AC_DEFUN(AM_INIT_AUTOMAKE,
|
||||
[AC_REQUIRE([AM_PROG_INSTALL])
|
||||
PACKAGE=[$1]
|
||||
AC_SUBST(PACKAGE)
|
||||
VERSION=[$2]
|
||||
AC_SUBST(VERSION)
|
||||
dnl test to see if srcdir already configured
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
|
||||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
||||
fi
|
||||
ifelse([$3],,
|
||||
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
|
||||
AC_REQUIRE([AM_SANITY_CHECK])
|
||||
AC_REQUIRE([AC_ARG_PROGRAM])
|
||||
dnl FIXME This is truly gross.
|
||||
missing_dir=`cd $ac_aux_dir && pwd`
|
||||
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
|
||||
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])])
|
||||
|
||||
|
||||
# serial 1
|
||||
|
||||
AC_DEFUN(AM_PROG_INSTALL,
|
||||
[AC_REQUIRE([AC_PROG_INSTALL])
|
||||
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
|
||||
AC_SUBST(INSTALL_SCRIPT)dnl
|
||||
])
|
||||
|
||||
#
|
||||
# Check to make sure that the build environment is sane.
|
||||
#
|
||||
|
||||
AC_DEFUN(AM_SANITY_CHECK,
|
||||
[AC_MSG_CHECKING([whether build environment is sane])
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftestfile
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
|
||||
if test "[$]*" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t $srcdir/configure conftestfile`
|
||||
fi
|
||||
if test "[$]*" != "X $srcdir/configure conftestfile" \
|
||||
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
|
||||
|
||||
# If neither matched, then we have a broken ls. This can happen
|
||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||
# broken ls alias from the environment. This has actually
|
||||
# happened. Such a system could not be considered "sane".
|
||||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
||||
alias in your environment])
|
||||
fi
|
||||
|
||||
test "[$]2" = conftestfile
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||
Check your system clock])
|
||||
fi
|
||||
rm -f conftest*
|
||||
AC_MSG_RESULT(yes)])
|
||||
|
||||
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
|
||||
dnl The program must properly implement --version.
|
||||
AC_DEFUN(AM_MISSING_PROG,
|
||||
[AC_MSG_CHECKING(for working $2)
|
||||
# Run test in a subshell; some versions of sh will print an error if
|
||||
# an executable is not found, even if stderr is redirected.
|
||||
# Redirect stdin to placate older versions of autoconf. Sigh.
|
||||
if ($2 --version) < /dev/null > /dev/null 2>&1; then
|
||||
$1=$2
|
||||
AC_MSG_RESULT(found)
|
||||
else
|
||||
$1="$3/missing $2"
|
||||
AC_MSG_RESULT(missing)
|
||||
fi
|
||||
AC_SUBST($1)])
|
||||
|
||||
# Add --enable-maintainer-mode option to configure.
|
||||
# From Jim Meyering
|
||||
|
||||
# serial 1
|
||||
|
||||
AC_DEFUN(AM_MAINTAINER_MODE,
|
||||
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
|
||||
dnl maintainer-mode is disabled by default
|
||||
AC_ARG_ENABLE(maintainer-mode,
|
||||
[ --enable-maintainer-mode enable make rules and dependencies not useful
|
||||
(and sometimes confusing) to the casual installer],
|
||||
USE_MAINTAINER_MODE=$enableval,
|
||||
USE_MAINTAINER_MODE=no)
|
||||
AC_MSG_RESULT($USE_MAINTAINER_MODE)
|
||||
if test $USE_MAINTAINER_MODE = yes; then
|
||||
MAINT=
|
||||
else
|
||||
MAINT='#M#'
|
||||
fi
|
||||
AC_SUBST(MAINT)dnl
|
||||
]
|
||||
)
|
||||
|
||||
# Check to see if we're running under Win32, without using
|
||||
# AC_CANONICAL_*. If so, set output variable EXEEXT to ".exe".
|
||||
# Otherwise set it to "".
|
||||
|
||||
dnl AM_EXEEXT()
|
||||
dnl This knows we add .exe if we're building in the Cygwin32
|
||||
dnl environment. But if we're not, then it compiles a test program
|
||||
dnl to see if there is a suffix for executables.
|
||||
AC_DEFUN(AM_EXEEXT,
|
||||
[AC_REQUIRE([AM_CYGWIN32])
|
||||
AC_REQUIRE([AM_MINGW32])
|
||||
AC_MSG_CHECKING([for executable suffix])
|
||||
AC_CACHE_VAL(am_cv_exeext,
|
||||
[if test "$CYGWIN32" = yes || test "$MINGW32" = yes; then
|
||||
am_cv_exeext=.exe
|
||||
else
|
||||
cat > am_c_test.c << 'EOF'
|
||||
int main() {
|
||||
/* Nothing needed here */
|
||||
}
|
||||
EOF
|
||||
${CC-cc} -o am_c_test $CFLAGS $CPPFLAGS $LDFLAGS am_c_test.c $LIBS 1>&5
|
||||
am_cv_exeext=`echo am_c_test.* | grep -v am_c_test.c | sed -e s/am_c_test//`
|
||||
rm -f am_c_test*])
|
||||
test x"${am_cv_exeext}" = x && am_cv_exeext=no
|
||||
fi
|
||||
EXEEXT=""
|
||||
test x"${am_cv_exeext}" != xno && EXEEXT=${am_cv_exeext}
|
||||
AC_MSG_RESULT(${am_cv_exeext})
|
||||
AC_SUBST(EXEEXT)])
|
||||
|
||||
# Check to see if we're running under Cygwin32, without using
|
||||
# AC_CANONICAL_*. If so, set output variable CYGWIN32 to "yes".
|
||||
# Otherwise set it to "no".
|
||||
|
||||
dnl AM_CYGWIN32()
|
||||
AC_DEFUN(AM_CYGWIN32,
|
||||
[AC_CACHE_CHECK(for Cygwin32 environment, am_cv_cygwin32,
|
||||
[AC_TRY_COMPILE(,[return __CYGWIN32__;],
|
||||
am_cv_cygwin32=yes, am_cv_cygwin32=no)
|
||||
rm -f conftest*])
|
||||
CYGWIN32=
|
||||
test "$am_cv_cygwin32" = yes && CYGWIN32=yes])
|
||||
|
||||
# Check to see if we're running under Mingw, without using
|
||||
# AC_CANONICAL_*. If so, set output variable MINGW32 to "yes".
|
||||
# Otherwise set it to "no".
|
||||
|
||||
dnl AM_MINGW32()
|
||||
AC_DEFUN(AM_MINGW32,
|
||||
[AC_CACHE_CHECK(for Mingw32 environment, am_cv_mingw32,
|
||||
[AC_TRY_COMPILE(,[return __MINGW32__;],
|
||||
am_cv_mingw32=yes, am_cv_mingw32=no)
|
||||
rm -f conftest*])
|
||||
MINGW32=
|
||||
test "$am_cv_mingw32" = yes && MINGW32=yes])
|
||||
|
||||
AC_DEFUN(EGCS_PROG_INSTALL,
|
||||
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
|
||||
# Find a good install program. We prefer a C program (faster),
|
||||
# so one script is as good as another. But avoid the broken or
|
||||
# incompatible versions:
|
||||
# SysV /etc/install, /usr/sbin/install
|
||||
# SunOS /usr/etc/install
|
||||
# IRIX /sbin/install
|
||||
# AIX /bin/install
|
||||
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
|
||||
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
|
||||
# ./install, which can be erroneously created by make from ./install.sh.
|
||||
AC_MSG_CHECKING(for a BSD compatible install)
|
||||
if test -z "$INSTALL"; then
|
||||
AC_CACHE_VAL(ac_cv_path_install,
|
||||
[ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in $PATH; do
|
||||
# Account for people who put trailing slashes in PATH elements.
|
||||
case "$ac_dir/" in
|
||||
/|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
|
||||
*)
|
||||
# OSF1 and SCO ODT 3.0 have their own names for install.
|
||||
for ac_prog in ginstall scoinst install; do
|
||||
if test -f $ac_dir/$ac_prog; then
|
||||
if test $ac_prog = install &&
|
||||
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
|
||||
# AIX install. It has an incompatible calling convention.
|
||||
# OSF/1 installbsd also uses dspmsg, but is usable.
|
||||
:
|
||||
else
|
||||
ac_cv_path_install="$ac_dir/$ac_prog -c"
|
||||
break 2
|
||||
fi
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
done
|
||||
IFS="$ac_save_IFS"
|
||||
])dnl
|
||||
if test "${ac_cv_path_install+set}" = set; then
|
||||
INSTALL="$ac_cv_path_install"
|
||||
else
|
||||
# As a last resort, use the slow shell script. We don't cache a
|
||||
# path for INSTALL within a source directory, because that will
|
||||
# break other packages using the cache if that directory is
|
||||
# removed, or if the path is relative.
|
||||
INSTALL="$ac_install_sh"
|
||||
fi
|
||||
fi
|
||||
dnl We do special magic for INSTALL instead of AC_SUBST, to get
|
||||
dnl relative paths right.
|
||||
AC_MSG_RESULT($INSTALL)
|
||||
AC_SUBST(INSTALL)dnl
|
||||
|
||||
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
|
||||
# It thinks the first close brace ends the variable substitution.
|
||||
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
|
||||
AC_SUBST(INSTALL_PROGRAM)dnl
|
||||
|
||||
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
|
||||
AC_SUBST(INSTALL_DATA)dnl
|
||||
])
|
4
texinfo/config.guess
vendored
4
texinfo/config.guess
vendored
|
@ -1,4 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Use the top-level config.guess so that we don't have two of them.
|
||||
guesssys=`echo $0 | sed 's|config.guess|../config.guess|'`
|
||||
exec ${guesssys} "$@"
|
|
@ -1,257 +0,0 @@
|
|||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
/* acconfig.h
|
||||
This file is in the public domain.
|
||||
|
||||
Descriptive text for the C preprocessor macros that
|
||||
the distributed Autoconf macros can define.
|
||||
No software package will use all of them; autoheader copies the ones
|
||||
your configure.in uses into your configuration header file templates.
|
||||
|
||||
The entries are in sort -df order: alphabetical, case insensitive,
|
||||
ignoring punctuation (such as underscores). Although this order
|
||||
can split up related entries, it makes it easier to check whether
|
||||
a given entry is in the file.
|
||||
|
||||
Leave the following blank line there!! Autoheader needs it. */
|
||||
|
||||
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
#undef C_ALLOCA
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||
This function is required for alloca.c support on those systems. */
|
||||
#undef CRAY_STACKSEG_END
|
||||
|
||||
/* Define if you have alloca, as a function or macro. */
|
||||
#undef HAVE_ALLOCA
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
#undef HAVE_MMAP
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#undef HAVE_VPRINTF
|
||||
|
||||
/* Define as __inline if that's what the C compiler calls it. */
|
||||
#undef inline
|
||||
|
||||
/* Define if on MINIX. */
|
||||
#undef _MINIX
|
||||
|
||||
/* Define to `long' if <sys/types.h> doesn't define. */
|
||||
#undef off_t
|
||||
|
||||
/* Define if the system does not provide POSIX.1 features except
|
||||
with this defined. */
|
||||
#undef _POSIX_1_SOURCE
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define if the setvbuf function takes the buffering type as its second
|
||||
argument and the buffer pointer as the third, as on System V
|
||||
before release 3. */
|
||||
#undef SETVBUF_REVERSED
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
#undef size_t
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
#undef STACK_DIRECTION
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if your <sys/time.h> declares struct tm. */
|
||||
#undef TM_IN_SYS_TIME
|
||||
|
||||
/* Define to 1 if NLS is requested. */
|
||||
#undef ENABLE_NLS
|
||||
|
||||
/* Define as 1 if you have catgets and don't want to use GNU gettext. */
|
||||
#undef HAVE_CATGETS
|
||||
|
||||
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
|
||||
#undef HAVE_GETTEXT
|
||||
|
||||
/* Define if your locale.h file contains LC_MESSAGES. */
|
||||
#undef HAVE_LC_MESSAGES
|
||||
|
||||
/* Define as 1 if you have the stpcpy function. */
|
||||
#undef HAVE_STPCPY
|
||||
|
||||
/* Define to the name of the distribution. */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the version of the distribution. */
|
||||
#undef VERSION
|
||||
|
||||
/* Define if you have the __argz_count function. */
|
||||
#undef HAVE___ARGZ_COUNT
|
||||
|
||||
/* Define if you have the __argz_next function. */
|
||||
#undef HAVE___ARGZ_NEXT
|
||||
|
||||
/* Define if you have the __argz_stringify function. */
|
||||
#undef HAVE___ARGZ_STRINGIFY
|
||||
|
||||
/* Define if you have the bzero function. */
|
||||
#undef HAVE_BZERO
|
||||
|
||||
/* Define if you have the dcgettext function. */
|
||||
#undef HAVE_DCGETTEXT
|
||||
|
||||
/* Define if you have the getcwd function. */
|
||||
#undef HAVE_GETCWD
|
||||
|
||||
/* Define if you have the getpagesize function. */
|
||||
#undef HAVE_GETPAGESIZE
|
||||
|
||||
/* Define if you have the memcpy function. */
|
||||
#undef HAVE_MEMCPY
|
||||
|
||||
/* Define if you have the memmove function. */
|
||||
#undef HAVE_MEMMOVE
|
||||
|
||||
/* Define if you have the memset function. */
|
||||
#undef HAVE_MEMSET
|
||||
|
||||
/* Define if you have the munmap function. */
|
||||
#undef HAVE_MUNMAP
|
||||
|
||||
/* Define if you have the putenv function. */
|
||||
#undef HAVE_PUTENV
|
||||
|
||||
/* Define if you have the setenv function. */
|
||||
#undef HAVE_SETENV
|
||||
|
||||
/* Define if you have the setlocale function. */
|
||||
#undef HAVE_SETLOCALE
|
||||
|
||||
/* Define if you have the setvbuf function. */
|
||||
#undef HAVE_SETVBUF
|
||||
|
||||
/* Define if you have the sigprocmask function. */
|
||||
#undef HAVE_SIGPROCMASK
|
||||
|
||||
/* Define if you have the sigsetmask function. */
|
||||
#undef HAVE_SIGSETMASK
|
||||
|
||||
/* Define if you have the stpcpy function. */
|
||||
#undef HAVE_STPCPY
|
||||
|
||||
/* Define if you have the strcasecmp function. */
|
||||
#undef HAVE_STRCASECMP
|
||||
|
||||
/* Define if you have the strchr function. */
|
||||
#undef HAVE_STRCHR
|
||||
|
||||
/* Define if you have the strdup function. */
|
||||
#undef HAVE_STRDUP
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#undef HAVE_STRERROR
|
||||
|
||||
/* Define if you have the <argz.h> header file. */
|
||||
#undef HAVE_ARGZ_H
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#undef HAVE_LIMITS_H
|
||||
|
||||
/* Define if you have the <locale.h> header file. */
|
||||
#undef HAVE_LOCALE_H
|
||||
|
||||
/* Define if you have the <malloc.h> header file. */
|
||||
#undef HAVE_MALLOC_H
|
||||
|
||||
/* Define if you have the <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 <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define if you have the <sys/fcntl.h> header file. */
|
||||
#undef HAVE_SYS_FCNTL_H
|
||||
|
||||
/* Define if you have the <sys/file.h> header file. */
|
||||
#undef HAVE_SYS_FILE_H
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define if you have the <sys/ptem.h> header file. */
|
||||
#undef HAVE_SYS_PTEM_H
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
/* Define if you have the <sys/ttold.h> header file. */
|
||||
#undef HAVE_SYS_TTOLD_H
|
||||
|
||||
/* Define if you have the <sys/wait.h> header file. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if you have the <termcap.h> header file. */
|
||||
#undef HAVE_TERMCAP_H
|
||||
|
||||
/* Define if you have the <termio.h> header file. */
|
||||
#undef HAVE_TERMIO_H
|
||||
|
||||
/* Define if you have the <termios.h> header file. */
|
||||
#undef HAVE_TERMIOS_H
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have the <values.h> header file. */
|
||||
#undef HAVE_VALUES_H
|
||||
|
||||
/* Define if you have the bsd library (-lbsd). */
|
||||
#undef HAVE_LIBBSD
|
||||
|
||||
/* Define if you have the i library (-li). */
|
||||
#undef HAVE_LIBI
|
||||
|
||||
/* Define if you have the z library (-lz). */
|
||||
#undef HAVE_LIBZ
|
||||
|
||||
/* For gettext (NLS) */
|
||||
#include <libintl.h>
|
||||
#define _(String) gettext (String)
|
||||
#define N_(String) (String)
|
||||
|
||||
|
||||
/* Leave that blank line there!! Autoheader needs it.
|
||||
If you're adding to this file, keep in mind:
|
||||
The entries are in sort -df order: alphabetical, case insensitive,
|
||||
ignoring punctuation (such as underscores). */
|
4
texinfo/config.sub
vendored
4
texinfo/config.sub
vendored
|
@ -1,4 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Use the top-level config.sub so that we don't have two of them.
|
||||
subsys=`echo $0 | sed 's|config.sub|../config.sub|'`
|
||||
exec ${subsys} "$@"
|
4346
texinfo/configure
vendored
4346
texinfo/configure
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,86 +0,0 @@
|
|||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl $Id: configure.in,v 1.7 1998/03/26 10:30:41 law Exp $
|
||||
dnl
|
||||
AC_INIT(makeinfo/makeinfo.c)
|
||||
AC_PREREQ(2.12)dnl Minimum Autoconf version required.
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
AM_INIT_AUTOMAKE([texinfo], [3.12])
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_GCC_TRADITIONAL
|
||||
EGCS_PROG_INSTALL
|
||||
AC_PROG_RANLIB
|
||||
|
||||
# We do this for the sake of a more helpful warning in doc/Makefile.
|
||||
TEXMF='$(datadir)/texmf'
|
||||
AC_CHECK_PROG(TEXCONFIG, texconfig, true, false)
|
||||
$TEXCONFIG && eval `texconfig conf </dev/null | grep '^TEXMF='`
|
||||
AC_SUBST(TEXMF)
|
||||
|
||||
AC_ISC_POSIX
|
||||
AC_MINIX
|
||||
|
||||
dnl CYGNUS LOCAL: Add AM_MAINTAINER_MODE and AM_EXEEXT
|
||||
AM_MAINTAINER_MODE
|
||||
AM_EXEEXT
|
||||
|
||||
dnl Checks for libraries.
|
||||
AC_CHECK_HEADERS(zlib.h, [AC_CHECK_LIB(z, gzdopen)])
|
||||
|
||||
# Needed on sysV68 for sigblock, sigsetmask. But check for it in libc first.
|
||||
AC_CHECK_FUNC(sigblock, , AC_CHECK_LIB(bsd, sigblock))
|
||||
|
||||
# Some GNU/Linux systems (e.g., SuSE 4.3, 1996) don't have curses, but
|
||||
# rather ncurses. So we check for it.
|
||||
TERMLIBS=
|
||||
for termlib in ncurses curses termcap terminfo termlib ; do
|
||||
AC_CHECK_LIB(${termlib}, tputs,
|
||||
[TERMLIBS="${TERMLIBS} -l${termlib}"; break])
|
||||
done
|
||||
AC_SUBST(TERMLIBS)
|
||||
|
||||
dnl Checks for header files.
|
||||
dnl Do not use <ncurses/termcap.h> unless we're linking with ncurses.
|
||||
if test "x$termlib" = xncurses; then
|
||||
dnl Use AC_CHECK_HEADERS so the HAVE_*_H symbol gets defined.
|
||||
AC_CHECK_HEADERS(ncurses/termcap.h)
|
||||
fi
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(fcntl.h pwd.h string.h strings.h termcap.h termio.h \
|
||||
termios.h unistd.h \
|
||||
sys/fcntl.h sys/file.h sys/ptem.h sys/time.h sys/ttold.h sys/wait.h)
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_TYPE_OFF_T
|
||||
AC_TYPE_SIGNAL
|
||||
AC_C_CONST
|
||||
AC_STRUCT_TM
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_FUNC_ALLOCA
|
||||
AC_FUNC_VPRINTF
|
||||
if test "$ac_cv_c_cross" = no; then
|
||||
AC_FUNC_SETVBUF_REVERSED
|
||||
fi
|
||||
AC_CHECK_FUNCS(setvbuf getcwd memset bzero strchr strcasecmp \
|
||||
sigprocmask sigsetmask)
|
||||
dnl strcasecmp, strerror, xmalloc, xrealloc, probably others should be added.
|
||||
AC_REPLACE_FUNCS(memcpy memmove strdup strerror)
|
||||
|
||||
dnl Set of available languages and i18n macros.
|
||||
ALL_LINGUAS="de fr"
|
||||
AM_GNU_GETTEXT
|
||||
AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
|
||||
|
||||
AC_OUTPUT([Makefile \
|
||||
doc/Makefile \
|
||||
info/Makefile \
|
||||
intl/Makefile \
|
||||
lib/Makefile \
|
||||
makeinfo/Makefile \
|
||||
po/Makefile.in \
|
||||
util/Makefile \
|
||||
],
|
||||
[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in >po/Makefile])
|
|
@ -1,69 +0,0 @@
|
|||
# Makefile for Cygnus overrides to Texinfo distribution. -*- Indented-Text -*-
|
||||
# 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.
|
||||
|
||||
#### Start of system configuration section. ####
|
||||
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
LN = ln
|
||||
RM = rm -f
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
# We do not use texi2dvi because (a) we need no index, and
|
||||
# (b) texi2dvi monkeys with TEXINPUTS
|
||||
TEX = tex
|
||||
|
||||
#### End of system configuration section. ####
|
||||
|
||||
all: dvi
|
||||
|
||||
sub-all:
|
||||
check:
|
||||
installcheck:
|
||||
info:
|
||||
install-info:
|
||||
|
||||
TAGS:
|
||||
|
||||
dvi: license.dvi lgpl.dvi
|
||||
|
||||
install:
|
||||
|
||||
uninstall:
|
||||
|
||||
Makefile: Makefile.in ../config.status
|
||||
cd ..; $(SHELL) ./config.status
|
||||
|
||||
clean mostlyclean:
|
||||
$(RM) license.?? license.??? liblic.?? liblic.??? lgpl.?? lgpl.???
|
||||
|
||||
distclean realclean: clean
|
||||
$(RM) Makefile config.status fsf-texi.tex
|
||||
|
||||
license.dvi: texiplus.tex texinfo.tex $(srcdir)/../license.texi $(srcdir)/../gpl.texinfo fsf-texi.tex
|
||||
TEXINPUTS=$(srcdir):.:$(srcdir)/.. $(TEX) $(srcdir)/../license.texi
|
||||
|
||||
lgpl.dvi: texiplus.tex texinfo.tex $(srcdir)/../liblic.texi $(srcdir)/../lgpl.texinfo fsf-texi.tex
|
||||
TEXINPUTS=$(srcdir):.:$(srcdir)/.. $(TEX) $(srcdir)/../liblic.texi
|
||||
mv liblic.dvi lgpl.dvi
|
||||
|
||||
fsf-texi.tex: $(srcdir)/../texinfo.tex
|
||||
cp $(srcdir)/../texinfo.tex fsf-texi.tex
|
||||
|
||||
force:
|
|
@ -1,7 +0,0 @@
|
|||
%$Id: texinfo.tex,v 1.1.1.1 1998/03/23 04:42:12 law Exp $
|
||||
% Cover file to permit easy management of FSF texinfo.tex and use of
|
||||
% Cygnus local revisions.
|
||||
% First we get the official FSF one:
|
||||
\input fsf-texi.tex
|
||||
@c Now we get the Cygnus mods to override things we like to do differently:
|
||||
@input texiplus.tex
|
|
@ -1,325 +0,0 @@
|
|||
@tex
|
||||
%% Cygnus revisions to texinfo.tex, TeX macros to handle texinfo files
|
||||
% Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
%% Maintained at Cygnus Support as:
|
||||
%%$Id: texiplus.tex,v 1.1.1.1 1998/03/23 04:42:12 law Exp $
|
||||
|
||||
%This texi+.tex file is free software; you can redistribute it and/or
|
||||
%modify it under the terms of the GNU General Public License as
|
||||
%published by the Free Software Foundation; either version 1, or (at
|
||||
|
||||
{\let\fsfvn=\texinfoversion
|
||||
\xdef\texinfoversion{\fsfvn\ (Cygnus)}}
|
||||
\message{Loading Cygnus texinfo revisions [\texinfoversion]:}
|
||||
|
||||
% Print the version number if in a .fmt file.
|
||||
\everyjob{\message{[Cygnus Texinfo \texinfoversion]}}
|
||||
|
||||
\globaldefs=1 % Escape the bounds of @tex/@end tex surrounding us
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CROPMARKS%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% These differ only slightly from FSF defaults; all crop dimens are
|
||||
% defined here (whether different or not) for ease in revising.
|
||||
\cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks
|
||||
\outerhsize=7in
|
||||
\outervsize=9in
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\newif\ifdraft\drafttrue % Extra markings; turn off with @finalout
|
||||
|
||||
% There are only two small changes to standard \title from texinfo
|
||||
% (1) to include DRAFT marking on title page unless @finalout
|
||||
% (2) to include a title-sized \tt font
|
||||
% However, since \title is local to \titlepage, we have to redefine
|
||||
% *that* whole damned thing.
|
||||
%%%%%%%%%%This is sensitive to conflict w/FSF changes!****************
|
||||
\def\titlepage{\begingroup \parindent=0pt \textfonts
|
||||
\let\subtitlerm=\tenrm
|
||||
% I deinstalled the following change because \cmr12 is undefined.
|
||||
% This change was not in the ChangeLog anyway. --rms.
|
||||
% \let\subtitlerm=\cmr12
|
||||
\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
|
||||
%
|
||||
\def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
|
||||
%
|
||||
% Leave some space at the very top of the page.
|
||||
\vglue\titlepagetopglue
|
||||
%
|
||||
% Now you can print the title using @title.
|
||||
\def\title{\parsearg\titlezzz}%
|
||||
%changes from FSF only in following line:
|
||||
\def\titlezzz##1{{\let\tentt=\titlett
|
||||
\leftline{\titlefont{##1\ifdraft\hfill DRAFT\fi }}}
|
||||
%end real changes from FSF version
|
||||
% print a rule at the page bottom also.
|
||||
\finishedtitlepagefalse
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% The ``width \hsize'' below should be unnecessary, since the rule is
|
||||
% supposed to default to the smallest enclosing box...but *something*
|
||||
% in texiplus breaks that default, so we force it to hsize.
|
||||
\vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% No rule at page bottom unless we print one at the top with @title.
|
||||
\finishedtitlepagetrue
|
||||
%
|
||||
% Now you can put text using @subtitle.
|
||||
\def\subtitle{\parsearg\subtitlezzz}%
|
||||
\def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
|
||||
%
|
||||
% @author should come last, but may come many times.
|
||||
\def\author{\parsearg\authorzzz}%
|
||||
\def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
|
||||
{\authorfont \leftline{##1}}}%
|
||||
%
|
||||
% Most title ``pages'' are actually two pages long, with space
|
||||
% at the top of the second. We don't want the ragged left on the second.
|
||||
\let\oldpage = \page
|
||||
\def\page{%
|
||||
\iffinishedtitlepage\else
|
||||
\finishtitlepage
|
||||
\fi
|
||||
\oldpage
|
||||
\let\page = \oldpage
|
||||
\hbox{}}%
|
||||
% \def\page{\oldpage \hbox{}}
|
||||
}
|
||||
\def\finishtitlepage{%
|
||||
% same comment re ``width \hsize'' as on last hrule...
|
||||
\vskip4pt \hrule width \hsize height 2pt
|
||||
\vskip\titlepagebottomglue
|
||||
\finishedtitlepagetrue
|
||||
}
|
||||
%%%%%%%%%%end sensitive to conflict w/FSF changes!********************
|
||||
|
||||
% Cygnus uses different default page headings and footers
|
||||
\def\leadline{\ \leaders\hrule height 2.5pt depth -2pt\hfil\ }
|
||||
\def\manvers{}% Empty default version in case manual doesn't supply
|
||||
% This is for _explicitly_ turning headers off. Note that we're more
|
||||
% literal-minded than the FSF: we don't turn off _footers_! This
|
||||
% means that, unlike with the FSF macros, our ``@headings off'' do not
|
||||
% return to the default Texinfo heading-state of the document.
|
||||
% Reconsider if this gives trouble...
|
||||
\def\HEADINGSoff{
|
||||
\global\evenheadline={\hfil}
|
||||
\global\evenfootline={\line{\let\,=\thinspace\ftfnt c\,y\,g\,n\,u\,s\quad s\,u\,p\,p\,o\,r\,t\leadline\manvers}}
|
||||
\global\oddheadline={\hfil}
|
||||
\global\oddfootline={\line {\let\,=\thinspace\ftfnt c\,y\,g\,n\,u\,s\quad s\,u\,p\,p\,o\,r\,t\leadline\manvers}}}
|
||||
% SINGLEPAGE:
|
||||
\def\HEADINGSsingle{
|
||||
\global\pageno=1\HEADINGSsinglex}
|
||||
\def\HEADINGSsinglex{
|
||||
\global\evenfootline={%
|
||||
{\let\,=\thinspace\ftfnt c\,y\,g\,n\,u\,s\quad s\,u\,p\,p\,o\,r\,t}%
|
||||
\leadline\manvers}
|
||||
\global\oddfootline={%
|
||||
{\let\,=\thinspace\ftfnt c\,y\,g\,n\,u\,s\quad s\,u\,p\,p\,o\,r\,t}%
|
||||
\leadline\manvers}
|
||||
\global\evenheadline={\ftfnt\thischapter\leadline
|
||||
\ifdraft DRAFT\leadline\fi
|
||||
\bf\folio}
|
||||
\global\oddheadline={\ftfnt\thischapter\leadline
|
||||
\ifdraft DRAFT\leadline\fi
|
||||
\bf\folio}
|
||||
}
|
||||
%
|
||||
% DOUBLEPAGE:
|
||||
% use hrule leaders to delimit headings, footings from
|
||||
% body; timestamp footer; pagenos outside *bottom* to
|
||||
% permit moving chaptername to outside *top* (for easier
|
||||
% skimming). 1990 dec 31, pesch@cygnus.com
|
||||
\def\HEADINGSdouble{
|
||||
\global\pageno=1\HEADINGSdoublex}
|
||||
\def\HEADINGSdoublex{
|
||||
\global\evenfootline={%
|
||||
{\bf\folio}\ftfnt\leadline\ifdraft DRAFT\quad\fi
|
||||
\ftfnt\manvers\qquad\today
|
||||
}
|
||||
\global\oddfootline={%
|
||||
{\let\,=\thinspace\ftfnt c\,y\,g\,n\,u\,s\quad s\,u\,p\,p\,o\,r\,t}%
|
||||
\leadline{\bf\folio}%
|
||||
}
|
||||
\global\evenheadline={\ftfnt\thistitle\leadline\ifdraft DRAFT\fi}
|
||||
\global\oddheadline={\rm\leadline\thischapter}
|
||||
}
|
||||
|
||||
% CHANGE to @finalout ---also use it to remove DRAFT markings from
|
||||
% title, footers
|
||||
%% For a final copy, take out the rectangles
|
||||
%% that mark overfull boxes (in case you have decided
|
||||
%% that the text looks ok even though it passes the margin).
|
||||
\def\finalout{\overfullrule=0pt
|
||||
%% Also take out ``DRAFT'' markings
|
||||
\global\draftfalse
|
||||
}
|
||||
|
||||
%Font overrides; we use PostScript when possible.
|
||||
\font\textrm=pncr scaled \magstephalf
|
||||
\font\texttt=pcrr
|
||||
\font\textbf=pncb scaled \magstephalf
|
||||
\font\textit=pncri scaled \magstephalf
|
||||
\font\textsl=pcrro
|
||||
\font\textsf=slcrst at 9.5pt
|
||||
% FIXME: figure out, test dvips smallcaps kluge
|
||||
%\font\textsc=Times-SmallCaps scaled \magstephalf
|
||||
\font\ftfnt=phvr at 8pt % Cygnus Support footer-font
|
||||
|
||||
\font\defbf=pncb scaled \magstep1 %was 1314
|
||||
|
||||
\font\ninett=pcrr at 9pt
|
||||
\let\indtt=\ninett
|
||||
\font\indrm=pncr at 9pt
|
||||
\font\indit=pncri at 9pt
|
||||
\font\indsl=pcrro at 9pt
|
||||
\let\indsf=\indrm
|
||||
\let\indbf=\indrm
|
||||
\let\indsc=\indrm
|
||||
|
||||
\font\chaprm=pncb at 17pt
|
||||
\font\chapit=pncbi at 17pt
|
||||
\font\chapsl=pcrbo at 16pt
|
||||
\font\chaptt=pcrb at 16pt
|
||||
\font\chapsf=slcrst at 16pt
|
||||
\let\chapbf=\chaprm
|
||||
% \chapfonts mod from FSF vn is to include baselineskip, for the few
|
||||
% cases where a title chapter overflows its line.
|
||||
\def\chapfonts{\baselineskip=19pt%
|
||||
\let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
|
||||
\let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
|
||||
\let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
|
||||
\resetmathfonts}
|
||||
|
||||
|
||||
\font\secrm=pncb at 14pt
|
||||
\font\secit=pncbi at 14pt
|
||||
\font\secsl=pcrbo at 13pt
|
||||
\font\sectt=pcrb at 13pt
|
||||
\font\secsf=slcrst at 13pt
|
||||
\font\secbf=pncb at 14pt
|
||||
|
||||
\font\ssecrm=pncr at 13pt
|
||||
\font\ssecit=pncri at 13pt
|
||||
\font\ssecsl=pcrro at 12pt
|
||||
\font\ssectt=pcrr at 12pt
|
||||
\font\ssecsf=slcrst at 12pt
|
||||
\font\ssecbf=pncb at 13pt
|
||||
|
||||
\font\titlerm=pncb at 21pt
|
||||
\font\titlett=pcrr at 20pt
|
||||
\font\authorrm=pncr scaled \magstep2
|
||||
|
||||
\font\truesecrm=pncr at 12pt
|
||||
|
||||
% Fonts for short table of contents
|
||||
\font\shortcontrm=pncr at 12pt
|
||||
\font\shortcontbf=pncb at 12pt
|
||||
\font\shortcontsl=pncri at 12pt
|
||||
|
||||
% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
|
||||
% unless the following character is such as not to need one.
|
||||
\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
|
||||
\def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx}
|
||||
% \smartitalic is used for @emph; FSF keeps trying to make it match
|
||||
% @var.
|
||||
%
|
||||
% \smartslant{ARG} outputs arg in a slanted font, followed by an
|
||||
% italic correction unless the following character is such as not to need one.
|
||||
\def\smartslantx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
|
||||
\def\smartslant#1{{\sl #1}\futurelet\next\smartslantx}
|
||||
|
||||
\let\i=\smartitalic
|
||||
\let\var=\smartslant
|
||||
\let\dfn=\smartitalic
|
||||
\let\emph=\smartitalic
|
||||
\let\cite=\smartitalic
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% @altref, if called explicitly (inside @iftex), switches the @ref
|
||||
% printed output so it lacks the square brackets used by default.
|
||||
% While we're at it, we use double quotes instead of square brackets
|
||||
% (or no decorator at all, depending on state of @altref toggle).
|
||||
% Unfortunately this requires reproducing the entire damn xrefX
|
||||
% definition. WARNING: may need to track texinfo.tex changes to xrefX...
|
||||
\newif\ifbra\bratrue
|
||||
\def\altref{\ifbra\brafalse\else\bratrue\fi}% Toggle.
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Begin duplicate xrefX:
|
||||
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup%
|
||||
\def\printedmanual{\ignorespaces #5}%
|
||||
\def\printednodename{\ignorespaces #3}%
|
||||
%
|
||||
\setbox1=\hbox{\printedmanual}%
|
||||
\setbox0=\hbox{\printednodename}%
|
||||
\ifdim \wd0=0pt%
|
||||
\def\printednodename{\ignorespaces #1}%
|
||||
%%% Uncommment the following line to make the actual chapter or section title
|
||||
%%% appear inside the square brackets.
|
||||
%\def\printednodename{#1-title}%
|
||||
\fi%
|
||||
%
|
||||
%
|
||||
% If we use \unhbox0 and \unhbox1 to print the node names, TeX does
|
||||
% not insert empty discretionaries after hyphens, which means that it
|
||||
% will not find a line break at a hyphen in a node names. Since some
|
||||
% manuals are best written with fairly long node names, containing
|
||||
% hyphens, this is a loss. Therefore, we simply give the text of
|
||||
% the node name again, so it is as if TeX is seeing it for the first
|
||||
% time.
|
||||
\ifdim \wd1>0pt
|
||||
section ``\printednodename'' in \cite{\printedmanual}%
|
||||
\else%
|
||||
\turnoffactive%
|
||||
%%%%%%%%%%%%%%%Here's the change for @altref:
|
||||
\ifbra
|
||||
\refx{#1-snt}{} ``\printednodename,'' page\tie\refx{#1-pg}{}%
|
||||
\else
|
||||
\refx{#1-snt}{} \printednodename, page\tie\refx{#1-pg}{}%
|
||||
\fi
|
||||
%%%%%%%%%%%%%%%end change for @altref
|
||||
\fi
|
||||
\endgroup}
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%:End duplicate xrefX
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% \widen: let examples (or whatever) fall into margins. Symmetric. Cancel
|
||||
% ``@widen{N}'' with ``@widen{-N}''.
|
||||
\newdimen\extra\extra=0pt % for ``widen''
|
||||
\global\def\widen#1{\advance\extra by #1%
|
||||
\advance\leftskip by -#1\advance\rightskip by -#1}
|
||||
%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% ONLY INTENDED CHANGES from FSF smallbook: tolerance and page centering
|
||||
% Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25)
|
||||
\def\smallbook{
|
||||
|
||||
% These values for secheadingskip and subsecheadingskip are
|
||||
% experiments. RJC 7 Aug 1992
|
||||
\global\secheadingskip = 17pt plus 6pt minus 3pt
|
||||
\global\subsecheadingskip = 14pt plus 6pt minus 3pt
|
||||
|
||||
\global\lispnarrowing = 0.3in
|
||||
\setleading{12pt}
|
||||
\advance\topskip by -1cm
|
||||
\global\parskip 3pt plus 1pt
|
||||
\global\hsize = 5in
|
||||
\advance\normaloffset by .75in % half of difference from 6.5in default hsize
|
||||
\global\vsize=7.5in
|
||||
\advance\voffset by .7in % half of difference from 8.9in default vsize
|
||||
\global\tolerance=1400
|
||||
\global\hfuzz=1pt
|
||||
\global\contentsrightmargin=0pt
|
||||
|
||||
\global\pagewidth=\hsize
|
||||
\global\pageheight=\vsize
|
||||
|
||||
\global\let\smalllisp=\smalllispx
|
||||
\global\let\smallexample=\smalllispx
|
||||
\global\def\Esmallexample{\Esmalllisp}
|
||||
}\textfonts
|
||||
|
||||
\globaldefs=0 % this is NOT redundant; the \endgroup done by@end tex
|
||||
% would restore the value, but before doing that would
|
||||
% screw up if globaldefs=1 were allowed to remain here.
|
||||
@end tex
|
||||
@rm
|
||||
@smallbook
|
||||
@c some manuals (notably as) contain stuff that only looks good in
|
||||
@c smallbook; this switch controls its appearance, by local convention
|
||||
@set SMALL
|
|
@ -1,37 +0,0 @@
|
|||
#!/bin/sh
|
||||
# tocfix - move a DVI file table of contents to its proper position
|
||||
|
||||
# TeX puts the table of contents at the end of the DVI file.
|
||||
# If you're printing multiple pages per sheet, you can't fix it
|
||||
# on the printout. This program moves the TOC to be right after
|
||||
# the titlepage and copyright page.
|
||||
# It's a safe no-op to run this program on a DVI file more than once.
|
||||
|
||||
# Some explanation: the TOC has negative page numbers, represented
|
||||
# to dviselect by an underscore. The titlepage and copyright page
|
||||
# have TeX page numbers 1 and 2, but so do the first two pages of the
|
||||
# first chapter. So we have to use absolute, as opposed to TeX,
|
||||
# page numbers to get them right, represented to dviselect by an
|
||||
# equals sign.
|
||||
|
||||
# This program assumes that the DVI file has the standard Texinfo
|
||||
# format -- a titlepage, a copyright page, then the real text.
|
||||
|
||||
# djm@cygnus.com (David MacKenzie)
|
||||
|
||||
trap 'rm -f new-*.dvi title.dvi toc.dvi body_plus_toc.dvi body.dvi; exit 1' 1 3 15
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Usage; tocfix dvifile..." >&2; exit 1
|
||||
fi
|
||||
|
||||
for dvi
|
||||
do
|
||||
dviselect -i $dvi -o title.dvi =1:2
|
||||
dviselect -i $dvi -o toc.dvi :_1
|
||||
dviselect -i $dvi -o body_plus_toc.dvi =3:
|
||||
dviselect -i body_plus_toc.dvi -o body.dvi 1:
|
||||
dviconcat -o new-$dvi title.dvi toc.dvi body.dvi
|
||||
mv new-$dvi $dvi
|
||||
rm -f title.dvi toc.dvi body_plus_toc.dvi body.dvi
|
||||
done
|
16
texinfo/dir
16
texinfo/dir
|
@ -1,16 +0,0 @@
|
|||
$Id: dir,v 1.2 1998/03/24 17:58:17 law Exp $
|
||||
This is the file .../info/dir, which contains the topmost node of the
|
||||
Info hierarchy. The first time you invoke Info you start off
|
||||
looking at that node, which is (dir)Top.
|
||||
|
||||
File: dir Node: Top This is the top of the INFO tree
|
||||
|
||||
This (the Directory node) gives a menu of major topics.
|
||||
Typing "q" exits, "?" lists all Info commands, "d" returns here,
|
||||
"h" gives a primer for first-timers,
|
||||
"mEmacs<Return>" visits the Emacs topic, etc.
|
||||
|
||||
In Emacs, you can click mouse button 2 on a menu item or cross reference
|
||||
to select it.
|
||||
|
||||
* Menu:
|
|
@ -1,341 +0,0 @@
|
|||
This is the directory file `dir' a.k.a. `DIR', which contains the
|
||||
topmost node of the Info hierarchy.
|
||||
This particular dir file is merely made available for your hacking
|
||||
pleasure, not official or standard in any way. If it doesn't make sense
|
||||
to you, or you don't like it, ignore it.
|
||||
If you have dir entries for Texinfo manuals you'd like to be added here,
|
||||
please send them to karl@gnu.org.
|
||||
|
||||
$Id: dir-example,v 1.1.1.3 1998/03/24 18:19:30 law Exp $
|
||||
|
||||
File: dir, Node: Top, This is the top of the INFO tree.
|
||||
|
||||
This is the Info main menu (aka directory node).
|
||||
A few useful Info commands:
|
||||
|
||||
`q' quits;
|
||||
`?' lists all Info commands;
|
||||
`h' starts the Info tutorial;
|
||||
`mTexinfo RET' visits the Texinfo manual, etc.
|
||||
|
||||
Not all of the topics shown below may be available on this system.
|
||||
|
||||
* Menu:
|
||||
|
||||
GNU packages
|
||||
* Bash: (bash). Bourne-Again SHell.
|
||||
* Cpio: (cpio). Copy-in-copy-out archiver.
|
||||
* DC: (dc). Postfix desk calculator.
|
||||
* Diff: (diff). Comparing and merging programs.
|
||||
* Ed: (ed). Line editor.
|
||||
* Emacs: (emacs). Extensible self-documenting text editor.
|
||||
* File utilities: (fileutils). GNU file utilities.
|
||||
* Finding files: (find). Operating on files matching certain criteria.
|
||||
* Font utilities: (fontu). Programs for font manipulation.
|
||||
* Gawk: (gawk.info). A text scanning and processing language.
|
||||
* Gcal: (gcal). GNU calendar program.
|
||||
* Gzip: (gzip). General (de)compression.
|
||||
* Identifier DB: (id-utils). Identifier database utilities.
|
||||
* Ispell: (ispell). Interactive spelling corrector.
|
||||
* M4: (m4). Macro processor.
|
||||
* Make: (make). Remake files automatically.
|
||||
* Ptx: (ptx). Permuted index generator.
|
||||
* Shar: (sharutils). Shell archiver, uudecode/uuencode.
|
||||
* Shell utilities: (sh-utils). GNU shell utilities.
|
||||
* tar: (tar). Making tape (or disk) archives.
|
||||
* Text utilities: (textutils). GNU text utilities.
|
||||
* Time: (time). Measuring program resource usage.
|
||||
* UUCP: (uucp). Copying between machines, offline.
|
||||
* Wdiff: (wdiff). Word-by-word comparison.
|
||||
* Wget: (wget). URL download.
|
||||
|
||||
GNU programming tools
|
||||
* As: (as). Assembler.
|
||||
* Binutils: (binutils). ar/copy/objdump/nm/size/strip/ranlib.
|
||||
* Bison: (bison). LALR(1) parser generator.
|
||||
* CPP: (cpp). C preprocessor.
|
||||
* CVS: (cvs). Concurrent versions system for source control.
|
||||
* DejaGnu: (dejagnu). Testing framework.
|
||||
* Flex: (flex). A fast scanner generator.
|
||||
* Gasp: (gasp). GNU Assembler preprocessor.
|
||||
* Libtool: (libtool). Generic library support script.
|
||||
* GCC: (gcc). C compiler.
|
||||
* GDB: (gdb). Source-level debugger for C and C++.
|
||||
* Gettext Utilities: (gettext). GNU gettext utilities.
|
||||
* Gperf: (gperf). Perfect hash function generator.
|
||||
* Gprof: (gprof). Profiler.
|
||||
* Indent: (indent). Prettyprinter for programs.
|
||||
* Ld: (ld). Linker.
|
||||
|
||||
Texinfo documentation system
|
||||
* Info: (info). Documentation browsing system.
|
||||
* Texinfo: (texinfo). The GNU documentation format.
|
||||
* info program: (info-stnd). Standalone Info-reading program.
|
||||
* install-info: (texinfo)Invoking install-info. Updating info/dir entries.
|
||||
* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation.
|
||||
* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files.
|
||||
* makeinfo: (texinfo)makeinfo preferred. Translate Texinfo source.
|
||||
|
||||
GNU Emacs Lisp
|
||||
* Elisp: (elisp). GNU Emacs Lisp reference manual.
|
||||
* Intro Elisp: (emacs-lisp-intro). Introduction to Elisp programming.
|
||||
|
||||
* AUC TeX: (auctex). Editing (La)TeX files.
|
||||
* Calc: (calc). Calculator and more.
|
||||
* CC mode: (cc-mode). Editing C, C++, Objective C, and Java.
|
||||
* Common Lisp: (cl). Partial Common Lisp support for Emacs Lisp.
|
||||
* Dired-x: (dired-x). Extra directory editor features.
|
||||
* Edebug: (edebug). Source-level debugger for Emacs Lisp.
|
||||
* Ediff: (ediff). Comprehensive visual interface to diff & patch.
|
||||
* EDB: (edb). Database for Emacs.
|
||||
* Forms: (forms). Fill-in-the-form data entry.
|
||||
* Gmhist: (gmhist). Generic minibuffer history.
|
||||
* GNUS: (gnus). Netnews reading and posting.
|
||||
* Mailcrypt: (mailcrypt). Use PGP in Emacs.
|
||||
* MH-E: (mh-e). Emacs interface to the MH mail system.
|
||||
* PCL-CVS: (pcl-cvs). Emacs front end to CVS.
|
||||
* Supercite: (sc). Supercite for including other people's words.
|
||||
* VIP: (vip). vi emulation.
|
||||
* VIPER: (viper). The new VI-emulation mode in Emacs-19.29.
|
||||
* VM: (vm). Mail reader.
|
||||
* W3: (w3). WWW browser.
|
||||
|
||||
GNU programming support
|
||||
* Autoconf: (autoconf). Automatic generation of package configuration.
|
||||
* Configure: (configure). Cygnus configure.
|
||||
* Gnats: (gnats). Cygnus bug tracking system.
|
||||
* Remsync: (remsync). Remote synchronization of directory trees.
|
||||
* Send PR: (send-pr). Cygnus bug reporting for Gnats.
|
||||
|
||||
GNU libraries
|
||||
* Annotate: (annotate). High-level GDB to GUI's.
|
||||
* BFD: (bfd). Binary file descriptors for object file IO.
|
||||
* GDB library: (libgdb). Application programming interface to GDB.
|
||||
* GDBM: (gdbm). Hashed databases.
|
||||
* History: (history). Recall previous lines of input.
|
||||
* Iostream: (iostream). C++ input/output.
|
||||
* Libc: (libc). C library.
|
||||
* Libg++: (libg++). C++ classes.
|
||||
* Mmalloc: (mmalloc). Memory-mapped malloc.
|
||||
* Readline: (readline). General command-line interface.
|
||||
* Regex: (regex). Regular expressions.
|
||||
* Termcap: (termcap). All about /etc/termcap.
|
||||
|
||||
GNU programming documentation
|
||||
* GDB internals: (gdbint). Debugger internals.
|
||||
* Ld internals: (ldint). GNU linker internals.
|
||||
* Maintaining: (maintain). Maintaining GNU software.
|
||||
* Source config: (cfg-paper). Some theory on configuring source packages.
|
||||
* Stabs: (stabs). Symbol table debugging information format.
|
||||
* Standards: (standards). GNU coding standards.
|
||||
|
||||
Linux
|
||||
* dosemu: (dosemu). Linux DOS emulator.
|
||||
* gpm: (gpm). Linux general purpose mouse interface.
|
||||
* linux-faq: (linux-faq). The Linux FAQ List
|
||||
|
||||
TeX things
|
||||
* Afm2tfm: (dvips)Invoking afm2tfm. Making Type 1 fonts available to TeX.
|
||||
* Dvips: (dvips). DVI-to-PostScript translator.
|
||||
* Eplain: (eplain). Expanding on plain TeX.
|
||||
* Kpathsearch: (kpathsea). File lookup along search paths.
|
||||
* LaTeX: (latex). LaTeX.
|
||||
* MakeIndex: (makeindex). Index creation for TeX.
|
||||
* Naming fonts: (fontname). Filenames for TeX fonts.
|
||||
* TDS: (tds). Standard TeX directory structure.
|
||||
* TeXDraw: (texdraw). Drawing PostScript diagrams within TeX.
|
||||
* Web2c: (web2c). TeX, Metafont, and their companion programs.
|
||||
|
||||
DOS
|
||||
* Demacs: (demacs). GNU Emacs for DOS.
|
||||
* GNUish: (gnuish). GNU utilities for DOS.
|
||||
|
||||
Other things
|
||||
* Amd: (amdref). Filesystem automounter.
|
||||
* CMUCL: (cmu-user). CMU Common Lisp.
|
||||
* File headers: (filehdr). Bibliographic information for computer files.
|
||||
* GCP: (gcp). Game club protocol.
|
||||
* GIMP: (pdb). The GIMP procedural database.
|
||||
* HTML: (snafu). Hypertext Markup Language 2.0 specification.
|
||||
* Jargon: (jargon). The jargon file.
|
||||
* JED: (jed). JED editor documentation.
|
||||
* octave: (octave). Octave - A language for numerical computation.
|
||||
* Perl: (perl). Practical extraction and report language.
|
||||
* PRCS: (prcs). Project revision control system.
|
||||
* Screen: (screen). Virtual screen manager.
|
||||
* UMB C.S. Dept.: (csinfo). UMass/Boston Computer Science Dept. info.
|
||||
|
||||
Individual utilities
|
||||
* aclocal: (automake)Invoking aclocal. Generating aclocal.m4.
|
||||
* aid: (id-utils)aid invocation. Matching strings.
|
||||
* ar: (binutils)ar. Create/modify/extract archives.
|
||||
* at-pr: (gnats)at-pr. Bug report timely reminders.
|
||||
* automake: (automake). Making Makefile.in's.
|
||||
* autoreconf: (autoconf)Invoking autoreconf. Remake multiple configure's.
|
||||
* autoscan: (autoconf)Invoking autoscan. Automate initial configure.in.
|
||||
* awk: (gawk)Invoking gawk. Text processing and scanning.
|
||||
* basename: (sh-utils)basename invocation. Strip directory and suffix.
|
||||
* bibtex: (web2c)BibTeX invocation. Maintaining bibliographies.
|
||||
* c++filt: (binutils)c++filt. Demangle C++ symbols.
|
||||
* cat: (textutils)cat invocation. Concatenate and write files.
|
||||
* chgrp: (fileutils)chgrp invocation. Change file groups.
|
||||
* chmod: (fileutils)chmod invocation. Change file permissions.
|
||||
* chown: (fileutils)chown invocation. Change file owners/groups.
|
||||
* chroot: (sh-utils)chroot invocation. Specify the root directory.
|
||||
* cksum: (textutils)cksum invocation. Print POSIX CRC checksum.
|
||||
* cmp: (diff)Invoking cmp. Character-by-character diff.
|
||||
* comm: (textutils)comm invocation. Compare sorted files by line.
|
||||
* cp: (fileutils)cp invocation. Copy files.
|
||||
* csplit: (textutils)csplit invocation. Split by context.
|
||||
* cut: (textutils)cut invocation. Print selected parts of lines.
|
||||
* date: (sh-utils)date invocation. Print/set system date and time.
|
||||
* dd: (fileutils)dd invocation. Copy and convert a file.
|
||||
* df: (fileutils)df invocation. Report filesystem disk usage.
|
||||
* diff3: (diff)Invoking diff3. Three-way diff.
|
||||
* dir: (fileutils)dir invocation. List directories briefly.
|
||||
* dircolors: (fileutils)dircolors invocation. Color setup for ls.
|
||||
* dirname: (sh-utils)dirname invocation. Strip non-directory suffix.
|
||||
* dmp: (web2c)Dmp invocation. Troff->MPX (MetaPost pictures).
|
||||
* du: (fileutils)du invocation. Report on disk usage.
|
||||
* dvicopy: (web2c)DVIcopy invocation. Virtual font expansion
|
||||
* dvitomp: (web2c)DVItoMP invocation. DVI to MPX (MetaPost pictures).
|
||||
* dvitype: (web2c)DVItype invocation. DVI to human-readable text.
|
||||
* echo: (sh-utils)echo invocation. Print a line of text.
|
||||
* edit-pr: (gnats)Invoking edit-pr. Changing bugs.
|
||||
* eid: (id-utils)eid invocation. Invoking an editor on matches.
|
||||
* emacsclient: (emacs)Emacs Server. Connecting to a running Emacs.
|
||||
* emacsserver: (emacs)Emacs Server. Connecting to a running Emacs.
|
||||
* env: (sh-utils)env invocation. Modify the environment.
|
||||
* etags: (emacs)Create Tags Table. Creating a TAGS table.
|
||||
* expand: (textutils)expand invocation. Convert tabs to spaces.
|
||||
* expr: (sh-utils)expr invocation. Evaluate expressions.
|
||||
* factor: (sh-utils)factor invocation. Print prime factors
|
||||
* false: (sh-utils)false invocation. Do nothing, unsuccessfully.
|
||||
* fid: (id-utils)fid invocation. Listing a file's identifiers.
|
||||
* file-pr: (gnats)file-pr. Processing incoming traffic.
|
||||
* find: (find)Invoking find. Finding and acting on files.
|
||||
* fmt: (textutils)fmt invocation. Reformat paragraph text.
|
||||
* fold: (textutils)fold invocation. Wrap long input lines.
|
||||
* g++: (gcc)Invoking G++. The GNU C++ compiler.
|
||||
* gcal2txt: (gcal)Invoking gcal2txt. Calendar resource to text file.
|
||||
* gettextize: (gettext)gettextize Invocation. Prepare a package for gettext.
|
||||
* gftodvi: (web2c)GFtoDVI invocation. Generic font proofsheets.
|
||||
* gftopk: (web2c)GFtoPK invocation. Generic to packed fonts.
|
||||
* gftype: (web2c)GFtype invocation. GF to human-readable text.
|
||||
* gid: (id-utils)gid invocation. Listing all matching lines.
|
||||
* git: (git). GNU interactive tools.
|
||||
* groups: (sh-utils)groups invocation. Print group names a user is in.
|
||||
* gunzip: (gzip)Overview. Decompression.
|
||||
* head: (textutils)head invocation. Output the first part of files.
|
||||
* hostname: (sh-utils)hostname invocation. Print or set system name.
|
||||
* id: (sh-utils)id invocation. Print real/effective uid/gid.
|
||||
* idx: (id-utils)idx invocation. Testing mkid scanners.
|
||||
* ifnames: (autoconf)Invoking ifnames. List conditionals in source.
|
||||
* iid: (id-utils)iid invocation. Interactive complex queries.
|
||||
* inimf: (web2c)inimf invocation. Initial Metafont.
|
||||
* inimp: (web2c)inimp invocation. Initial MetaPost.
|
||||
* initex: (web2c)initex invocation. Initial TeX.
|
||||
* install: (fileutils)install invocation. Copy and change attributes.
|
||||
* join: (textutils)join invocation. Join lines on a common field.
|
||||
* kpsewhich: (kpathsea)Invoking kpsewhich. TeX file searching.
|
||||
* lid: (id-utils)lid invocation. Matching identifier patterns.
|
||||
* ln: (fileutils)ln invocation. Make links between files.
|
||||
* locate: (find)Invoking locate. Finding files in a database.
|
||||
* logname: (sh-utils)logname invocation. Print current login name.
|
||||
* ls: (fileutils)ls invocation. List directory contents.
|
||||
* makempx: (web2c)MakeMPX invocation. MetaPost label typesetting.
|
||||
* maketexmf: (kpathsea)MakeTeX scripts. MF source generation.
|
||||
* maketexpk: (kpathsea)MakeTeX scripts. PK bitmap generation.
|
||||
* maketextex: (kpathsea)MakeTeX scripts. TeX source generation.
|
||||
* maketextfm: (kpathsea)MakeTeX scripts. TeX font metric generation.
|
||||
* md5sum: (textutils)md5sum invocation. Print or check message-digests.
|
||||
* mf: (web2c)mf invocation. Creating typeface families.
|
||||
* mft: (web2c)MFT invocation. Prettyprinting Metafont source.
|
||||
* mkdir: (fileutils)mkdir invocation. Create directories.
|
||||
* mkfifo: (fileutils)mkfifo invocation. Create FIFOs: (named pipes).
|
||||
* mkid: (id-utils)mkid invocation. Creating an ID database.
|
||||
* mknod: (fileutils)mknod invocation. Create special files.
|
||||
* mp: (web2c)mp invocation. Creating technical diagrams.
|
||||
* mpto: (web2c)MPto invocation. MetaPost label extraction.
|
||||
* msgfmt: (gettext)msgfmt Invocation. Make MO files out of PO files.
|
||||
* msgmerge: (gettext)msgmerge Invocation. Update two PO files into one.
|
||||
* mv: (fileutils)mv invocation. Rename files.
|
||||
* newer: (web2c)Newer invocation. Compare modification times.
|
||||
* nice: (sh-utils)nice invocation. Modify scheduling priority.
|
||||
* nl: (textutils)nl invocation. Number lines and write files.
|
||||
* nlmconv: (binutils)nlmconv. Convert object to NetWare LM.
|
||||
* nm: (binutils)nm. List symbols in object files.
|
||||
* nohup: (sh-utils)nohup invocation. Immunize to hangups.
|
||||
* objcopy: (binutils)objcopy. Copy/translate object files.
|
||||
* objdump: (binutils)objdump. Display info from object files.
|
||||
* od: (textutils)od invocation. Dump files in octal, etc.
|
||||
* paste: (textutils)paste invocation. Merge lines of files.
|
||||
* patch: (diff)Invoking patch. Automatically applying diffs.
|
||||
* patgen: (web2c)Patgen invocation. Creating hyphenation patterns.
|
||||
* pathchk: (sh-utils)pathchk invocation. Check file name portability.
|
||||
* pid: (id-utils)pid invocation. Looking up filenames.
|
||||
* pktogf: (web2c)PKtoGF invocation. Packed to generic fonts.
|
||||
* pktype: (web2c)PKtype invocation. PK to human-readable text.
|
||||
* pltotf: (web2c)PLtoTF invocation. Property list to TFM.
|
||||
* pooltype: (web2c)Pooltype invocation. Display WEB pool files.
|
||||
* pr-addr: (gnats)pr-addr. Bug report address retrieval.
|
||||
* pr-edit: (gnats)pr-edit. The edit-pr driver.
|
||||
* pr: (textutils)pr invocation. Paginate or columnate files.
|
||||
* printenv: (sh-utils)printenv invocation. Print environment variables.
|
||||
* printf: (sh-utils)printf invocation. Format and print data.
|
||||
* pwd: (sh-utils)pwd invocation. Print working directory.
|
||||
* query-pr: (gnats)Invoking query-pr. Bug searching/reporting.
|
||||
* queue-pr: (gnats)queue-pr. Handling incoming traffic.
|
||||
* ranlib: (binutils)ranlib. Index archive file contents.
|
||||
* rm: (fileutils)rm invocation. Remove files.
|
||||
* rmdir: (fileutils)rmdir invocation. Remove empty directories.
|
||||
* sdiff: (diff)Invoking sdiff. Interactively merge files.
|
||||
* send-pr: (gnats)Invoking send-pr. Submitting bugs.
|
||||
* seq: (sh-utils)seq invocation. Print numeric sequences
|
||||
* shar: (sharutils)shar invocation. Create shell archive.
|
||||
* size: (binutils)size. List object file section sizes.
|
||||
* sleep: (sh-utils)sleep invocation. Delay for a specified time.
|
||||
* sort: (textutils)sort invocation. Sort text files.
|
||||
* split: (textutils)split invocation. Split into fixed-size pieces.
|
||||
* strings: (binutils)strings. List printable strings.
|
||||
* strip: (binutils)strip. Discard symbols.
|
||||
* stty: (sh-utils)stty invocation. Print/change terminal settings.
|
||||
* su: (sh-utils)su invocation. Modify user and group id.
|
||||
* sum: (textutils)sum invocation. Print traditional checksum.
|
||||
* sync: (fileutils)sync invocation. Synchronize memory and disk.
|
||||
* tabs: (tput)Invoking tabs. Tab settings.
|
||||
* tac: (textutils)tac invocation. Reverse files.
|
||||
* tail: (textutils)tail invocation. Output the last part of files.
|
||||
* tangle: (web2c)Tangle invocation. WEB to Pascal.
|
||||
* tcal: (gcal)Invoking tcal. Run Gcal with tomorrow's date.
|
||||
* tee: (sh-utils)tee invocation. Redirect to multiple files.
|
||||
* test: (sh-utils)test invocation. File/string tests.
|
||||
* tex: (web2c)tex invocation. Typesetting.
|
||||
* tftopl: (web2c)TFtoPL invocation. TFM -> property list.
|
||||
* touch: (fileutils)touch invocation. Change file timestamps.
|
||||
* tput: (tput)Invoking tput. Termcap in shell scripts.
|
||||
* tr: (textutils)tr invocation. Translate characters.
|
||||
* true: (sh-utils)true invocation. Do nothing, successfully.
|
||||
* tty: (sh-utils)tty invocation. Print terminal name.
|
||||
* txt2gcal: (gcal)Invoking txt2gcal. Calendar text to resource file.
|
||||
* uname: (sh-utils)uname invocation. Print system information.
|
||||
* unexpand: (textutils)unexpand invocation. Convert spaces to tabs.
|
||||
* uniq: (textutils)uniq invocation. Uniqify files.
|
||||
* unshar: (sharutils)unshar invocation. Extract from shell archive.
|
||||
* updatedb: (find)Invoking updatedb. Building the locate database.
|
||||
* users: (sh-utils)users invocation. Print current user names.
|
||||
* vdir: (fileutils)vdir invocation. List directories verbosely.
|
||||
* vftovp: (web2c)VFtoVP invocation. Virtual font -> virtual pl.
|
||||
* view-pr: (gnats)Invoking view-pr. Showing bug reports.
|
||||
* virmf: (web2c)virmf invocation. Virgin Metafont.
|
||||
* virmp: (web2c)virmp invocation. Virgin MetaPost.
|
||||
* virtex: (web2c)virtex invocation. Virgin TeX.
|
||||
* vptovf: (web2c)VPtoVF invocation. Virtual pl -> virtual font.
|
||||
* wc: (textutils)wc invocation. Byte, word, and line counts.
|
||||
* weave: (web2c)Weave invocation. WEB to TeX.
|
||||
* who: (sh-utils)who invocation. Print who is logged in.
|
||||
* whoami: (sh-utils)whoami invocation. Print effective user id.
|
||||
* xargs: (find)Invoking xargs. Operating on many files.
|
||||
* xgettext: (gettext)xgettext Invocation. Extract strings into a PO file.
|
||||
* yes: (sh-utils)yes invocation. Print a string indefinitely.
|
||||
* zcat: (gzip)Overview. Decompression to stdout.
|
|
@ -1,67 +0,0 @@
|
|||
info
|
||||
--
|
||||
intro
|
||||
send-pr
|
||||
README
|
||||
COPYING
|
||||
COPYING.LIB
|
||||
--
|
||||
gcc
|
||||
g++
|
||||
reno-1
|
||||
cpp
|
||||
--
|
||||
gdb
|
||||
gdbint
|
||||
stabs
|
||||
--
|
||||
binutils
|
||||
ld
|
||||
as
|
||||
--
|
||||
dejagnu
|
||||
--
|
||||
make
|
||||
flex
|
||||
bison
|
||||
byacc
|
||||
gperf
|
||||
gprof
|
||||
--
|
||||
libc
|
||||
libg++
|
||||
iostream
|
||||
libm
|
||||
--
|
||||
bfd
|
||||
readline
|
||||
libiberty
|
||||
regex
|
||||
termcap
|
||||
--
|
||||
emacs
|
||||
elisp
|
||||
ange-ftp
|
||||
calc
|
||||
calendar
|
||||
cl
|
||||
forms
|
||||
gnus
|
||||
vip
|
||||
vm
|
||||
--
|
||||
ispell
|
||||
diff
|
||||
patch
|
||||
wdiff
|
||||
m4
|
||||
--
|
||||
texinfo
|
||||
makeinfo
|
||||
--
|
||||
autoconf
|
||||
configure
|
||||
cfg-paper
|
||||
--
|
||||
standards
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
## Makefile.am for texinfo/emacs.
|
||||
## $Id: Makefile.am,v 1.1.1.2 1998/03/24 18:20:38 law Exp $
|
||||
## Run automake in .. to produce Makefile.in from this.
|
||||
|
||||
info_TEXINFOS = info-stnd.texi info.texi texinfo.txi
|
||||
|
||||
# Use the programs built in our distribution.
|
||||
MAKEINFO = ../makeinfo/makeinfo
|
||||
INSTALL_INFO = ../util/install-info
|
||||
|
||||
# Include our texinfo.tex, not Automake's.
|
||||
EXTRA_DIST = macro.texi userdoc.texi epsf.tex texinfo.tex
|
||||
|
||||
# We try to discover this via configure just to give a better help message.
|
||||
TEXMF = @TEXMF@
|
||||
|
||||
install-data-local:
|
||||
@echo "WARNING: You must install texinfo.tex and epsf.tex manually,"
|
||||
@echo "WARNING: perhaps in $(TEXMF)/tex/texinfo/"
|
||||
@echo "WARNING: and $(TEXMF)/tex/generic/dvips/ respectively."
|
||||
@echo "WARNING: See doc/README for some considerations."
|
||||
|
||||
# Do not create info files for distribution.
|
||||
dist-info:
|
||||
|
||||
# Do not try to build the info files in $(srcdir),
|
||||
# since we don't distribute them.
|
||||
.texi.info:
|
||||
$(MAKEINFO) -I$(srcdir) `echo $< | sed 's,.*/,,'`
|
||||
texinfo: $(srcdir)/texinfo.txi
|
||||
$(MAKEINFO) -I$(srcdir) texinfo.txi
|
||||
|
||||
# Similarly, Do not try to install the info files from $(srcdir).
|
||||
install-info-am: $(INFO_DEPS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(infodir)
|
||||
@for file in $(INFO_DEPS); do \
|
||||
d=.; \
|
||||
for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
|
||||
if test -f $$d/$$ifile; then \
|
||||
echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
|
||||
$(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
|
||||
else : ; fi; \
|
||||
done; \
|
||||
done
|
||||
@$(POST_INSTALL)
|
||||
@if $(SHELL) -c '$(INSTALL_INFO) --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
|
||||
for file in $(INFO_DEPS); do \
|
||||
echo " $(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/$$file";\
|
||||
$(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/$$file || :;\
|
||||
done; \
|
||||
else : ; fi
|
||||
|
||||
|
||||
# Remove the info files at make distclean.
|
||||
distclean-aminfo:
|
||||
rm -f texinfo texinfo-* info*.info*
|
|
@ -1,336 +0,0 @@
|
|||
# Makefile.in generated automatically by automake 1.3 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DISTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
CATALOGS = @CATALOGS@
|
||||
CATOBJEXT = @CATOBJEXT@
|
||||
CC = @CC@
|
||||
DATADIRNAME = @DATADIRNAME@
|
||||
EXEEXT = @EXEEXT@
|
||||
GENCAT = @GENCAT@
|
||||
GMOFILES = @GMOFILES@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GT_NO = @GT_NO@
|
||||
GT_YES = @GT_YES@
|
||||
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTOBJEXT = @INSTOBJEXT@
|
||||
INTLDEPS = @INTLDEPS@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTLOBJS = @INTLOBJS@
|
||||
MAINT = @MAINT@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
PACKAGE = @PACKAGE@
|
||||
POFILES = @POFILES@
|
||||
POSUB = @POSUB@
|
||||
RANLIB = @RANLIB@
|
||||
TERMLIBS = @TERMLIBS@
|
||||
TEXCONFIG = @TEXCONFIG@
|
||||
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
l = @l@
|
||||
|
||||
info_TEXINFOS = info-stnd.texi info.texi texinfo.txi
|
||||
|
||||
# Use the programs built in our distribution.
|
||||
MAKEINFO = ../makeinfo/makeinfo
|
||||
INSTALL_INFO = ../util/install-info
|
||||
|
||||
# Include our texinfo.tex, not Automake's.
|
||||
EXTRA_DIST = macro.texi userdoc.texi epsf.tex texinfo.tex
|
||||
|
||||
# We try to discover this via configure just to give a better help message.
|
||||
TEXMF = @TEXMF@
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
TEXI2DVI = texi2dvi
|
||||
TEXINFO_TEX = $(top_srcdir)/../texinfo.tex
|
||||
INFO_DEPS = info-stnd.info info.info texinfo
|
||||
DVIS = info-stnd.dvi info.dvi texinfo.dvi
|
||||
TEXINFOS = info-stnd.texi info.texi texinfo.txi
|
||||
DIST_COMMON = README $(info_TEXINFOS) Makefile.am Makefile.in \
|
||||
texinfo.tex
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP = --best
|
||||
all: Makefile $(INFO_DEPS)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .dvi .info .ps .texi .texinfo .txi
|
||||
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps doc/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
info-stnd.info: info-stnd.texi
|
||||
info-stnd.dvi: info-stnd.texi
|
||||
|
||||
|
||||
info.info: info.texi $(info_TEXINFOS)
|
||||
info.dvi: info.texi $(info_TEXINFOS)
|
||||
|
||||
|
||||
texinfo: texinfo.txi
|
||||
texinfo.dvi: texinfo.txi
|
||||
|
||||
|
||||
DVIPS = dvips
|
||||
|
||||
.texi.dvi:
|
||||
TEXINPUTS=$(top_srcdir)/..:$$TEXINPUTS \
|
||||
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||
|
||||
.texi:
|
||||
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||
cd $(srcdir) \
|
||||
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
|
||||
|
||||
.texinfo.info:
|
||||
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||
cd $(srcdir) \
|
||||
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
|
||||
|
||||
.texinfo:
|
||||
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||
cd $(srcdir) \
|
||||
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
|
||||
|
||||
.texinfo.dvi:
|
||||
TEXINPUTS=$(top_srcdir)/..:$$TEXINPUTS \
|
||||
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||
|
||||
.txi.info:
|
||||
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||
cd $(srcdir) \
|
||||
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
|
||||
|
||||
.txi.dvi:
|
||||
TEXINPUTS=$(top_srcdir)/..:$$TEXINPUTS \
|
||||
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||
|
||||
.txi:
|
||||
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||
cd $(srcdir) \
|
||||
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
|
||||
.dvi.ps:
|
||||
$(DVIPS) $< -o $@
|
||||
|
||||
uninstall-info:
|
||||
$(PRE_UNINSTALL)
|
||||
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
|
||||
ii=yes; \
|
||||
else ii=; fi; \
|
||||
for file in $(INFO_DEPS); do \
|
||||
test -z "$ii" \
|
||||
|| install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
|
||||
done
|
||||
@$(NORMAL_UNINSTALL)
|
||||
for file in $(INFO_DEPS); do \
|
||||
(cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
|
||||
done
|
||||
|
||||
mostlyclean-aminfo:
|
||||
-rm -f info-stnd.aux info-stnd.cp info-stnd.cps info-stnd.dvi \
|
||||
info-stnd.fn info-stnd.fns info-stnd.ky info-stnd.kys \
|
||||
info-stnd.ps info-stnd.log info-stnd.pg info-stnd.toc \
|
||||
info-stnd.tp info-stnd.tps info-stnd.vr info-stnd.vrs \
|
||||
info-stnd.op info-stnd.tr info-stnd.cv info-stnd.cn info.aux \
|
||||
info.cp info.cps info.dvi info.fn info.fns info.ky info.kys \
|
||||
info.ps info.log info.pg info.toc info.tp info.tps info.vr \
|
||||
info.vrs info.op info.tr info.cv info.cn texinfo.aux \
|
||||
texinfo.cp texinfo.cps texinfo.dvi texinfo.fn texinfo.fns \
|
||||
texinfo.ky texinfo.kys texinfo.ps texinfo.log texinfo.pg \
|
||||
texinfo.toc texinfo.tp texinfo.tps texinfo.vr texinfo.vrs \
|
||||
texinfo.op texinfo.tr texinfo.cv texinfo.cn
|
||||
|
||||
clean-aminfo:
|
||||
|
||||
distclean-aminfo:
|
||||
|
||||
maintainer-clean-aminfo:
|
||||
for i in $(INFO_DEPS); do \
|
||||
rm -f $$i; \
|
||||
if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
|
||||
rm -f $$i-[0-9]*; \
|
||||
fi; \
|
||||
done
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = doc
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file; \
|
||||
done
|
||||
$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
|
||||
info: $(INFO_DEPS)
|
||||
dvi: $(DVIS)
|
||||
check: all
|
||||
$(MAKE)
|
||||
installcheck:
|
||||
install-exec:
|
||||
@$(NORMAL_INSTALL)
|
||||
|
||||
install-data: install-info-am install-data-local
|
||||
@$(NORMAL_INSTALL)
|
||||
|
||||
install: install-exec install-data all
|
||||
@:
|
||||
|
||||
uninstall: uninstall-info
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(infodir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(DISTCLEANFILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
mostlyclean: mostlyclean-aminfo mostlyclean-generic
|
||||
|
||||
clean: clean-aminfo clean-generic mostlyclean
|
||||
|
||||
distclean: distclean-aminfo distclean-generic clean
|
||||
-rm -f config.status
|
||||
|
||||
maintainer-clean: maintainer-clean-aminfo maintainer-clean-generic \
|
||||
distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
.PHONY: install-info-am uninstall-info mostlyclean-aminfo \
|
||||
distclean-aminfo clean-aminfo maintainer-clean-aminfo tags distdir info \
|
||||
dvi installcheck install-exec install-data install uninstall all \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
install-data-local:
|
||||
@echo "WARNING: You must install texinfo.tex and epsf.tex manually,"
|
||||
@echo "WARNING: perhaps in $(TEXMF)/tex/texinfo/"
|
||||
@echo "WARNING: and $(TEXMF)/tex/generic/dvips/ respectively."
|
||||
@echo "WARNING: See doc/README for some considerations."
|
||||
|
||||
# Do not create info files for distribution.
|
||||
dist-info:
|
||||
|
||||
# Do not try to build the info files in $(srcdir),
|
||||
# since we don't distribute them.
|
||||
.texi.info:
|
||||
$(MAKEINFO) -I$(srcdir) `echo $< | sed 's,.*/,,'`
|
||||
texinfo: $(srcdir)/texinfo.txi
|
||||
$(MAKEINFO) -I$(srcdir) texinfo.txi
|
||||
|
||||
# Similarly, Do not try to install the info files from $(srcdir).
|
||||
install-info-am: $(INFO_DEPS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(infodir)
|
||||
@for file in $(INFO_DEPS); do \
|
||||
d=.; \
|
||||
for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
|
||||
if test -f $$d/$$ifile; then \
|
||||
echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
|
||||
$(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
|
||||
else : ; fi; \
|
||||
done; \
|
||||
done
|
||||
@$(POST_INSTALL)
|
||||
@if $(SHELL) -c '$(INSTALL_INFO) --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
|
||||
for file in $(INFO_DEPS); do \
|
||||
echo " $(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/$$file";\
|
||||
$(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/$$file || :;\
|
||||
done; \
|
||||
else : ; fi
|
||||
|
||||
# Remove the info files at make distclean.
|
||||
distclean-aminfo:
|
||||
rm -f texinfo texinfo-* info*.info*
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -1,27 +0,0 @@
|
|||
This directory contains documentation on the Texinfo system and the TeX
|
||||
sources needed to process Texinfo sources. (Use texi2dvi 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://www.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. If you have teTeX, you can find <texmf> by
|
||||
running:
|
||||
texconfig confall | grep \^TEXMF=
|
||||
(The configure script tries to do this for you.)
|
||||
|
||||
You can get the latest texinfo.tex from
|
||||
ftp://ftp.tug.org/tex/texinfo.tex
|
||||
ftp://ftp.cs.umb.edu/pub/tex/texinfo.tex
|
||||
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.
|
|
@ -1,546 +0,0 @@
|
|||
%%% ====================================================================
|
||||
%%% This file is freely redistributable and placed into the
|
||||
%%% public domain by Tomas Rokicki.
|
||||
%%% @TeX-file{
|
||||
%%% author = "Tom Rokicki",
|
||||
%%% version = "2.7k",
|
||||
%%% date = "19 July 1997",
|
||||
%%% time = "10:00:05 MDT",
|
||||
%%% filename = "epsf.tex",
|
||||
%%% address = "Tom Rokicki
|
||||
%%% Box 2081
|
||||
%%% Stanford, CA 94309
|
||||
%%% USA",
|
||||
%%% telephone = "+1 415 855 9989",
|
||||
%%% email = "rokicki@cs.stanford.edu (Internet)",
|
||||
%%% codetable = "ISO/ASCII",
|
||||
%%% keywords = "PostScript, TeX",
|
||||
%%% supported = "yes",
|
||||
%%% abstract = "This file contains macros to support the inclusion
|
||||
%%% of Encapsulated PostScript files in TeX documents.",
|
||||
%%% docstring = "This file contains TeX macros to include an
|
||||
%%% Encapsulated PostScript graphic. It works
|
||||
%%% by finding the bounding box comment,
|
||||
%%% calculating the correct scale values, and
|
||||
%%% inserting a vbox of the appropriate size at
|
||||
%%% the current position in the TeX document.
|
||||
%%%
|
||||
%%% To use, simply say
|
||||
%%%
|
||||
%%% \input epsf % somewhere early on in your TeX file
|
||||
%%%
|
||||
%%% % then where you want to insert a vbox for a figure:
|
||||
%%% \epsfbox{filename.ps}
|
||||
%%%
|
||||
%%% Alternatively, you can supply your own
|
||||
%%% bounding box by
|
||||
%%%
|
||||
%%% \epsfbox[0 0 30 50]{filename.ps}
|
||||
%%%
|
||||
%%% This will not read in the file, and will
|
||||
%%% instead use the bounding box you specify.
|
||||
%%%
|
||||
%%% The effect will be to typeset the figure as
|
||||
%%% a TeX box, at the point of your \epsfbox
|
||||
%%% command. By default, the graphic will have
|
||||
%%% its `natural' width (namely the width of
|
||||
%%% its bounding box, as described in
|
||||
%%% filename.ps). The TeX box will have depth
|
||||
%%% zero.
|
||||
%%%
|
||||
%%% You can enlarge or reduce the figure by
|
||||
%%% saying
|
||||
%%%
|
||||
%%% \epsfxsize=<dimen> \epsfbox{filename.ps}
|
||||
%%% or
|
||||
%%% \epsfysize=<dimen> \epsfbox{filename.ps}
|
||||
%%%
|
||||
%%% instead. Then the width of the TeX box will
|
||||
%%% be \epsfxsize and its height will be scaled
|
||||
%%% proportionately (or the height will be
|
||||
%%% \epsfysize and its width will be scaled
|
||||
%%% proportionately).
|
||||
%%%
|
||||
%%% The width (and height) is restored to zero
|
||||
%%% after each use, so \epsfxsize or \epsfysize
|
||||
%%% must be specified before EACH use of
|
||||
%%% \epsfbox.
|
||||
%%%
|
||||
%%% A more general facility for sizing is
|
||||
%%% available by defining the \epsfsize macro.
|
||||
%%% Normally you can redefine this macro to do
|
||||
%%% almost anything. The first parameter is
|
||||
%%% the natural x size of the PostScript
|
||||
%%% graphic, the second parameter is the
|
||||
%%% natural y size of the PostScript graphic.
|
||||
%%% It must return the xsize to use, or 0 if
|
||||
%%% natural scaling is to be used. Common uses
|
||||
%%% include:
|
||||
%%%
|
||||
%%% \epsfxsize % just leave the old value alone
|
||||
%%% 0pt % use the natural sizes
|
||||
%%% #1 % use the natural sizes
|
||||
%%% \hsize % scale to full width
|
||||
%%% 0.5#1 % scale to 50% of natural size
|
||||
%%% \ifnum #1>\hsize\hsize\else#1\fi
|
||||
%%% % smaller of natural, hsize
|
||||
%%%
|
||||
%%% If you want TeX to report the size of the
|
||||
%%% figure (as a message on your terminal when
|
||||
%%% it processes each figure), say
|
||||
%%% `\epsfverbosetrue'.
|
||||
%%%
|
||||
%%% If you only want to get the bounding box
|
||||
%%% extents, without producing any output boxes
|
||||
%%% or \special{}, then say
|
||||
%%% \epsfgetbb{filename}. The extents will be
|
||||
%%% saved in the macros \epsfllx \epsflly
|
||||
%%% \epsfurx \epsfury in PostScript units of
|
||||
%%% big points.
|
||||
%%%
|
||||
%%% Revision history:
|
||||
%%%
|
||||
%%% ---------------------------------------------
|
||||
%%% epsf.tex macro file:
|
||||
%%% Originally written by Tomas Rokicki of
|
||||
%%% Radical Eye Software, 29 Mar 1989.
|
||||
%%%
|
||||
%%% ---------------------------------------------
|
||||
%%% Revised by Don Knuth, 3 Jan 1990.
|
||||
%%%
|
||||
%%% ---------------------------------------------
|
||||
%%% Revised by Tomas Rokicki, 18 Jul 1990.
|
||||
%%% Accept bounding boxes with no space after
|
||||
%%% the colon.
|
||||
%%%
|
||||
%%% ---------------------------------------------
|
||||
%%% Revised by Nelson H. F. Beebe
|
||||
%%% <beebe@math.utah.edu>, 03 Dec 1991 [2.0].
|
||||
%%% Add version number and date typeout.
|
||||
%%%
|
||||
%%% Use \immediate\write16 instead of \message
|
||||
%%% to ensure output on new line.
|
||||
%%%
|
||||
%%% Handle nested EPS files.
|
||||
%%%
|
||||
%%% Handle %%BoundingBox: (atend) lines.
|
||||
%%%
|
||||
%%% Do not quit when blank lines are found.
|
||||
%%%
|
||||
%%% Add a few percents to remove generation of
|
||||
%%% spurious blank space.
|
||||
%%%
|
||||
%%% Move \special output to
|
||||
%%% \epsfspecial{filename} so that other macro
|
||||
%%% packages can input this one, then change
|
||||
%%% the definition of \epsfspecial to match
|
||||
%%% another DVI driver.
|
||||
%%%
|
||||
%%% Move size computation to \epsfsetsize which
|
||||
%%% can be called by the user; the verbose
|
||||
%%% output of the bounding box and scaled width
|
||||
%%% and height happens here.
|
||||
%%%
|
||||
%%% ---------------------------------------------
|
||||
%%% Revised by Nelson H. F. Beebe
|
||||
%%% <beebe@math.utah.edu>, 05 May 1992 [2.1].
|
||||
%%% Wrap \leavevmode\hbox{} around \vbox{} with
|
||||
%%% the \special so that \epsffile{} can be
|
||||
%%% used inside \begin{center}...\end{center}
|
||||
%%%
|
||||
%%% ---------------------------------------------
|
||||
%%% Revised by Nelson H. F. Beebe
|
||||
%%% <beebe@math.utah.edu>, 09 Dec 1992 [2.2].
|
||||
%%% Introduce \epsfshow{true,false} and
|
||||
%%% \epsfframe{true,false} macros; the latter
|
||||
%%% suppresses the insertion of the PostScript,
|
||||
%%% and instead just creates an empty box,
|
||||
%%% which may be handy for rapid prototyping.
|
||||
%%%
|
||||
%%% ---------------------------------------------
|
||||
%%% Revised by Nelson H. F. Beebe
|
||||
%%% <beebe@math.utah.edu>, 14 Dec 1992 [2.3].
|
||||
%%% Add \epsfshowfilename{true,false}. When
|
||||
%%% true, and \epsfshowfalse is specified, the
|
||||
%%% PostScript file name will be displayed
|
||||
%%% centered in the figure box.
|
||||
%%%
|
||||
%%% ---------------------------------------------
|
||||
%%% Revised by Nelson H. F. Beebe
|
||||
%%% <beebe@math.utah.edu>, 20 June 1993 [2.4].
|
||||
%%% Remove non-zero debug setting of \epsfframemargin,
|
||||
%%% and change margin handling to preserve EPS image
|
||||
%%% size and aspect ratio, so that the actual
|
||||
%%% box is \epsfxsize+\epsfframemargin wide by
|
||||
%%% \epsfysize+\epsfframemargin high.
|
||||
%%% Reduce output of \epsfshowfilenametrue to
|
||||
%%% just the bare file name.
|
||||
%%%
|
||||
%%% ---------------------------------------------
|
||||
%%% Revised by Nelson H. F. Beebe
|
||||
%%% <beebe@math.utah.edu>, 13 July 1993 [2.5].
|
||||
%%% Add \epsfframethickness for control of
|
||||
%%% \epsfframe frame lines.
|
||||
%%%
|
||||
%%% ---------------------------------------------
|
||||
%%% Revised by Nelson H. F. Beebe
|
||||
%%% <beebe@math.utah.edu>, 02 July 1996 [2.6]
|
||||
%%% Add missing initialization \epsfatendfalse;
|
||||
%%% the lack of this resulted in the wrong
|
||||
%%% BoundingBox being picked up, mea culpa, sigh...
|
||||
%%% ---------------------------------------------
|
||||
%%%
|
||||
%%% ---------------------------------------------
|
||||
%%% Revised by Nelson H. F. Beebe
|
||||
%%% <beebe@math.utah.edu>, 25 October 1996 [2.7]
|
||||
%%% Update to match changes in from dvips 5-600
|
||||
%%% distribution: new user-accessible macros:
|
||||
%%% \epsfclipon, \epsfclipoff, \epsfdrafton,
|
||||
%%% \epsfdraftoff, change \empty to \epsfempty.
|
||||
%%% ---------------------------------------------
|
||||
%%%
|
||||
%%% Modified to avoid verbosity, give help.
|
||||
%%% --kb@cs.umb.edu, for Texinfo.
|
||||
%%% }
|
||||
%%% ====================================================================
|
||||
%
|
||||
\ifx\epsfannounce\undefined \def\epsfannounce{\immediate\write16}\fi
|
||||
\epsfannounce{This is `epsf.tex' v2.7k <10 July 1997>}%
|
||||
%
|
||||
\newread\epsffilein % file to \read
|
||||
\newif\ifepsfatend % need to scan to LAST %%BoundingBox comment?
|
||||
\newif\ifepsfbbfound % success?
|
||||
\newif\ifepsfdraft % use draft mode?
|
||||
\newif\ifepsffileok % continue looking for the bounding box?
|
||||
\newif\ifepsfframe % frame the bounding box?
|
||||
\newif\ifepsfshow % show PostScript file, or just bounding box?
|
||||
\epsfshowtrue % default is to display PostScript file
|
||||
\newif\ifepsfshowfilename % show the file name if \epsfshowfalse specified?
|
||||
\newif\ifepsfverbose % report what you're making?
|
||||
\newdimen\epsfframemargin % margin between box and frame
|
||||
\newdimen\epsfframethickness % thickness of frame rules
|
||||
\newdimen\epsfrsize % vertical size before scaling
|
||||
\newdimen\epsftmp % register for arithmetic manipulation
|
||||
\newdimen\epsftsize % horizontal size before scaling
|
||||
\newdimen\epsfxsize % horizontal size after scaling
|
||||
\newdimen\epsfysize % vertical size after scaling
|
||||
\newdimen\pspoints % conversion factor
|
||||
%
|
||||
\pspoints = 1bp % Adobe points are `big'
|
||||
\epsfxsize = 0pt % default value, means `use natural size'
|
||||
\epsfysize = 0pt % ditto
|
||||
\epsfframemargin = 0pt % default value: frame box flush around picture
|
||||
\epsfframethickness = 0.4pt % TeX's default rule thickness
|
||||
%
|
||||
\def\epsfbox#1{\global\def\epsfllx{72}\global\def\epsflly{72}%
|
||||
\global\def\epsfurx{540}\global\def\epsfury{720}%
|
||||
\def\lbracket{[}\def\testit{#1}\ifx\testit\lbracket
|
||||
\let\next=\epsfgetlitbb\else\let\next=\epsfnormal\fi\next{#1}}%
|
||||
%
|
||||
% We use \epsfgetlitbb if the user specified an explicit bounding box,
|
||||
% and \epsfnormal otherwise. Because \epsfgetbb can be called
|
||||
% separately to retrieve the bounding box, we move the verbose
|
||||
% printing the bounding box extents and size on the terminal to
|
||||
% \epsfstatus. Therefore, when the user provided the bounding box,
|
||||
% \epsfgetbb will not be called, so we must call \epsfsetsize and
|
||||
% \epsfstatus ourselves.
|
||||
%
|
||||
\def\epsfgetlitbb#1#2 #3 #4 #5]#6{%
|
||||
\epsfgrab #2 #3 #4 #5 .\\%
|
||||
\epsfsetsize
|
||||
\epsfstatus{#6}%
|
||||
\epsfsetgraph{#6}%
|
||||
}%
|
||||
%
|
||||
\def\epsfnormal#1{%
|
||||
\epsfgetbb{#1}%
|
||||
\epsfsetgraph{#1}%
|
||||
}%
|
||||
%
|
||||
\newhelp\epsfnoopenhelp{The PostScript image file must be findable by
|
||||
TeX, i.e., somewhere in the TEXINPUTS (or equivalent) path.}%
|
||||
%
|
||||
\def\epsfgetbb#1{%
|
||||
%
|
||||
% The first thing we need to do is to open the
|
||||
% PostScript file, if possible.
|
||||
%
|
||||
\openin\epsffilein=#1
|
||||
\ifeof\epsffilein
|
||||
\errhelp = \epsfnoopenhelp
|
||||
\errmessage{Could not open file #1, ignoring it}%
|
||||
\else %process the file
|
||||
{% %start a group to contain catcode changes
|
||||
% Make all special characters, except space, to be of type
|
||||
% `other' so we process the file in almost verbatim mode
|
||||
% (TeXbook, p. 344).
|
||||
\chardef\other=12
|
||||
\def\do##1{\catcode`##1=\other}%
|
||||
\dospecials
|
||||
\catcode`\ =10
|
||||
\epsffileoktrue %true while we are looping
|
||||
\epsfatendfalse %[02-Jul-1996]: add forgotten initialization
|
||||
\loop %reading lines from the EPS file
|
||||
\read\epsffilein to \epsffileline
|
||||
\ifeof\epsffilein %then no more input
|
||||
\epsffileokfalse %so set completion flag
|
||||
\else %otherwise process one line
|
||||
\expandafter\epsfaux\epsffileline:. \\%
|
||||
\fi
|
||||
\ifepsffileok
|
||||
\repeat
|
||||
\ifepsfbbfound
|
||||
\else
|
||||
\ifepsfverbose
|
||||
\immediate\write16{No BoundingBox comment found in %
|
||||
file #1; using defaults}%
|
||||
\fi
|
||||
\fi
|
||||
}% %end catcode changes
|
||||
\closein\epsffilein
|
||||
\fi %end of file processing
|
||||
\epsfsetsize %compute size parameters
|
||||
\epsfstatus{#1}%
|
||||
}%
|
||||
%
|
||||
% Clipping control:
|
||||
\def\epsfclipon{\def\epsfclipstring{ clip}}%
|
||||
\def\epsfclipoff{\def\epsfclipstring{\ifepsfdraft\space clip\fi}}%
|
||||
\epsfclipoff % default for dvips is OFF
|
||||
%
|
||||
% The special that is emitted by \epsfsetgraph comes from this macro.
|
||||
% It is defined separately to allow easy customization by other
|
||||
% packages that first \input epsf.tex, then redefine \epsfspecial.
|
||||
% This macro is invoked in the lower-left corner of a box of the
|
||||
% width and height determined from the arguments to \epsffile, or
|
||||
% from the %%BoundingBox in the EPS file itself.
|
||||
%
|
||||
% This version is for dvips:
|
||||
\def\epsfspecial#1{%
|
||||
\epsftmp=10\epsfxsize
|
||||
\divide\epsftmp\pspoints
|
||||
\ifnum\epsfrsize=0\relax
|
||||
\special{PSfile=\ifepsfdraft psdraft.ps\else#1\fi\space
|
||||
llx=\epsfllx\space
|
||||
lly=\epsflly\space
|
||||
urx=\epsfurx\space
|
||||
ury=\epsfury\space
|
||||
rwi=\number\epsftmp
|
||||
\epsfclipstring
|
||||
}%
|
||||
\else
|
||||
\epsfrsize=10\epsfysize
|
||||
\divide\epsfrsize\pspoints
|
||||
\special{PSfile=\ifepsfdraft psdraft.ps\else#1\fi\space
|
||||
llx=\epsfllx\space
|
||||
lly=\epsflly\space
|
||||
urx=\epsfurx\space
|
||||
ury=\epsfury\space
|
||||
rwi=\number\epsftmp
|
||||
rhi=\number\epsfrsize
|
||||
\epsfclipstring
|
||||
}%
|
||||
\fi
|
||||
}%
|
||||
%
|
||||
% \epsfframe macro adapted from the TeXbook, exercise 21.3, p. 223, 331.
|
||||
% but modified to set the box width to the natural width, rather
|
||||
% than the line width, and to include space for margins and rules
|
||||
\def\epsfframe#1%
|
||||
{%
|
||||
\leavevmode % so we can put this inside
|
||||
% a centered environment
|
||||
\setbox0 = \hbox{#1}%
|
||||
\dimen0 = \wd0 % natural width of argument
|
||||
\advance \dimen0 by 2\epsfframemargin % plus width of 2 margins
|
||||
\advance \dimen0 by 2\epsfframethickness % plus width of 2 rule lines
|
||||
\vbox
|
||||
{%
|
||||
\hrule height \epsfframethickness depth 0pt
|
||||
\hbox to \dimen0
|
||||
{%
|
||||
\hss
|
||||
\vrule width \epsfframethickness
|
||||
\kern \epsfframemargin
|
||||
\vbox {\kern \epsfframemargin \box0 \kern \epsfframemargin }%
|
||||
\kern \epsfframemargin
|
||||
\vrule width \epsfframethickness
|
||||
\hss
|
||||
}% end hbox
|
||||
\hrule height 0pt depth \epsfframethickness
|
||||
}% end vbox
|
||||
}%
|
||||
%
|
||||
\def\epsfsetgraph#1%
|
||||
{%
|
||||
%
|
||||
% Make the vbox and stick in a \special that the DVI driver can
|
||||
% parse. \vfil and \hfil are used to place the \special origin at
|
||||
% the lower-left corner of the vbox. \epsfspecial can be redefined
|
||||
% to produce alternate \special syntaxes.
|
||||
%
|
||||
\leavevmode
|
||||
\hbox{% so we can put this in \begin{center}...\end{center}
|
||||
\ifepsfframe\expandafter\epsfframe\fi
|
||||
{\vbox to\epsfysize
|
||||
{%
|
||||
\ifepsfshow
|
||||
% output \special{} at lower-left corner of figure box
|
||||
\vfil
|
||||
\hbox to \epsfxsize{\epsfspecial{#1}\hfil}%
|
||||
\else
|
||||
\vfil
|
||||
\hbox to\epsfxsize{%
|
||||
\hss
|
||||
\ifepsfshowfilename
|
||||
{%
|
||||
\epsfframemargin=3pt % local change of margin
|
||||
\epsfframe{{\tt #1}}%
|
||||
}%
|
||||
\fi
|
||||
\hss
|
||||
}%
|
||||
\vfil
|
||||
\fi
|
||||
}%
|
||||
}}%
|
||||
%
|
||||
% Reset \epsfxsize and \epsfysize, as documented above.
|
||||
%
|
||||
\global\epsfxsize=0pt
|
||||
\global\epsfysize=0pt
|
||||
}%
|
||||
%
|
||||
% Now we have to calculate the scale and offset values to use.
|
||||
% First we compute the natural sizes.
|
||||
%
|
||||
\def\epsfsetsize
|
||||
{%
|
||||
\epsfrsize=\epsfury\pspoints
|
||||
\advance\epsfrsize by-\epsflly\pspoints
|
||||
\epsftsize=\epsfurx\pspoints
|
||||
\advance\epsftsize by-\epsfllx\pspoints
|
||||
%
|
||||
% If `epsfxsize' is 0, we default to the natural size of the picture.
|
||||
% Otherwise we scale the graph to be \epsfxsize wide.
|
||||
%
|
||||
\epsfxsize=\epsfsize{\epsftsize}{\epsfrsize}%
|
||||
\ifnum \epsfxsize=0
|
||||
\ifnum \epsfysize=0
|
||||
\epsfxsize=\epsftsize
|
||||
\epsfysize=\epsfrsize
|
||||
\epsfrsize=0pt
|
||||
%
|
||||
% We have a sticky problem here: TeX doesn't do floating point arithmetic!
|
||||
% Our goal is to compute y = rx/t. The following loop does this reasonably
|
||||
% fast, with an error of at most about 16 sp (about 1/4000 pt).
|
||||
%
|
||||
\else
|
||||
\epsftmp=\epsftsize \divide\epsftmp\epsfrsize
|
||||
\epsfxsize=\epsfysize \multiply\epsfxsize\epsftmp
|
||||
\multiply\epsftmp\epsfrsize \advance\epsftsize-\epsftmp
|
||||
\epsftmp=\epsfysize
|
||||
\loop \advance\epsftsize\epsftsize \divide\epsftmp 2
|
||||
\ifnum \epsftmp>0
|
||||
\ifnum \epsftsize<\epsfrsize
|
||||
\else
|
||||
\advance\epsftsize-\epsfrsize \advance\epsfxsize\epsftmp
|
||||
\fi
|
||||
\repeat
|
||||
\epsfrsize=0pt
|
||||
\fi
|
||||
\else
|
||||
\ifnum \epsfysize=0
|
||||
\epsftmp=\epsfrsize \divide\epsftmp\epsftsize
|
||||
\epsfysize=\epsfxsize \multiply\epsfysize\epsftmp
|
||||
\multiply\epsftmp\epsftsize \advance\epsfrsize-\epsftmp
|
||||
\epsftmp=\epsfxsize
|
||||
\loop \advance\epsfrsize\epsfrsize \divide\epsftmp 2
|
||||
\ifnum \epsftmp>0
|
||||
\ifnum \epsfrsize<\epsftsize
|
||||
\else
|
||||
\advance\epsfrsize-\epsftsize \advance\epsfysize\epsftmp
|
||||
\fi
|
||||
\repeat
|
||||
\epsfrsize=0pt
|
||||
\else
|
||||
\epsfrsize=\epsfysize
|
||||
\fi
|
||||
\fi
|
||||
}%
|
||||
%
|
||||
% Issue some status messages if the user requested them
|
||||
%
|
||||
\def\epsfstatus#1{% arg = filename
|
||||
\ifepsfverbose
|
||||
\immediate\write16{#1: BoundingBox:
|
||||
llx = \epsfllx\space lly = \epsflly\space
|
||||
urx = \epsfurx\space ury = \epsfury\space}%
|
||||
\immediate\write16{#1: scaled width = \the\epsfxsize\space
|
||||
scaled height = \the\epsfysize}%
|
||||
\fi
|
||||
}%
|
||||
%
|
||||
% We still need to define the tricky \epsfaux macro. This requires
|
||||
% a couple of magic constants for comparison purposes.
|
||||
%
|
||||
{\catcode`\%=12 \global\let\epsfpercent=%\global\def\epsfbblit{%BoundingBox}}%
|
||||
\global\def\epsfatend{(atend)}%
|
||||
%
|
||||
% So we're ready to check for `%BoundingBox:' and to grab the
|
||||
% values if they are found.
|
||||
%
|
||||
% If we find a line
|
||||
%
|
||||
% %%BoundingBox: (atend)
|
||||
%
|
||||
% then we ignore it, but set a flag to force parsing all of the
|
||||
% file, so the last %%BoundingBox parsed will be the one used. This
|
||||
% is necessary, because EPS files can themselves contain other EPS
|
||||
% files with their own %%BoundingBox comments.
|
||||
%
|
||||
% If we find a line
|
||||
%
|
||||
% %%BoundingBox: llx lly urx ury
|
||||
%
|
||||
% then we save the 4 values in \epsfllx, \epsflly, \epsfurx, \epsfury.
|
||||
% Then, if we have not previously parsed an (atend), we flag completion
|
||||
% and can stop reading the file. Otherwise, we must keep on reading
|
||||
% to end of file so that we find the values on the LAST %%BoundingBox.
|
||||
\long\def\epsfaux#1#2:#3\\%
|
||||
{%
|
||||
\def\testit{#2}% % save second character up to just before colon
|
||||
\ifx#1\epsfpercent % then first char is percent (quick test)
|
||||
\ifx\testit\epsfbblit % then (slow test) we have %%BoundingBox
|
||||
\epsfgrab #3 . . . \\%
|
||||
\ifx\epsfllx\epsfatend % then ignore %%BoundingBox: (atend)
|
||||
\global\epsfatendtrue
|
||||
\else % else found %%BoundingBox: llx lly urx ury
|
||||
\ifepsfatend % then keep parsing ALL %%BoundingBox lines
|
||||
\else % else stop after first one parsed
|
||||
\epsffileokfalse
|
||||
\fi
|
||||
\global\epsfbbfoundtrue
|
||||
\fi
|
||||
\fi
|
||||
\fi
|
||||
}%
|
||||
%
|
||||
% Here we grab the values and stuff them in the appropriate definitions.
|
||||
%
|
||||
\def\epsfempty{}%
|
||||
\def\epsfgrab #1 #2 #3 #4 #5\\{%
|
||||
\global\def\epsfllx{#1}\ifx\epsfllx\epsfempty
|
||||
\epsfgrab #2 #3 #4 #5 .\\\else
|
||||
\global\def\epsflly{#2}%
|
||||
\global\def\epsfurx{#3}\global\def\epsfury{#4}\fi
|
||||
}%
|
||||
%
|
||||
% We default the epsfsize macro.
|
||||
%
|
||||
\def\epsfsize#1#2{\epsfxsize}%
|
||||
%
|
||||
% Finally, another definition for compatibility with older macros.
|
||||
%
|
||||
\let\epsffile=\epsfbox
|
||||
\endinput
|
File diff suppressed because it is too large
Load diff
|
@ -1,911 +0,0 @@
|
|||
\input texinfo @c -*-texinfo-*-
|
||||
@comment %**start of header
|
||||
@setfilename info.info
|
||||
@settitle Info 1.0
|
||||
@comment %**end of header
|
||||
@comment $Id: info.texi,v 1.1.1.2 1998/03/24 18:20:37 law 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 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).
|
||||
|
||||
@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.
|
||||
@end ifinfo
|
||||
|
||||
@titlepage
|
||||
@title Info
|
||||
@subtitle The online, menu-driven GNU documentation system
|
||||
@author Brian Fox
|
||||
@page
|
||||
@vskip 0pt plus 1filll
|
||||
Copyright @copyright{} 1989, 1992, 1993, 1996, 1997 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.
|
||||
@end titlepage
|
||||
|
||||
@ifinfo
|
||||
@node Top, Getting Started, , (dir)
|
||||
@top Info: An Introduction
|
||||
|
||||
Info is a program for reading documentation, which you are using now.
|
||||
|
||||
To learn how to use Info, type the command @kbd{h}. It brings you
|
||||
to a programmed instruction sequence.
|
||||
|
||||
@c Need to make sure that `Info-help' goes to the right node,
|
||||
@c which is the first node of the first chapter. (It should.)
|
||||
@c (Info-find-node "info"
|
||||
@c (if (< (window-height) 23)
|
||||
@c "Help-Small-Screen"
|
||||
@c "Help")))
|
||||
|
||||
To learn advanced Info commands, type @kbd{n} twice. This brings you to
|
||||
@cite{Info for Experts}, skipping over the `Getting Started' chapter.
|
||||
@end ifinfo
|
||||
|
||||
@menu
|
||||
* Getting Started:: Getting started using an Info reader.
|
||||
* Advanced Info:: Advanced commands within Info.
|
||||
* Create an Info File:: How to make your own Info file.
|
||||
* The Standalone Info Program: (info-stnd.info).
|
||||
@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
|
||||
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
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
@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.
|
||||
@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
|
||||
|
||||
@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-M:: Menus
|
||||
* Help-Adv:: Some advanced Info commands
|
||||
* Help-Q:: Quitting Info
|
||||
@end menu
|
||||
|
||||
@node Help-Small-Screen, Help, , Getting Started
|
||||
@comment node-name, next, previous, up
|
||||
@section Starting Info on a Small Screen
|
||||
|
||||
@iftex
|
||||
(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
|
||||
|
||||
Since your terminal has an unusually 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
|
||||
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}.
|
||||
|
||||
@ifinfo
|
||||
Here are 40 lines of junk, so you can try Spaces and Deletes 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 @*
|
||||
|
||||
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.
|
||||
@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.
|
||||
|
||||
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''.
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
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;
|
||||
do not type the quotes and do not type a @key{RET} afterward.
|
||||
|
||||
@samp{>>} in the margin means it is really time to try a command.
|
||||
|
||||
@node Help-P, Help-^L, Help, Getting Started
|
||||
@comment node-name, next, previous, up
|
||||
@section Returning to the Previous node
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
@node Help-^L, Help-M, Help-P, Getting Started
|
||||
@comment node-name, next, previous, up
|
||||
@section The Space, Delete, 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 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}).
|
||||
|
||||
>> Type @kbd{C-l} now.
|
||||
|
||||
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.
|
||||
>> 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.
|
||||
|
||||
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?
|
||||
|
||||
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.
|
||||
|
||||
>> Type a @key{?} now. Press @key{SPC} to see consecutive screenfuls of
|
||||
>> the list until finished.
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
@node Help-M, Help-Adv, 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.
|
||||
|
||||
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
|
||||
@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:}.]]
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
command. At such times, commands do not work, because Info tries to
|
||||
use them as the argument. You must either type the argument 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.
|
||||
|
||||
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}.
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
Here is a menu to give you a chance to practice.
|
||||
|
||||
* Menu: The menu starts here.
|
||||
|
||||
This menu gives you three ways of going to one place, Help-FOO.
|
||||
|
||||
* Foo: Help-FOO. A node you can visit for fun.@*
|
||||
* Bar: Help-FOO. Strange! two ways to get to the same place.@*
|
||||
* Help-FOO:: And yet another!@*
|
||||
|
||||
|
||||
>> Now type just an @kbd{m} and see what happens:
|
||||
|
||||
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.
|
||||
|
||||
>> Try that now; notice the bottom line clear.
|
||||
|
||||
>> Then type another @kbd{m}.
|
||||
|
||||
>> Now type @samp{BAR} item name. Do not type Return yet.
|
||||
|
||||
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.
|
||||
|
||||
>> 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.
|
||||
|
||||
>> 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).
|
||||
|
||||
@menu
|
||||
* Help-FOO::
|
||||
@end menu
|
||||
|
||||
@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''
|
||||
|
||||
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.
|
||||
|
||||
>> Now type @kbd{u} to move back up to @samp{Help-M}.
|
||||
|
||||
@node Help-Adv, Help-Q, Help-M, Getting Started
|
||||
@comment node-name, next, previous, up
|
||||
@section Some advanced Info commands
|
||||
|
||||
The course is almost over, so please stick with it to the end.
|
||||
|
||||
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.
|
||||
|
||||
Then follow directions again and you will end up back here.
|
||||
|
||||
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,
|
||||
@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.
|
||||
|
||||
>> Now type @kbd{n} to see the last node of the course.
|
||||
|
||||
@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
|
||||
@comment node-name, next, previous, up
|
||||
@unnumberedsubsec 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, Create an Info File, Getting Started, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Info for Experts
|
||||
|
||||
This chapter describes various advanced Info commands, and how to write
|
||||
an Info as distinct from a Texinfo file. (However, in most cases, writing a
|
||||
Texinfo file is better, since you can use it @emph{both} to generate an
|
||||
Info file and to make a printed manual. @xref{Top,, Overview of
|
||||
Texinfo, texinfo, Texinfo: The GNU Documentation Format}.)
|
||||
|
||||
@menu
|
||||
* Expert:: Advanced Info commands: g, s, e, and 1 - 5.
|
||||
* 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.
|
||||
* Checking:: Checking an Info File
|
||||
* Emacs Info Variables:: Variables modifying the behavior of Emacs Info.
|
||||
@end menu
|
||||
|
||||
@node Expert, Add, , Advanced Info
|
||||
@comment node-name, next, previous, up
|
||||
@section Advanced Info Commands
|
||||
|
||||
@kbd{g}, @kbd{s}, @kbd{1}, -- @kbd{9}, and @kbd{e}
|
||||
|
||||
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.
|
||||
|
||||
Unlike @kbd{m}, @kbd{g} does not allow the use of abbreviations.
|
||||
|
||||
To go to a node in another file, you can include the filename 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 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}}.
|
||||
|
||||
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} 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.
|
||||
|
||||
If you display supports multiple fonts, and you are using Emacs' Info
|
||||
mode to read Info files, the @samp{*} for the fifth menu item is
|
||||
underlines, and so is the @samp{*} for the ninth item; these underlines
|
||||
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
|
||||
@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: The GNU Documentation Format}); this has the
|
||||
advantage that you can also make a printed manual from them. However,
|
||||
if hyou want to edit an Info file, here is how.
|
||||
|
||||
The new node can live in an existing documentation file, or in a new
|
||||
one. It must have a @key{^_} character before it (invisible to the
|
||||
user; this node has one but you cannot see it), and it ends with either
|
||||
a @key{^_}, a @key{^L}, or the end of file. Note: If you put in a
|
||||
@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 line must give the node's name (by which Info finds it),
|
||||
and state the names of the @samp{Next}, @samp{Previous}, and @samp{Up} nodes (if
|
||||
there are any). As you can see, this node's @samp{Up} node is the node
|
||||
@samp{Top}, which points at all the documentation for Info. The @samp{Next}
|
||||
node is @samp{Menus}.
|
||||
|
||||
The keywords @dfn{Node}, @dfn{Previous}, @dfn{Up}, and @dfn{Next},
|
||||
may appear in any order, anywhere in the header line, but the
|
||||
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.
|
||||
|
||||
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:
|
||||
(dir)} in it.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
|
||||
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{*}.
|
||||
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!
|
||||
|
||||
@node Tags, Checking, Cross-refs, Advanced Info
|
||||
@comment node-name, next, previous, up
|
||||
@section Tag Tables for 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
|
||||
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
|
||||
@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
|
||||
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.
|
||||
|
||||
An Info file tag table appears at the end of the file and looks like
|
||||
this:
|
||||
|
||||
@example
|
||||
^_
|
||||
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
|
||||
beginning of the node.
|
||||
|
||||
@node Checking, Emacs Info Variables, Tags, Advanced Info
|
||||
@comment node-name, next, previous, up
|
||||
@section Checking an Info File
|
||||
|
||||
When creating an Info file, it is easy to forget the name of a node
|
||||
when you are making a pointer to it from another node. If you put in
|
||||
the wrong name for a node, this is not detected until someone
|
||||
tries to go through the pointer using Info. Verification of the Info
|
||||
file is an automatic process which checks all pointers to nodes and
|
||||
reports any pointers which are invalid. Every @samp{Next}, @samp{Previous}, and
|
||||
@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.
|
||||
|
||||
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;
|
||||
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}.
|
||||
|
||||
@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-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.
|
||||
|
||||
@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).
|
||||
|
||||
@item Info-directory
|
||||
The standard directory for Info documentation files. Only used when the
|
||||
function @code{Info-directory} is called.
|
||||
@end vtable
|
||||
|
||||
@node Create an Info File, , Advanced Info, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Creating an Info File from a Makeinfo file
|
||||
|
||||
@code{makeinfo} is a utility that converts a Texinfo file into an Info
|
||||
file; @code{texinfo-format-region} and @code{texinfo-format-buffer} are
|
||||
GNU Emacs functions that do the same.
|
||||
|
||||
@xref{Create an Info File, , Creating an Info File, texinfo, the Texinfo
|
||||
Manual}, to learn how to create an Info file from a Texinfo file.
|
||||
|
||||
@xref{Top,, Overview of Texinfo, texinfo, Texinfo: The GNU Documentation
|
||||
Format}, to learn how to write a Texinfo file.
|
||||
|
||||
@bye
|
|
@ -1,177 +0,0 @@
|
|||
@c This file is included in makeinfo.texi.
|
||||
@c
|
||||
@ifinfo
|
||||
@comment Here are some useful examples of the macro facility.
|
||||
|
||||
@c Simply insert the right version of the texinfo name.
|
||||
@macro texinfo{}
|
||||
TeXinfo
|
||||
@end macro
|
||||
|
||||
@macro dfn{text}
|
||||
@dfn{\text\}
|
||||
@cpindex \text\
|
||||
@end macro
|
||||
|
||||
@c Define a macro which expands to a pretty version of the name of the
|
||||
@c Makeinfo program.
|
||||
@macro makeinfo{}
|
||||
@code{Makeinfo}
|
||||
@end macro
|
||||
|
||||
@c Define a macro which is used to define other macros. This one makes
|
||||
@c a macro which creates a node and gives it a sectioning command. Note
|
||||
@c that the created macro uses the original definition within the
|
||||
@c expansion text. This takes advantage of the non-recursion feature of
|
||||
@c macro execution.
|
||||
@macro node_define{orig-name}
|
||||
@macro \orig-name\{title}
|
||||
@node \title\
|
||||
@\orig-name\ \title\
|
||||
@end macro
|
||||
@end macro
|
||||
|
||||
@c Now actually define a new set of sectioning commands.
|
||||
@node_define {chapter}
|
||||
@node_define {section}
|
||||
@node_define {subsection}
|
||||
@end ifinfo
|
||||
|
||||
@chapter The Macro Facility
|
||||
|
||||
This chapter describes the new macro facility.
|
||||
|
||||
A @dfn{macro} is a command that you define in terms of other commands.
|
||||
It doesn't exist as a @texinfo{} command until you define it as part of
|
||||
the input file to @makeinfo{}. Once the command exists, it behaves much
|
||||
as any other @texinfo{} command. Macros are a useful way to ease the
|
||||
details and tedium of writing a `correct' info file. The following
|
||||
sections explain how to write and invoke macros.
|
||||
|
||||
@menu
|
||||
* How to Use Macros in @texinfo{}::
|
||||
How to use the macro facility.
|
||||
|
||||
* Using Macros Recursively::
|
||||
How to write a macro which does (or doesn't) recurse.
|
||||
|
||||
* Using @texinfo{} Macros As Arguments::
|
||||
Passing a macro as an argument.
|
||||
@end menu
|
||||
|
||||
@section How to Use Macros in @texinfo{}
|
||||
|
||||
Using macros in @texinfo{} is easy. First you define the macro. After
|
||||
that, the macro command is available as a normal @texinfo{} command.
|
||||
Here is what a definition looks like:
|
||||
|
||||
@example
|
||||
@@macro @var{name}@{@var{arg1}, @var{@dots{}} @var{argn}@}
|
||||
@var{@texinfo{} commands@dots{}}
|
||||
@@end macro
|
||||
@end example
|
||||
|
||||
The arguments that you specify that the macro takes are expanded with
|
||||
the actual parameters used when calling the macro if they are seen
|
||||
surrounded by backslashes. For example, here is a definition of
|
||||
@code{@@codeitem}, a macro which can be used wherever @code{@@item} can
|
||||
be used, but which surrounds its argument with @code{@@code@{@dots{}@}}.
|
||||
|
||||
@example
|
||||
@@macro codeitem@{item@}
|
||||
@@item @@code@{\item\@}
|
||||
@@end macro
|
||||
@end example
|
||||
|
||||
When the macro is expanded, all of the text between the @code{@@macro}
|
||||
and @code{@@end macro} is inserted into the document at the expansion
|
||||
point, with the actual parameters substituted for the named parameters.
|
||||
So, a call to the above macro might look like:
|
||||
|
||||
@example
|
||||
@@codeitem@{Foo@}
|
||||
@end example
|
||||
|
||||
and @makeinfo{} would execute the following code:
|
||||
|
||||
@example
|
||||
@@item @@code@{Foo@}
|
||||
@end example
|
||||
|
||||
A special case is made for macros which only take a single argument, and
|
||||
which are invoked without any brace characters (i.e.,
|
||||
@samp{@{}@dots{}@samp{@}}) surrounding an argument; the rest of the line
|
||||
is supplied as is as the sole argument to the macro. This special case
|
||||
allows one to redefine some standard @texinfo{} commands without
|
||||
modifying the input file. Along with the non-recursive action of macro
|
||||
invocation, one can easily redefine the sectioning commands to also
|
||||
provide index entries:
|
||||
|
||||
@example
|
||||
@@macro chapter@{name@}
|
||||
@@chapter \name\
|
||||
@@findex \name\
|
||||
@@end macro
|
||||
@end example
|
||||
|
||||
Thus, the text:
|
||||
|
||||
@example
|
||||
@@chapter strlen
|
||||
@end example
|
||||
|
||||
will expand to:
|
||||
|
||||
@example
|
||||
@@chapter strlen
|
||||
@@findex strlen
|
||||
@end example
|
||||
|
||||
@section Using Macros Recursively
|
||||
|
||||
Normally, while a particular macro is executing, any call to that macro
|
||||
will be seen as a call to a builtin @texinfo{} command. This allows one
|
||||
to redefine a builtin @texinfo{} command as a macro, and then use that
|
||||
command within the definition of the macro itself. For example, one
|
||||
might wish to make sure that whereever a term was defined with
|
||||
@code{@@dfn@{@dots{}@}}, the location of the definition would appear
|
||||
in the concept index for the manual. Here is a macro which redefines
|
||||
@code{@@dfn} to do just that:
|
||||
|
||||
@example
|
||||
@@macro dfn@{text@}
|
||||
@@dfn@{\text\@}
|
||||
@@cpindex \text\
|
||||
@@end macro
|
||||
@end example
|
||||
|
||||
Note that we used the builtin @texinfo{} command @code{@@dfn} within our
|
||||
overriding macro definition.
|
||||
|
||||
This behaviour itself can be overridden for macro execution by writing a
|
||||
special @dfn{macro control command} in the definition of the macro. The
|
||||
command is considered special because it doesn't affect the output text
|
||||
directly, rather, it affects the way in which the macro is defined. One
|
||||
such special command is @code{@@allow-recursion}.
|
||||
|
||||
@example
|
||||
@@macro silly@{arg@}
|
||||
@@allow-recursion
|
||||
\arg\
|
||||
@@end macro
|
||||
@end example
|
||||
|
||||
Now @code{@@silly} is a macro that can be used within a call to itself:
|
||||
|
||||
@example
|
||||
This text @@silly@{@@silly@{some text@}@} is ``some text''.
|
||||
@end example
|
||||
|
||||
@section Using @texinfo{} Macros As Arguments
|
||||
|
||||
@printindex cp
|
||||
How to use @texinfo{} macros as arguments to other @texinfo{} macros.
|
||||
|
||||
@bye
|
||||
|
||||
|
File diff suppressed because it is too large
Load diff
17289
texinfo/doc/texinfo.texi
17289
texinfo/doc/texinfo.texi
File diff suppressed because it is too large
Load diff
17280
texinfo/doc/texinfo.txi
17280
texinfo/doc/texinfo.txi
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,21 +0,0 @@
|
|||
## Makefile.am for texinfo/emacs.
|
||||
## $Id: Makefile.am,v 1.1.1.1 1998/03/23 04:42:12 law Exp $
|
||||
## Run automake in .. to produce Makefile.in from this.
|
||||
|
||||
# Do not byte compile our Elisp files by default.
|
||||
ELCFILES =
|
||||
|
||||
# Do not install our Elisp files by default, either.
|
||||
noinst_LISP = info.el informat.el makeinfo.el \
|
||||
texinfmt.el texinfo.el texnfo-upd.el
|
||||
|
||||
EXTRA_DIST = README elisp-comp new-useful-setqs $(noinst_LISP)
|
||||
|
||||
install-data-local:
|
||||
@echo "WARNING: You must (compile and) install the Emacs Lisp files"
|
||||
@echo "WARNING: manually. See ./emacs/README for some considerations."
|
||||
|
||||
# For some reason these do not get defined.
|
||||
distclean-lisp:
|
||||
clean-lisp:
|
||||
mostlyclean-lisp:
|
|
@ -1,204 +0,0 @@
|
|||
# Makefile.in generated automatically by automake 1.2 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy, distribute and modify it.
|
||||
|
||||
# Do not byte compile our Elisp files by default.
|
||||
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = true
|
||||
PRE_INSTALL = true
|
||||
POST_INSTALL = true
|
||||
NORMAL_UNINSTALL = true
|
||||
PRE_UNINSTALL = true
|
||||
POST_UNINSTALL = true
|
||||
CATALOGS = @CATALOGS@
|
||||
CATOBJEXT = @CATOBJEXT@
|
||||
CC = @CC@
|
||||
DATADIRNAME = @DATADIRNAME@
|
||||
EXEEXT = @EXEEXT@
|
||||
GENCAT = @GENCAT@
|
||||
GMOFILES = @GMOFILES@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GT_NO = @GT_NO@
|
||||
GT_YES = @GT_YES@
|
||||
INSTOBJEXT = @INSTOBJEXT@
|
||||
INTLDEPS = @INTLDEPS@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTLOBJS = @INTLOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
PACKAGE = @PACKAGE@
|
||||
POFILES = @POFILES@
|
||||
POSUB = @POSUB@
|
||||
RANLIB = @RANLIB@
|
||||
TERMLIBS = @TERMLIBS@
|
||||
TEXCONFIG = @TEXCONFIG@
|
||||
TEXMF = @TEXMF@
|
||||
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
l = @l@
|
||||
|
||||
ELCFILES =
|
||||
|
||||
# Do not install our Elisp files by default, either.
|
||||
noinst_LISP = info.el informat.el makeinfo.el \
|
||||
texinfmt.el texinfo.el texnfo-upd.el
|
||||
|
||||
EXTRA_DIST = README elisp-comp new-useful-setqs $(noinst_LISP)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
LISP = $(noinst_LISP)
|
||||
|
||||
lispdir = @lispdir@
|
||||
EMACS = @EMACS@
|
||||
DIST_COMMON = README Makefile.am Makefile.in elisp-comp
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP = --best
|
||||
default: all
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .el .elc
|
||||
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --cygnus emacs/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
.el.elc:
|
||||
@echo 'WARNING: Warnings can be ignored. :-)'
|
||||
if test $(EMACS) != no; then \
|
||||
EMACS=$(EMACS) $(SHELL) $(srcdir)/elisp-comp $<; \
|
||||
fi
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = emacs
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
if test -f $$file; then d=.; else d=$(srcdir); fi; \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file; \
|
||||
done
|
||||
info:
|
||||
dvi:
|
||||
check: all
|
||||
$(MAKE)
|
||||
installcheck:
|
||||
install-info:
|
||||
install-exec:
|
||||
@$(NORMAL_INSTALL)
|
||||
|
||||
install-data: install-data-local
|
||||
@$(NORMAL_INSTALL)
|
||||
|
||||
install: install-exec install-data all
|
||||
@:
|
||||
|
||||
uninstall:
|
||||
|
||||
all: Makefile $(LISP) $(ELCFILES)
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
installdirs:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
|
||||
clean-generic:
|
||||
test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
rm -f Makefile $(DISTCLEANFILES)
|
||||
rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
mostlyclean: mostlyclean-lisp mostlyclean-generic
|
||||
|
||||
clean: clean-lisp clean-generic mostlyclean
|
||||
|
||||
distclean: distclean-lisp distclean-generic clean
|
||||
rm -f config.status
|
||||
|
||||
maintainer-clean: maintainer-clean-lisp maintainer-clean-generic \
|
||||
distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
.PHONY: default mostlyclean-lisp distclean-lisp clean-lisp \
|
||||
maintainer-clean-lisp tags distdir info dvi installcheck install-info \
|
||||
install-exec install-data install uninstall all installdirs \
|
||||
mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
install-data-local:
|
||||
@echo "WARNING: You must (compile and) install the Emacs Lisp files"
|
||||
@echo "WARNING: manually. See ./emacs/README for some considerations."
|
||||
|
||||
# For some reason these do not get defined.
|
||||
distclean-lisp:
|
||||
clean-lisp:
|
||||
mostlyclean-lisp:
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -1,17 +0,0 @@
|
|||
This directory contains Emacs Lisp sources related to Texinfo.
|
||||
|
||||
M-x texinfo-format-buffer is no longer the standard way to make .info
|
||||
files, and may or may not work. Use makeinfo instead. See the
|
||||
`makeinfo advantages' in the manual for why.
|
||||
|
||||
The files here may or may not be newer than the versions in the latest
|
||||
Emacs distribution -- there is only one master source, so it simply
|
||||
depends on what was released later. Use whatever works better for you.
|
||||
|
||||
They are not compiled or installed by default, because of the above, and
|
||||
also due to the wide variations in sites' Emacs installations.
|
||||
|
||||
Even if you do install them, you may not want to compile them if your
|
||||
site is running multiple versions of Emacs, since .elc files are not
|
||||
portable between all Emacs releases. If you do want to compile them,
|
||||
just run the ./elisp-comp shell script.
|
|
@ -1,250 +0,0 @@
|
|||
;;; Here is a handy keybinding:
|
||||
|
||||
(global-set-key "\C-x\\" 'detexinfo)
|
||||
|
||||
;;;;;;;;;;;;;;;; detexinfo.el ;;;;;;;;;;;;;;;;
|
||||
;;;
|
||||
;;; Remove Texinfo commands from a Texinfo source file.
|
||||
;;;
|
||||
;;; Copyright (C) 1991, 1992 Free Software Foundation
|
||||
;;; Robert J. Chassell
|
||||
;;; bugs to bug-texinfo@prep.ai.mit.edu
|
||||
;;;
|
||||
;;; ==> test version <==
|
||||
;;; Fails if Texinfo source file contains formatting errors.
|
||||
;;;
|
||||
;;; Version 0.05 - 3 Jun 1992
|
||||
;;; Add to list of removed commands. Improve messages.
|
||||
;;;
|
||||
;;; Version 0.04 - 27 Jan 1992
|
||||
;;; Rewrite to insert detexinfo'd text into a temporary buffer.
|
||||
;;;
|
||||
;;; Version 0.03 - 27 Dec 1991
|
||||
;;; Improved messages.
|
||||
;;;
|
||||
;;; Version 0.02 - 13 Nov 1991
|
||||
;;; detexinfo-remove-inline-cmd, detexinfo-syntax-table: Handle
|
||||
;;; nested commands.
|
||||
;;; detexinfo: Handle nested @'s, eg @samp{@}} and @samp{@@};
|
||||
;;; replace @TeX{} with TeX.
|
||||
;;;
|
||||
;;; Version 0.01 - 13 Nov 1991
|
||||
;;;
|
||||
;;; Based on detex.el, by Bengt Martensson, 4 Oct 1987
|
||||
;;;
|
||||
;;;;;;;;;;;;;;;;
|
||||
|
||||
(defvar detexinfo-buffer-name "*detexinfo*"
|
||||
"*Name of the temporary buffer used by \\[detexinfo].")
|
||||
|
||||
(defvar detexinfo-syntax-table nil)
|
||||
|
||||
(if detexinfo-syntax-table
|
||||
nil
|
||||
(setq detexinfo-syntax-table (make-syntax-table))
|
||||
(modify-syntax-entry ?\[ "." detexinfo-syntax-table)
|
||||
(modify-syntax-entry ?\] "." detexinfo-syntax-table)
|
||||
(modify-syntax-entry ?\" "." detexinfo-syntax-table)
|
||||
(modify-syntax-entry ?\\ "." detexinfo-syntax-table)
|
||||
(modify-syntax-entry ?\( "." detexinfo-syntax-table)
|
||||
(modify-syntax-entry ?\) "." detexinfo-syntax-table)
|
||||
(modify-syntax-entry ?{ "(}" detexinfo-syntax-table)
|
||||
(modify-syntax-entry ?} "){" detexinfo-syntax-table))
|
||||
|
||||
(defun detexinfo ()
|
||||
"Remove Texinfo commands from current buffer, copying result to new buffer.
|
||||
BUG: Fails if Texinfo source file contains formatting errors."
|
||||
(interactive)
|
||||
(let ((input-buffer (current-buffer)))
|
||||
;; Find a buffer to use.
|
||||
(switch-to-buffer (get-buffer-create detexinfo-buffer-name))
|
||||
(setq major-mode 'detexinfo-mode)
|
||||
(set-syntax-table detexinfo-syntax-table)
|
||||
(erase-buffer)
|
||||
(insert-buffer-substring input-buffer)
|
||||
|
||||
;; Replace @{ and @} with %#* and *#% temporarily, so @samp{@{} works.
|
||||
;; What is a better way of doing this??
|
||||
(goto-char (point-min))
|
||||
(while (search-forward "@{" nil t) ; e.g., @samp{@{}
|
||||
(replace-match "%#*"))
|
||||
(goto-char (point-min))
|
||||
(while (search-forward "@}" nil t)
|
||||
(forward-char -3) ; e.g., @samp{@@}
|
||||
(if (looking-at "@") ; Two @@ in a row
|
||||
(progn
|
||||
(delete-char 2)
|
||||
(insert "%&%#"))
|
||||
(forward-char 1)
|
||||
(delete-char 2)
|
||||
(insert "*#%")))
|
||||
|
||||
(goto-char (point-min))
|
||||
;; Remove @refill, the only inline command without braces.
|
||||
(while (search-forward "@refill" nil t)
|
||||
(replace-match ""))
|
||||
;; Replace @TeX{} with TeX
|
||||
(goto-char (point-min))
|
||||
(while (search-forward "@TeX{}" nil t) (replace-match "TeX" t t))
|
||||
|
||||
(detexinfo-remove-line-cmds-without-arg)
|
||||
(detexinfo-remove-inline-cmds-without-arg)
|
||||
(detexinfo-remove-inline-cmds-keep-arg)
|
||||
(detexinfo-remove-line-cmds-deletable-arg)
|
||||
(detexinfo-remove-line-cmds-maybe-delete-arg)
|
||||
(detexinfo-remove-line-cmds-keep-arg)
|
||||
|
||||
;; Now replace %#*, *#%, and %&%# with {, }, and @@.
|
||||
(goto-char (point-min))
|
||||
(while (search-forward "%#*" nil t)
|
||||
(replace-match "{"))
|
||||
(goto-char (point-min))
|
||||
(while (search-forward "*#%" nil t)
|
||||
(replace-match "}"))
|
||||
(goto-char (point-min))
|
||||
(while (search-forward "%&%#" nil t)
|
||||
(replace-match "@@"))
|
||||
|
||||
;; Scan for remaining two character @-commands
|
||||
(goto-char (point-min))
|
||||
(while (search-forward "@" nil t)
|
||||
(cond ((looking-at "[*:]")
|
||||
(delete-region (1- (point)) (1+ (point))))
|
||||
((looking-at "[{}^@.'`]\"?!")
|
||||
(delete-region (1- (point)) (point)))))
|
||||
|
||||
(goto-char (point-min))
|
||||
(message "Done...removed Texinfo commands from buffer. You may save it.")))
|
||||
|
||||
(defun detexinfo-remove-whole-line (cmd)
|
||||
"Delete Texinfo line command CMD at beginning of line and rest of line."
|
||||
(goto-char (point-min))
|
||||
(while
|
||||
(re-search-forward
|
||||
(concat "^@" cmd "[ \n]+") (point-max) t)
|
||||
(goto-char (match-beginning 0))
|
||||
(delete-region
|
||||
(point) (save-excursion (end-of-line) (1+ (point))))))
|
||||
|
||||
(defun detexinfo-remove-inline-cmd (cmd)
|
||||
"Delete Texinfo inline command CMD, eg. @point, @code."
|
||||
(goto-char (point-min))
|
||||
(while
|
||||
(re-search-forward (concat "@" cmd "{") (point-max) t)
|
||||
(save-excursion
|
||||
(forward-char -1)
|
||||
(forward-sexp 1)
|
||||
(delete-char -1)) ; delete right brace
|
||||
(delete-region (point) (match-beginning 0))))
|
||||
|
||||
;;;;;;;;;;;;;;;;
|
||||
|
||||
;;; 1. @setfilename and other line commands with args to delete
|
||||
|
||||
(defvar detexinfo-line-cmds-deletable-arg
|
||||
'("enumerate" "ftable" "vtable" "itemize" "table"
|
||||
"setfilename" "settitle" "setchapternewpage"
|
||||
"footnotestyle" "paragraphindent"
|
||||
"include" "need" "sp"
|
||||
"clear" "ifclear" "ifset" "set"
|
||||
"defcodeindex" "defindex" "syncodeindex" "synindex")
|
||||
"List of Texinfo commands whose arguments should be deleted.")
|
||||
|
||||
(defun detexinfo-remove-line-cmds-deletable-arg ()
|
||||
"Delete Texinfo line commands together with their args, eg @setfilename."
|
||||
(message "Removing commands such as @enumerate...with their arguments...")
|
||||
(mapcar 'detexinfo-remove-whole-line
|
||||
detexinfo-line-cmds-deletable-arg))
|
||||
|
||||
;;; 2. @cindex and other cmds with args that may be deleted
|
||||
;;; This list is here just to make it easier to revise the
|
||||
;;; categories. In particular, you might want to keep the index entries.
|
||||
|
||||
(defvar detexinfo-line-cmds-maybe-delete-arg
|
||||
'("cindex" "findex" "kindex" "pindex" "tindex" "vindex" "node"
|
||||
"c" "comment" "end" "headings" "printindex" "vskip"
|
||||
"evenfooting" "evenheading" "everyfooting" "everyheading"
|
||||
"oddfooting" "oddheading")
|
||||
"List of Texinfo commands whose arguments may possibly be deleted.")
|
||||
|
||||
(defun detexinfo-remove-line-cmds-maybe-delete-arg ()
|
||||
"Delete Texinfo line commands together with their arguments, eg, @cindex."
|
||||
(message "Removing commands such as @cindex...with their arguments...")
|
||||
(mapcar 'detexinfo-remove-whole-line
|
||||
detexinfo-line-cmds-maybe-delete-arg))
|
||||
|
||||
;;; 3. @chapter and other line cmds with args to keep.
|
||||
|
||||
(defvar detexinfo-line-cmds-keep-arg
|
||||
'("top" "chapter" "section" "subsection" "subsubsection"
|
||||
"unnumbered" "unnumberedsec" "unnumberedsubsec" "unnumberedsubsubsec"
|
||||
"majorheading" "chapheading" "heading" "subheading" "subsubheading"
|
||||
"appendix" "appendixsec" "appendixsubsec" "appendixsubsubsec"
|
||||
"item" "itemx"
|
||||
"title" "subtitle" "center" "author" "exdent"
|
||||
"defcv" "deffn" "defivar" "defmac" "defmethod" "defop" "defopt"
|
||||
"defspec" "deftp" "deftypefn" "deftypefun" "deftypvr"
|
||||
"deftypevar" "defun" "defvar" "defvr")
|
||||
"List of Texinfo line commands whose arguments should be kept.")
|
||||
|
||||
(defun detexinfo-remove-line-cmds-keep-arg ()
|
||||
"Delete Texinfo line commands but keep their arguments, eg @chapter."
|
||||
(message "Removing commands such as @chapter...but not their arguments...")
|
||||
(mapcar 'detexinfo-remove-line-cmd-keep-arg
|
||||
detexinfo-line-cmds-keep-arg))
|
||||
|
||||
(defun detexinfo-remove-line-cmd-keep-arg (cmd)
|
||||
"Delete Texinfo line command CMD but keep its argument, eg @chapter."
|
||||
(goto-char (point-min))
|
||||
(while
|
||||
(re-search-forward
|
||||
(concat "^@" cmd "[ \n]+") (point-max) t)
|
||||
(delete-region (match-beginning 0) (match-end 0))))
|
||||
|
||||
;;; 4. @bye and other line commands without args.
|
||||
|
||||
(defvar detexinfo-line-cmds-without-arg
|
||||
'("bye" "contents" "display" "example" "finalout"
|
||||
"flushleft" "flushright" "format" "group" "ifhtml" "ifinfo" "iftex"
|
||||
"ignore" "lisp" "menu" "noindent" "page" "quotation"
|
||||
"shortcontents" "smallbook" "smallexample" "smalllisp"
|
||||
"summarycontents" "tex" "thischapter" "thischaptername"
|
||||
"thisfile" "thispage" "thissection" "thistitle" "titlepage")
|
||||
"List of Texinfo commands without arguments that should be deleted.")
|
||||
|
||||
(defun detexinfo-remove-line-cmds-without-arg ()
|
||||
"Delete line Texinfo commands that lack args, eg. @example."
|
||||
(message "Removing commands such as @example...that lack arguments...")
|
||||
(mapcar 'detexinfo-remove-whole-line
|
||||
detexinfo-line-cmds-without-arg))
|
||||
|
||||
;;; 5. @equiv and other inline cmds without args.
|
||||
|
||||
(defvar detexinfo-inline-cmds-without-arg
|
||||
'("equiv" "error" "expansion" "point" "print" "result"
|
||||
"asis" "br" "bullet" "dots" "minus" "today")
|
||||
"List of Texinfo inline commands without arguments that should be deleted.")
|
||||
|
||||
(defun detexinfo-remove-inline-cmds-without-arg ()
|
||||
"Delete Texinfo inline commands in that lack arguments."
|
||||
(message "Removing within line commands such as @result...")
|
||||
(mapcar 'detexinfo-remove-inline-cmd
|
||||
detexinfo-inline-cmds-without-arg))
|
||||
|
||||
;;; 6. @code and other inline cmds with args to keep
|
||||
|
||||
(defvar detexinfo-inline-cmds-keep-arg
|
||||
'("b" "cartouche" "cite" "code" "copyright" "ctrl" "dfn" "dmn"
|
||||
"emph" "file" "footnote" "i" "inforef"
|
||||
"kbd" "key" "pxref" "r" "ref" "samp" "sc" "titlefont"
|
||||
"strong" "t" "var" "w" "xref")
|
||||
"List of Texinfo inline commands with arguments that should be kept.")
|
||||
|
||||
(defun detexinfo-remove-inline-cmds-keep-arg ()
|
||||
"Delete Texinfo inline commands but keep its arg, eg. @code."
|
||||
(message
|
||||
"Removing within line commands such as @code...but not their arguments...")
|
||||
(mapcar 'detexinfo-remove-inline-cmd
|
||||
detexinfo-inline-cmds-keep-arg))
|
||||
|
||||
;;;;;;;;;;;;;;;; end detexinfo.el ;;;;;;;;;;;;;;;;
|
|
@ -1,7 +0,0 @@
|
|||
#!/bin/sh
|
||||
# $Id: elisp-comp,v 1.1.1.1 1997/08/21 22:57:57 jason Exp $
|
||||
# Trivial script to compile the Elisp files.
|
||||
setpath=${TMPDIR-/tmp}/elc.$$
|
||||
echo "(setq load-path (cons nil load-path))" > $setpath
|
||||
emacs -batch -l $setpath -f batch-byte-compile "$@"
|
||||
rm -f $setpath
|
File diff suppressed because it is too large
Load diff
|
@ -1,438 +0,0 @@
|
|||
;;; informat.el --- info support functions package for Emacs
|
||||
|
||||
;; Copyright (C) 1986 Free Software Foundation, Inc.
|
||||
|
||||
;; Maintainer: FSF
|
||||
;; Keywords: help
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation; either version 2, or (at your option)
|
||||
;; any later version.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
|
||||
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
;; Boston, MA 02111-1307, USA.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'info)
|
||||
|
||||
;;;###autoload
|
||||
(defun Info-tagify ()
|
||||
"Create or update Info-file tag table in current buffer."
|
||||
(interactive)
|
||||
;; Save and restore point and restrictions.
|
||||
;; save-restrictions would not work
|
||||
;; because it records the old max relative to the end.
|
||||
;; We record it relative to the beginning.
|
||||
(message "Tagifying %s ..." (file-name-nondirectory (buffer-file-name)))
|
||||
(let ((omin (point-min))
|
||||
(omax (point-max))
|
||||
(nomax (= (point-max) (1+ (buffer-size))))
|
||||
(opoint (point)))
|
||||
(unwind-protect
|
||||
(progn
|
||||
(widen)
|
||||
(goto-char (point-min))
|
||||
(if (search-forward "\^_\nIndirect:\n" nil t)
|
||||
(message "Cannot tagify split info file")
|
||||
(let ((regexp "Node:[ \t]*\\([^,\n\t]*\\)[,\t\n]")
|
||||
(case-fold-search t)
|
||||
list)
|
||||
(while (search-forward "\n\^_" nil t)
|
||||
;; We want the 0-origin character position of the ^_.
|
||||
;; That is the same as the Emacs (1-origin) position
|
||||
;; of the newline before it.
|
||||
(let ((beg (match-beginning 0)))
|
||||
(forward-line 2)
|
||||
(if (re-search-backward regexp beg t)
|
||||
(setq list
|
||||
(cons (list (buffer-substring-no-properties
|
||||
(match-beginning 1)
|
||||
(match-end 1))
|
||||
beg)
|
||||
list)))))
|
||||
(goto-char (point-max))
|
||||
(forward-line -8)
|
||||
(let ((buffer-read-only nil))
|
||||
(if (search-forward "\^_\nEnd tag table\n" nil t)
|
||||
(let ((end (point)))
|
||||
(search-backward "\nTag table:\n")
|
||||
(beginning-of-line)
|
||||
(delete-region (point) end)))
|
||||
(goto-char (point-max))
|
||||
(insert "\^_\f\nTag table:\n")
|
||||
(if (eq major-mode 'info-mode)
|
||||
(move-marker Info-tag-table-marker (point)))
|
||||
(setq list (nreverse list))
|
||||
(while list
|
||||
(insert "Node: " (car (car list)) ?\177)
|
||||
(princ (car (cdr (car list))) (current-buffer))
|
||||
(insert ?\n)
|
||||
(setq list (cdr list)))
|
||||
(insert "\^_\nEnd tag table\n")))))
|
||||
(goto-char opoint)
|
||||
(narrow-to-region omin (if nomax (1+ (buffer-size))
|
||||
(min omax (point-max))))))
|
||||
(message "Tagifying %s ... done" (file-name-nondirectory (buffer-file-name))))
|
||||
|
||||
;;;###autoload
|
||||
(defun Info-split ()
|
||||
"Split an info file into an indirect file plus bounded-size subfiles.
|
||||
Each subfile will be up to 50,000 characters plus one node.
|
||||
|
||||
To use this command, first visit a large Info file that has a tag
|
||||
table. The buffer is modified into a (small) indirect info file which
|
||||
should be saved in place of the original visited file.
|
||||
|
||||
The subfiles are written in the same directory the original file is
|
||||
in, with names generated by appending `-' and a number to the original
|
||||
file name. The indirect file still functions as an Info file, but it
|
||||
contains just the tag table and a directory of subfiles."
|
||||
|
||||
(interactive)
|
||||
(if (< (buffer-size) 70000)
|
||||
(error "This is too small to be worth splitting"))
|
||||
(goto-char (point-min))
|
||||
(search-forward "\^_")
|
||||
(forward-char -1)
|
||||
(let ((start (point))
|
||||
(chars-deleted 0)
|
||||
subfiles
|
||||
(subfile-number 1)
|
||||
(case-fold-search t)
|
||||
(filename (file-name-sans-versions buffer-file-name)))
|
||||
(goto-char (point-max))
|
||||
(forward-line -8)
|
||||
(setq buffer-read-only nil)
|
||||
(or (search-forward "\^_\nEnd tag table\n" nil t)
|
||||
(error "Tag table required; use M-x Info-tagify"))
|
||||
(search-backward "\nTag table:\n")
|
||||
(if (looking-at "\nTag table:\n\^_")
|
||||
(error "Tag table is just a skeleton; use M-x Info-tagify"))
|
||||
(beginning-of-line)
|
||||
(forward-char 1)
|
||||
(save-restriction
|
||||
(narrow-to-region (point-min) (point))
|
||||
(goto-char (point-min))
|
||||
(while (< (1+ (point)) (point-max))
|
||||
(goto-char (min (+ (point) 50000) (point-max)))
|
||||
(search-forward "\^_" nil 'move)
|
||||
(setq subfiles
|
||||
(cons (list (+ start chars-deleted)
|
||||
(concat (file-name-nondirectory filename)
|
||||
(format "-%d" subfile-number)))
|
||||
subfiles))
|
||||
;; Put a newline at end of split file, to make Unix happier.
|
||||
(insert "\n")
|
||||
(write-region (point-min) (point)
|
||||
(concat filename (format "-%d" subfile-number)))
|
||||
(delete-region (1- (point)) (point))
|
||||
;; Back up over the final ^_.
|
||||
(forward-char -1)
|
||||
(setq chars-deleted (+ chars-deleted (- (point) start)))
|
||||
(delete-region start (point))
|
||||
(setq subfile-number (1+ subfile-number))))
|
||||
(while subfiles
|
||||
(goto-char start)
|
||||
(insert (nth 1 (car subfiles))
|
||||
(format ": %d" (1- (car (car subfiles))))
|
||||
"\n")
|
||||
(setq subfiles (cdr subfiles)))
|
||||
(goto-char start)
|
||||
(insert "\^_\nIndirect:\n")
|
||||
(search-forward "\nTag Table:\n")
|
||||
(insert "(Indirect)\n")))
|
||||
|
||||
(defvar Info-validate-allnodes)
|
||||
(defvar Info-validate-thisnode)
|
||||
(defvar Info-validate-lossages)
|
||||
|
||||
;;;###autoload
|
||||
(defun Info-validate ()
|
||||
"Check current buffer for validity as an Info file.
|
||||
Check that every node pointer points to an existing node."
|
||||
(interactive)
|
||||
(save-excursion
|
||||
(save-restriction
|
||||
(widen)
|
||||
(goto-char (point-min))
|
||||
(if (search-forward "\nTag table:\n(Indirect)\n" nil t)
|
||||
(error "Don't yet know how to validate indirect info files: \"%s\""
|
||||
(buffer-name (current-buffer))))
|
||||
(goto-char (point-min))
|
||||
(let ((Info-validate-allnodes '(("*")))
|
||||
(regexp "Node:[ \t]*\\([^,\n\t]*\\)[,\t\n]")
|
||||
(case-fold-search t)
|
||||
(tags-losing nil)
|
||||
(Info-validate-lossages ()))
|
||||
(while (search-forward "\n\^_" nil t)
|
||||
(forward-line 1)
|
||||
(let ((beg (point)))
|
||||
(forward-line 1)
|
||||
(if (re-search-backward regexp beg t)
|
||||
(let ((name (downcase
|
||||
(buffer-substring-no-properties
|
||||
(match-beginning 1)
|
||||
(progn
|
||||
(goto-char (match-end 1))
|
||||
(skip-chars-backward " \t")
|
||||
(point))))))
|
||||
(if (assoc name Info-validate-allnodes)
|
||||
(setq Info-validate-lossages
|
||||
(cons (list name "Duplicate node-name" nil)
|
||||
Info-validate-lossages))
|
||||
(setq Info-validate-allnodes
|
||||
(cons (list name
|
||||
(progn
|
||||
(end-of-line)
|
||||
(and (re-search-backward
|
||||
"prev[ious]*:" beg t)
|
||||
(progn
|
||||
(goto-char (match-end 0))
|
||||
(downcase
|
||||
(Info-following-node-name)))))
|
||||
beg)
|
||||
Info-validate-allnodes)))))))
|
||||
(goto-char (point-min))
|
||||
(while (search-forward "\n\^_" nil t)
|
||||
(forward-line 1)
|
||||
(let ((beg (point))
|
||||
Info-validate-thisnode next)
|
||||
(forward-line 1)
|
||||
(if (re-search-backward regexp beg t)
|
||||
(save-restriction
|
||||
(search-forward "\n\^_" nil 'move)
|
||||
(narrow-to-region beg (point))
|
||||
(setq Info-validate-thisnode (downcase
|
||||
(buffer-substring-no-properties
|
||||
(match-beginning 1)
|
||||
(progn
|
||||
(goto-char (match-end 1))
|
||||
(skip-chars-backward " \t")
|
||||
(point)))))
|
||||
(end-of-line)
|
||||
(and (search-backward "next:" nil t)
|
||||
(setq next (Info-validate-node-name "invalid Next"))
|
||||
(assoc next Info-validate-allnodes)
|
||||
(if (equal (car (cdr (assoc next Info-validate-allnodes)))
|
||||
Info-validate-thisnode)
|
||||
;; allow multiple `next' pointers to one node
|
||||
(let ((tem Info-validate-lossages))
|
||||
(while tem
|
||||
(if (and (equal (car (cdr (car tem)))
|
||||
"should have Previous")
|
||||
(equal (car (car tem))
|
||||
next))
|
||||
(setq Info-validate-lossages
|
||||
(delq (car tem) Info-validate-lossages)))
|
||||
(setq tem (cdr tem))))
|
||||
(setq Info-validate-lossages
|
||||
(cons (list next
|
||||
"should have Previous"
|
||||
Info-validate-thisnode)
|
||||
Info-validate-lossages))))
|
||||
(end-of-line)
|
||||
(if (re-search-backward "prev[ious]*:" nil t)
|
||||
(Info-validate-node-name "invalid Previous"))
|
||||
(end-of-line)
|
||||
(if (search-backward "up:" nil t)
|
||||
(Info-validate-node-name "invalid Up"))
|
||||
(if (re-search-forward "\n* Menu:" nil t)
|
||||
(while (re-search-forward "\n\\* " nil t)
|
||||
(Info-validate-node-name
|
||||
(concat "invalid menu item "
|
||||
(buffer-substring (point)
|
||||
(save-excursion
|
||||
(skip-chars-forward "^:")
|
||||
(point))))
|
||||
(Info-extract-menu-node-name))))
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "\\*note[ \n]*[^:\t]*:" nil t)
|
||||
(goto-char (+ (match-beginning 0) 5))
|
||||
(skip-chars-forward " \n")
|
||||
(Info-validate-node-name
|
||||
(concat "invalid reference "
|
||||
(buffer-substring (point)
|
||||
(save-excursion
|
||||
(skip-chars-forward "^:")
|
||||
(point))))
|
||||
(Info-extract-menu-node-name "Bad format cross-reference")))))))
|
||||
(setq tags-losing (not (Info-validate-tags-table)))
|
||||
(if (or Info-validate-lossages tags-losing)
|
||||
(with-output-to-temp-buffer " *problems in info file*"
|
||||
(while Info-validate-lossages
|
||||
(princ "In node \"")
|
||||
(princ (car (car Info-validate-lossages)))
|
||||
(princ "\", ")
|
||||
(let ((tem (nth 1 (car Info-validate-lossages))))
|
||||
(cond ((string-match "\n" tem)
|
||||
(princ (substring tem 0 (match-beginning 0)))
|
||||
(princ "..."))
|
||||
(t
|
||||
(princ tem))))
|
||||
(if (nth 2 (car Info-validate-lossages))
|
||||
(progn
|
||||
(princ ": ")
|
||||
(let ((tem (nth 2 (car Info-validate-lossages))))
|
||||
(cond ((string-match "\n" tem)
|
||||
(princ (substring tem 0 (match-beginning 0)))
|
||||
(princ "..."))
|
||||
(t
|
||||
(princ tem))))))
|
||||
(terpri)
|
||||
(setq Info-validate-lossages (cdr Info-validate-lossages)))
|
||||
(if tags-losing (princ "\nTags table must be recomputed\n")))
|
||||
;; Here if info file is valid.
|
||||
;; If we already made a list of problems, clear it out.
|
||||
(save-excursion
|
||||
(if (get-buffer " *problems in info file*")
|
||||
(progn
|
||||
(set-buffer " *problems in info file*")
|
||||
(kill-buffer (current-buffer)))))
|
||||
(message "File appears valid"))))))
|
||||
|
||||
(defun Info-validate-node-name (kind &optional name)
|
||||
(if name
|
||||
nil
|
||||
(goto-char (match-end 0))
|
||||
(skip-chars-forward " \t")
|
||||
(if (= (following-char) ?\()
|
||||
nil
|
||||
(setq name
|
||||
(buffer-substring-no-properties
|
||||
(point)
|
||||
(progn
|
||||
(skip-chars-forward "^,\t\n")
|
||||
(skip-chars-backward " ")
|
||||
(point))))))
|
||||
(if (null name)
|
||||
nil
|
||||
(setq name (downcase name))
|
||||
(or (and (> (length name) 0) (= (aref name 0) ?\())
|
||||
(assoc name Info-validate-allnodes)
|
||||
(setq Info-validate-lossages
|
||||
(cons (list Info-validate-thisnode kind name)
|
||||
Info-validate-lossages))))
|
||||
name)
|
||||
|
||||
(defun Info-validate-tags-table ()
|
||||
(goto-char (point-min))
|
||||
(if (not (search-forward "\^_\nEnd tag table\n" nil t))
|
||||
t
|
||||
(not (catch 'losing
|
||||
(let* ((end (match-beginning 0))
|
||||
(start (progn (search-backward "\nTag table:\n")
|
||||
(1- (match-end 0))))
|
||||
tem)
|
||||
(setq tem Info-validate-allnodes)
|
||||
(while tem
|
||||
(goto-char start)
|
||||
(or (equal (car (car tem)) "*")
|
||||
(search-forward (concat "Node: "
|
||||
(car (car tem))
|
||||
"\177")
|
||||
end t)
|
||||
(throw 'losing 'x))
|
||||
(setq tem (cdr tem)))
|
||||
(goto-char (1+ start))
|
||||
(while (looking-at ".*Node: \\(.*\\)\177\\([0-9]+\\)$")
|
||||
(setq tem (downcase (buffer-substring-no-properties
|
||||
(match-beginning 1)
|
||||
(match-end 1))))
|
||||
(setq tem (assoc tem Info-validate-allnodes))
|
||||
(if (or (not tem)
|
||||
(< 1000 (progn
|
||||
(goto-char (match-beginning 2))
|
||||
(setq tem (- (car (cdr (cdr tem)))
|
||||
(read (current-buffer))))
|
||||
(if (> tem 0) tem (- tem)))))
|
||||
(throw 'losing 'y))
|
||||
(forward-line 1)))
|
||||
(if (looking-at "\^_\n")
|
||||
(forward-line 1))
|
||||
(or (looking-at "End tag table\n")
|
||||
(throw 'losing 'z))
|
||||
nil))))
|
||||
|
||||
;;;###autoload
|
||||
(defun batch-info-validate ()
|
||||
"Runs `Info-validate' on the files remaining on the command line.
|
||||
Must be used only with -batch, and kills Emacs on completion.
|
||||
Each file will be processed even if an error occurred previously.
|
||||
For example, invoke \"emacs -batch -f batch-info-validate $info/ ~/*.info\""
|
||||
(if (not noninteractive)
|
||||
(error "batch-info-validate may only be used -batch."))
|
||||
(let ((version-control t)
|
||||
(auto-save-default nil)
|
||||
(find-file-run-dired nil)
|
||||
(kept-old-versions 259259)
|
||||
(kept-new-versions 259259))
|
||||
(let ((error 0)
|
||||
file
|
||||
(files ()))
|
||||
(while command-line-args-left
|
||||
(setq file (expand-file-name (car command-line-args-left)))
|
||||
(cond ((not (file-exists-p file))
|
||||
(message ">> %s does not exist!" file)
|
||||
(setq error 1
|
||||
command-line-args-left (cdr command-line-args-left)))
|
||||
((file-directory-p file)
|
||||
(setq command-line-args-left (nconc (directory-files file)
|
||||
(cdr command-line-args-left))))
|
||||
(t
|
||||
(setq files (cons file files)
|
||||
command-line-args-left (cdr command-line-args-left)))))
|
||||
(while files
|
||||
(setq file (car files)
|
||||
files (cdr files))
|
||||
(let ((lose nil))
|
||||
(condition-case err
|
||||
(progn
|
||||
(if buffer-file-name (kill-buffer (current-buffer)))
|
||||
(find-file file)
|
||||
(buffer-disable-undo (current-buffer))
|
||||
(set-buffer-modified-p nil)
|
||||
(fundamental-mode)
|
||||
(let ((case-fold-search nil))
|
||||
(goto-char (point-max))
|
||||
(cond ((search-backward "\n\^_\^L\nTag table:\n" nil t)
|
||||
(message "%s already tagified" file))
|
||||
((< (point-max) 30000)
|
||||
(message "%s too small to bother tagifying" file))
|
||||
(t
|
||||
(Info-tagify))))
|
||||
(let ((loss-name " *problems in info file*"))
|
||||
(message "Checking validity of info file %s..." file)
|
||||
(if (get-buffer loss-name)
|
||||
(kill-buffer loss-name))
|
||||
(Info-validate)
|
||||
(if (not (get-buffer loss-name))
|
||||
nil ;(message "Checking validity of info file %s... OK" file)
|
||||
(message "----------------------------------------------------------------------")
|
||||
(message ">> PROBLEMS IN INFO FILE %s" file)
|
||||
(save-excursion
|
||||
(set-buffer loss-name)
|
||||
(princ (buffer-substring-no-properties
|
||||
(point-min) (point-max))))
|
||||
(message "----------------------------------------------------------------------")
|
||||
(setq error 1 lose t)))
|
||||
(if (and (buffer-modified-p)
|
||||
(not lose))
|
||||
(progn (message "Saving modified %s" file)
|
||||
(save-buffer))))
|
||||
(error (message ">> Error: %s" (prin1-to-string err))))))
|
||||
(kill-emacs error))))
|
||||
|
||||
(provide 'informat)
|
||||
|
||||
;;; informat.el ends here
|
|
@ -1,256 +0,0 @@
|
|||
;;; makeinfo.el --- run makeinfo conveniently
|
||||
|
||||
;; Copyright (C) 1991, 1993 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Robert J. Chassell
|
||||
;; Maintainer: FSF
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation; either version 2, or (at your option)
|
||||
;; any later version.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
|
||||
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
;; Boston, MA 02111-1307, USA.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;;; The Texinfo mode `makeinfo' related commands are:
|
||||
|
||||
;; makeinfo-region to run makeinfo on the current region.
|
||||
;; makeinfo-buffer to run makeinfo on the current buffer, or
|
||||
;; with optional prefix arg, on current region
|
||||
;; kill-compilation to kill currently running makeinfo job
|
||||
;; makeinfo-recenter-makeinfo-buffer to redisplay *compilation* buffer
|
||||
|
||||
;;; Keybindings (defined in `texinfo.el')
|
||||
|
||||
;; makeinfo bindings
|
||||
; (define-key texinfo-mode-map "\C-c\C-m\C-r" 'makeinfo-region)
|
||||
; (define-key texinfo-mode-map "\C-c\C-m\C-b" 'makeinfo-buffer)
|
||||
; (define-key texinfo-mode-map "\C-c\C-m\C-k" 'kill-compilation)
|
||||
; (define-key texinfo-mode-map "\C-c\C-m\C-l"
|
||||
; 'makeinfo-recenter-compilation-buffer)
|
||||
|
||||
;;; Code:
|
||||
|
||||
;;; Variables used by `makeinfo'
|
||||
|
||||
(require 'compile)
|
||||
|
||||
(defgroup makeinfo nil
|
||||
"Run makeinfo conveniently"
|
||||
:group 'docs)
|
||||
|
||||
|
||||
(defcustom makeinfo-run-command "makeinfo"
|
||||
"*Command used to run `makeinfo' subjob.
|
||||
The name of the file is appended to this string, separated by a space."
|
||||
:type 'string
|
||||
:group 'makeinfo)
|
||||
|
||||
(defcustom makeinfo-options "--fill-column=70"
|
||||
"*String containing options for running `makeinfo'.
|
||||
Do not include `--footnote-style' or `--paragraph-indent';
|
||||
the proper way to specify those is with the Texinfo commands
|
||||
`@footnotestyle` and `@paragraphindent'."
|
||||
:type 'string
|
||||
:group 'makeinfo)
|
||||
|
||||
(require 'texinfo)
|
||||
|
||||
(defvar makeinfo-compilation-process nil
|
||||
"Process that runs `makeinfo'. Should start out nil.")
|
||||
|
||||
(defvar makeinfo-temp-file nil
|
||||
"Temporary file name used for text being sent as input to `makeinfo'.")
|
||||
|
||||
(defvar makeinfo-output-file-name nil
|
||||
"Info file name used for text output by `makeinfo'.")
|
||||
|
||||
|
||||
;;; The `makeinfo' function definitions
|
||||
|
||||
(defun makeinfo-region (region-beginning region-end)
|
||||
"Make Info file from region of current Texinfo file, and switch to it.
|
||||
|
||||
This command does not offer the `next-error' feature since it would
|
||||
apply to a temporary file, not the original; use the `makeinfo-buffer'
|
||||
command to gain use of `next-error'."
|
||||
|
||||
(interactive "r")
|
||||
(let (filename-or-header
|
||||
filename-or-header-beginning
|
||||
filename-or-header-end)
|
||||
;; Cannot use `let' for makeinfo-temp-file or
|
||||
;; makeinfo-output-file-name since `makeinfo-compilation-sentinel'
|
||||
;; needs them.
|
||||
|
||||
(setq makeinfo-temp-file
|
||||
(concat
|
||||
(make-temp-name
|
||||
(substring (buffer-file-name)
|
||||
0
|
||||
(or (string-match "\\.tex" (buffer-file-name))
|
||||
(length (buffer-file-name)))))
|
||||
".texinfo"))
|
||||
|
||||
(save-excursion
|
||||
(save-restriction
|
||||
(widen)
|
||||
(goto-char (point-min))
|
||||
(let ((search-end (save-excursion (forward-line 100) (point))))
|
||||
;; Find and record the Info filename,
|
||||
;; or else explain that a filename is needed.
|
||||
(if (re-search-forward
|
||||
"^@setfilename[ \t]+\\([^ \t\n]+\\)[ \t]*"
|
||||
search-end t)
|
||||
(setq makeinfo-output-file-name
|
||||
(buffer-substring (match-beginning 1) (match-end 1)))
|
||||
(error
|
||||
"The texinfo file needs a line saying: @setfilename <name>"))
|
||||
|
||||
;; Find header and specify its beginning and end.
|
||||
(goto-char (point-min))
|
||||
(if (and
|
||||
(prog1
|
||||
(search-forward tex-start-of-header search-end t)
|
||||
(beginning-of-line)
|
||||
;; Mark beginning of header.
|
||||
(setq filename-or-header-beginning (point)))
|
||||
(prog1
|
||||
(search-forward tex-end-of-header nil t)
|
||||
(beginning-of-line)
|
||||
;; Mark end of header
|
||||
(setq filename-or-header-end (point))))
|
||||
|
||||
;; Insert the header into the temporary file.
|
||||
(write-region
|
||||
(min filename-or-header-beginning region-beginning)
|
||||
filename-or-header-end
|
||||
makeinfo-temp-file nil nil)
|
||||
|
||||
;; Else no header; insert @filename line into temporary file.
|
||||
(goto-char (point-min))
|
||||
(search-forward "@setfilename" search-end t)
|
||||
(beginning-of-line)
|
||||
(setq filename-or-header-beginning (point))
|
||||
(forward-line 1)
|
||||
(setq filename-or-header-end (point))
|
||||
(write-region
|
||||
(min filename-or-header-beginning region-beginning)
|
||||
filename-or-header-end
|
||||
makeinfo-temp-file nil nil))
|
||||
|
||||
;; Insert the region into the file.
|
||||
(write-region
|
||||
(max region-beginning filename-or-header-end)
|
||||
region-end
|
||||
makeinfo-temp-file t nil)
|
||||
|
||||
;; Run the `makeinfo-compile' command in the *compilation* buffer
|
||||
(save-excursion
|
||||
(makeinfo-compile
|
||||
(concat makeinfo-run-command
|
||||
" "
|
||||
makeinfo-options
|
||||
" "
|
||||
makeinfo-temp-file)
|
||||
"Use `makeinfo-buffer' to gain use of the `next-error' command"
|
||||
nil)))))))
|
||||
|
||||
;;; Actually run makeinfo. COMMAND is the command to run.
|
||||
;;; ERROR-MESSAGE is what to say when next-error can't find another error.
|
||||
;;; If PARSE-ERRORS is non-nil, do try to parse error messages.
|
||||
(defun makeinfo-compile (command error-message parse-errors)
|
||||
(let ((buffer
|
||||
(compile-internal command error-message nil
|
||||
(and (not parse-errors)
|
||||
;; If we do want to parse errors, pass nil.
|
||||
;; Otherwise, use this function, which won't
|
||||
;; ever find any errors.
|
||||
'(lambda (&rest ignore)
|
||||
(setq compilation-error-list nil))))))
|
||||
(set-process-sentinel (get-buffer-process buffer)
|
||||
'makeinfo-compilation-sentinel)))
|
||||
|
||||
;; Delete makeinfo-temp-file after processing is finished,
|
||||
;; and visit Info file.
|
||||
;; This function is called when the compilation process changes state.
|
||||
;; Based on `compilation-sentinel' in compile.el
|
||||
(defun makeinfo-compilation-sentinel (proc msg)
|
||||
(compilation-sentinel proc msg)
|
||||
(if (and makeinfo-temp-file (file-exists-p makeinfo-temp-file))
|
||||
(delete-file makeinfo-temp-file))
|
||||
;; Always use the version on disk.
|
||||
(if (get-file-buffer makeinfo-output-file-name)
|
||||
(progn (set-buffer makeinfo-output-file-name)
|
||||
(revert-buffer t t))
|
||||
(find-file makeinfo-output-file-name))
|
||||
(goto-char (point-min)))
|
||||
|
||||
(defun makeinfo-buffer ()
|
||||
"Make Info file from current buffer.
|
||||
|
||||
Use the \\[next-error] command to move to the next error
|
||||
\(if there are errors\)."
|
||||
|
||||
(interactive)
|
||||
(cond ((null buffer-file-name)
|
||||
(error "Buffer not visiting any file"))
|
||||
((buffer-modified-p)
|
||||
(if (y-or-n-p "Buffer modified; do you want to save it? ")
|
||||
(save-buffer))))
|
||||
|
||||
;; Find and record the Info filename,
|
||||
;; or else explain that a filename is needed.
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(let ((search-end (save-excursion (forward-line 100) (point))))
|
||||
(if (re-search-forward
|
||||
"^@setfilename[ \t]+\\([^ \t\n]+\\)[ \t]*"
|
||||
search-end t)
|
||||
(setq makeinfo-output-file-name
|
||||
(buffer-substring (match-beginning 1) (match-end 1)))
|
||||
(error
|
||||
"The texinfo file needs a line saying: @setfilename <name>"))))
|
||||
|
||||
(save-excursion
|
||||
(makeinfo-compile
|
||||
(concat makeinfo-run-command " " makeinfo-options
|
||||
" " buffer-file-name)
|
||||
"No more errors."
|
||||
t)))
|
||||
|
||||
(defun makeinfo-recenter-compilation-buffer (linenum)
|
||||
"Redisplay `*compilation*' buffer so most recent output can be seen.
|
||||
The last line of the buffer is displayed on
|
||||
line LINE of the window, or centered if LINE is nil."
|
||||
(interactive "P")
|
||||
(let ((makeinfo-buffer (get-buffer "*compilation*"))
|
||||
(old-buffer (current-buffer)))
|
||||
(if (null makeinfo-buffer)
|
||||
(message "No *compilation* buffer")
|
||||
(pop-to-buffer makeinfo-buffer)
|
||||
(bury-buffer makeinfo-buffer)
|
||||
(goto-char (point-max))
|
||||
(recenter (if linenum
|
||||
(prefix-numeric-value linenum)
|
||||
(/ (window-height) 2)))
|
||||
(pop-to-buffer old-buffer)
|
||||
)))
|
||||
|
||||
;;; Place `provide' at end of file.
|
||||
(provide 'makeinfo)
|
||||
|
||||
;;; makeinfo.el ends here
|
||||
|
|
@ -1,180 +0,0 @@
|
|||
;; -*- Mode: Emacs-Lisp -*-
|
||||
|
||||
;; This is the `new-useful-setqs' file
|
||||
;; This overrides old defvars since they were revised.
|
||||
|
||||
(setq texinfmt-version "2.35 of 10 September 1996")
|
||||
|
||||
(setq texinfo-master-menu-header
|
||||
"\n@detailmenu\n --- The Detailed Node Listing ---\n")
|
||||
|
||||
(setq texinfo-environment-regexp
|
||||
(concat
|
||||
"^@"
|
||||
"\\("
|
||||
"cartouche\\|"
|
||||
"display\\|"
|
||||
"end\\|"
|
||||
"enumerate\\|"
|
||||
"example\\|"
|
||||
"f?table\\|"
|
||||
"flushleft\\|"
|
||||
"flushright\\|"
|
||||
"format\\|"
|
||||
"group\\|"
|
||||
"ifhtml\\|"
|
||||
"ifinfo\\|"
|
||||
"iftex\\|"
|
||||
"ignore\\|"
|
||||
"itemize\\|"
|
||||
"lisp\\|"
|
||||
"macro\\|"
|
||||
"multitable\\|"
|
||||
"quotation\\|"
|
||||
"smallexample\\|"
|
||||
"smalllisp\\|"
|
||||
"tex"
|
||||
"\\)")
|
||||
)
|
||||
|
||||
(setq texinfo-no-refill-regexp
|
||||
(concat
|
||||
"^@"
|
||||
"\\("
|
||||
"example\\|"
|
||||
"smallexample\\|"
|
||||
"lisp\\|"
|
||||
"smalllisp\\|"
|
||||
"display\\|"
|
||||
"format\\|"
|
||||
"flushleft\\|"
|
||||
"flushright\\|"
|
||||
"menu\\|"
|
||||
"multitable\\|"
|
||||
"titlepage\\|"
|
||||
"iftex\\|"
|
||||
"ifhtml\\|"
|
||||
"tex\\|"
|
||||
"html"
|
||||
"\\)"))
|
||||
|
||||
|
||||
(setq texinfo-accent-commands
|
||||
(concat
|
||||
"@OE\\|"
|
||||
"@oe\\|"
|
||||
"@AA\\|"
|
||||
"@aa\\|"
|
||||
"@AE\\|"
|
||||
"@ae\\|"
|
||||
"@ss\\|"
|
||||
"@^\\|"
|
||||
"@`\\|"
|
||||
"@'\\|"
|
||||
"@\"\\|"
|
||||
"@,\\|"
|
||||
"@=\\|"
|
||||
"@~\\|"
|
||||
"@questiondown{\\|"
|
||||
"@exclamdown{\\|"
|
||||
"@L{\\|"
|
||||
"@l{\\|"
|
||||
"@O{\\|"
|
||||
"@o{\\|"
|
||||
"@dotaccent{\\|"
|
||||
"@ubaraccent{\\|"
|
||||
"@d{\\|"
|
||||
"@H{\\|"
|
||||
"@ringaccent{\\|"
|
||||
"@tieaccent{\\|"
|
||||
"@u{\\|"
|
||||
"@v{\\|"
|
||||
"@dotless{"
|
||||
))
|
||||
|
||||
(setq texinfo-part-of-para-regexp
|
||||
(concat
|
||||
"^@"
|
||||
"\\("
|
||||
"b{\\|"
|
||||
"bullet{\\|"
|
||||
"cite{\\|"
|
||||
"code{\\|"
|
||||
"emph{\\|"
|
||||
"equiv{\\|"
|
||||
"error{\\|"
|
||||
"expansion{\\|"
|
||||
"file{\\|"
|
||||
"i{\\|"
|
||||
"inforef{\\|"
|
||||
"kbd{\\|"
|
||||
"key{\\|"
|
||||
"lisp{\\|"
|
||||
"email{\\|"
|
||||
"minus{\\|"
|
||||
"point{\\|"
|
||||
"print{\\|"
|
||||
"pxref{\\|"
|
||||
"r{\\|"
|
||||
"ref{\\|"
|
||||
"result{\\|"
|
||||
"samp{\\|"
|
||||
"sc{\\|"
|
||||
"t{\\|"
|
||||
"TeX{\\|"
|
||||
"today{\\|"
|
||||
"url{\\|"
|
||||
"var{\\|"
|
||||
"w{\\|"
|
||||
"xref{\\|"
|
||||
"@-\\|" ; @- is a descretionary hyphen (not an accent) (a noop).
|
||||
texinfo-accent-commands
|
||||
"\\)"
|
||||
))
|
||||
|
||||
(setq texinfo-raisesections-alist
|
||||
'((@chapter . @chapter) ; Cannot go higher
|
||||
(@unnumbered . @unnumbered)
|
||||
(@centerchap . @unnumbered)
|
||||
|
||||
(@majorheading . @majorheading)
|
||||
(@chapheading . @chapheading)
|
||||
(@appendix . @appendix)
|
||||
|
||||
(@section . @chapter)
|
||||
(@unnumberedsec . @unnumbered)
|
||||
(@heading . @chapheading)
|
||||
(@appendixsec . @appendix)
|
||||
|
||||
(@subsection . @section)
|
||||
(@unnumberedsubsec . @unnumberedsec)
|
||||
(@subheading . @heading)
|
||||
(@appendixsubsec . @appendixsec)
|
||||
|
||||
(@subsubsection . @subsection)
|
||||
(@unnumberedsubsubsec . @unnumberedsubsec)
|
||||
(@subsubheading . @subheading)
|
||||
(@appendixsubsubsec . @appendixsubsec)))
|
||||
|
||||
(setq texinfo-lowersections-alist
|
||||
'((@chapter . @section)
|
||||
(@unnumbered . @unnumberedsec)
|
||||
(@centerchap . @unnumberedsec)
|
||||
(@majorheading . @heading)
|
||||
(@chapheading . @heading)
|
||||
(@appendix . @appendixsec)
|
||||
|
||||
(@section . @subsection)
|
||||
(@unnumberedsec . @unnumberedsubsec)
|
||||
(@heading . @subheading)
|
||||
(@appendixsec . @appendixsubsec)
|
||||
|
||||
(@subsection . @subsubsection)
|
||||
(@unnumberedsubsec . @unnumberedsubsubsec)
|
||||
(@subheading . @subsubheading)
|
||||
(@appendixsubsec . @appendixsubsubsec)
|
||||
|
||||
(@subsubsection . @subsubsection) ; Cannot go lower.
|
||||
(@unnumberedsubsubsec . @unnumberedsubsubsec)
|
||||
(@subsubheading . @subsubheading)
|
||||
(@appendixsubsubsec . @appendixsubsubsec)))
|
File diff suppressed because it is too large
Load diff
|
@ -1,874 +0,0 @@
|
|||
;;; texinfo.el --- major mode for editing Texinfo files
|
||||
|
||||
;; Copyright (C) 1985, '88, '89, '90, '91,
|
||||
;; '92, '93, '96, '97 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Robert J. Chassell
|
||||
;; Date: [Set date below for texinfo-version]
|
||||
;; Maintainer: bug-texinfo@prep.ai.mit.edu
|
||||
;; Keywords: maint, tex, docs
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation; either version 2, or (at your option)
|
||||
;; any later version.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
|
||||
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
;; Boston, MA 02111-1307, USA.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defgroup texinfo nil
|
||||
"Texinfo Mode"
|
||||
:group 'docs)
|
||||
|
||||
(defvar texinfo-version "2.37 of 24 May 1997")
|
||||
|
||||
(defun texinfo-version (&optional here)
|
||||
"Show the version of texinfo.el in the minibuffer.
|
||||
If optional argument HERE is non-nil, insert info at point."
|
||||
(interactive "P")
|
||||
(let ((version-string
|
||||
(format "Version of \`texinfo.el\': %s" texinfo-version)))
|
||||
(if here
|
||||
(insert version-string)
|
||||
(if (interactive-p)
|
||||
(message "%s" version-string)
|
||||
version-string))))
|
||||
|
||||
|
||||
;;; Autoloads:
|
||||
|
||||
(autoload 'makeinfo-region
|
||||
"makeinfo"
|
||||
"Make Info file from region of current Texinfo file, and switch to it.
|
||||
|
||||
This command does not offer the `next-error' feature since it would
|
||||
apply to a temporary file, not the original; use the `makeinfo-buffer'
|
||||
command to gain use of `next-error'."
|
||||
t nil)
|
||||
|
||||
(autoload 'makeinfo-buffer
|
||||
"makeinfo"
|
||||
"Make Info file from current buffer.
|
||||
|
||||
Use the \\[next-error] command to move to the next error
|
||||
\(if there are errors\)."
|
||||
t nil)
|
||||
|
||||
(autoload 'kill-compilation
|
||||
"compile"
|
||||
"Kill the process made by the \\[compile] command."
|
||||
t nil)
|
||||
|
||||
(autoload 'makeinfo-recenter-compilation-buffer
|
||||
"makeinfo"
|
||||
"Redisplay `*compilation*' buffer so most recent output can be seen.
|
||||
The last line of the buffer is displayed on
|
||||
line LINE of the window, or centered if LINE is nil."
|
||||
t nil)
|
||||
|
||||
(autoload 'texinfo-update-node
|
||||
"texnfo-upd"
|
||||
"Without any prefix argument, update the node in which point is located.
|
||||
Non-nil argument (prefix, if interactive) means update the nodes in the
|
||||
marked region.
|
||||
|
||||
The functions for creating or updating nodes and menus, and their
|
||||
keybindings, are:
|
||||
|
||||
texinfo-update-node (&optional region-p) \\[texinfo-update-node]
|
||||
texinfo-every-node-update () \\[texinfo-every-node-update]
|
||||
texinfo-sequential-node-update (&optional region-p)
|
||||
|
||||
texinfo-make-menu (&optional region-p) \\[texinfo-make-menu]
|
||||
texinfo-all-menus-update () \\[texinfo-all-menus-update]
|
||||
texinfo-master-menu ()
|
||||
|
||||
texinfo-indent-menu-description (column &optional region-p)
|
||||
|
||||
The `texinfo-column-for-description' variable specifies the column to
|
||||
which menu descriptions are indented. Its default value is 32."
|
||||
t nil)
|
||||
|
||||
(autoload 'texinfo-every-node-update
|
||||
"texnfo-upd"
|
||||
"Update every node in a Texinfo file."
|
||||
t nil)
|
||||
|
||||
(autoload 'texinfo-sequential-node-update
|
||||
"texnfo-upd"
|
||||
"Update one node (or many) in a Texinfo file with sequential pointers.
|
||||
|
||||
This function causes the `Next' or `Previous' pointer to point to the
|
||||
immediately preceding or following node, even if it is at a higher or
|
||||
lower hierarchical level in the document. Continually pressing `n' or
|
||||
`p' takes you straight through the file.
|
||||
|
||||
Without any prefix argument, update the node in which point is located.
|
||||
Non-nil argument (prefix, if interactive) means update the nodes in the
|
||||
marked region.
|
||||
|
||||
This command makes it awkward to navigate among sections and
|
||||
subsections; it should be used only for those documents that are meant
|
||||
to be read like a novel rather than a reference, and for which the
|
||||
Info `g*' command is inadequate."
|
||||
t nil)
|
||||
|
||||
(autoload 'texinfo-make-menu
|
||||
"texnfo-upd"
|
||||
"Without any prefix argument, make or update a menu.
|
||||
Make the menu for the section enclosing the node found following point.
|
||||
|
||||
Non-nil argument (prefix, if interactive) means make or update menus
|
||||
for nodes within or part of the marked region.
|
||||
|
||||
Whenever a menu exists, and is being updated, the descriptions that
|
||||
are associated with node names in the pre-existing menu are
|
||||
incorporated into the new menu. Otherwise, the nodes' section titles
|
||||
are inserted as descriptions."
|
||||
t nil)
|
||||
|
||||
(autoload 'texinfo-all-menus-update
|
||||
"texnfo-upd"
|
||||
"Update every regular menu in a Texinfo file.
|
||||
Remove pre-existing master menu, if there is one.
|
||||
|
||||
If called with a non-nil argument, this function first updates all the
|
||||
nodes in the buffer before updating the menus."
|
||||
t nil)
|
||||
|
||||
(autoload 'texinfo-master-menu
|
||||
"texnfo-upd"
|
||||
"Make a master menu for a whole Texinfo file.
|
||||
Non-nil argument (prefix, if interactive) means first update all
|
||||
existing nodes and menus. Remove pre-existing master menu, if there is one.
|
||||
|
||||
This function creates a master menu that follows the top node. The
|
||||
master menu includes every entry from all the other menus. It
|
||||
replaces any existing ordinary menu that follows the top node.
|
||||
|
||||
If called with a non-nil argument, this function first updates all the
|
||||
menus in the buffer (incorporating descriptions from pre-existing
|
||||
menus) before it constructs the master menu.
|
||||
|
||||
The function removes the detailed part of an already existing master
|
||||
menu. This action depends on the pre-existing master menu using the
|
||||
standard `texinfo-master-menu-header'.
|
||||
|
||||
The master menu has the following format, which is adapted from the
|
||||
recommendation in the Texinfo Manual:
|
||||
|
||||
* The first part contains the major nodes in the Texinfo file: the
|
||||
nodes for the chapters, chapter-like sections, and the major
|
||||
appendices. This includes the indices, so long as they are in
|
||||
chapter-like sections, such as unnumbered sections.
|
||||
|
||||
* The second and subsequent parts contain a listing of the other,
|
||||
lower level menus, in order. This way, an inquirer can go
|
||||
directly to a particular node if he or she is searching for
|
||||
specific information.
|
||||
|
||||
Each of the menus in the detailed node listing is introduced by the
|
||||
title of the section containing the menu."
|
||||
t nil)
|
||||
|
||||
(autoload 'texinfo-indent-menu-description
|
||||
"texnfo-upd"
|
||||
"Indent every description in menu following point to COLUMN.
|
||||
Non-nil argument (prefix, if interactive) means indent every
|
||||
description in every menu in the region. Does not indent second and
|
||||
subsequent lines of a multi-line description."
|
||||
t nil)
|
||||
|
||||
(autoload 'texinfo-insert-node-lines
|
||||
"texnfo-upd"
|
||||
"Insert missing `@node' lines in region of Texinfo file.
|
||||
Non-nil argument (prefix, if interactive) means also to insert the
|
||||
section titles as node names; and also to insert the section titles as
|
||||
node names in pre-existing @node lines that lack names."
|
||||
t nil)
|
||||
|
||||
(autoload 'texinfo-start-menu-description
|
||||
"texnfo-upd"
|
||||
"In this menu entry, insert the node's section title as a description.
|
||||
Position point at beginning of description ready for editing.
|
||||
Do not insert a title if the line contains an existing description.
|
||||
|
||||
You will need to edit the inserted text since a useful description
|
||||
complements the node name rather than repeats it as a title does."
|
||||
t nil)
|
||||
|
||||
(autoload 'texinfo-multiple-files-update
|
||||
"texnfo-upd"
|
||||
"Update first node pointers in each file included in OUTER-FILE;
|
||||
create or update main menu in the outer file that refers to such nodes.
|
||||
This does not create or update menus or pointers within the included files.
|
||||
|
||||
With optional MAKE-MASTER-MENU argument (prefix arg, if interactive),
|
||||
insert a master menu in OUTER-FILE. This does not create or update
|
||||
menus or pointers within the included files.
|
||||
|
||||
With optional UPDATE-EVERYTHING argument (numeric prefix arg, if
|
||||
interactive), update all the menus and all the `Next', `Previous', and
|
||||
`Up' pointers of all the files included in OUTER-FILE before inserting
|
||||
a master menu in OUTER-FILE.
|
||||
|
||||
The command also updates the `Top' level node pointers of OUTER-FILE.
|
||||
|
||||
Notes:
|
||||
|
||||
* this command does NOT save any files--you must save the
|
||||
outer file and any modified, included files.
|
||||
|
||||
* except for the `Top' node, this command does NOT handle any
|
||||
pre-existing nodes in the outer file; hence, indices must be
|
||||
enclosed in an included file.
|
||||
|
||||
Requirements:
|
||||
|
||||
* each of the included files must contain exactly one highest
|
||||
hierarchical level node,
|
||||
* this highest node must be the first node in the included file,
|
||||
* each highest hierarchical level node must be of the same type.
|
||||
|
||||
Thus, normally, each included file contains one, and only one,
|
||||
chapter."
|
||||
t nil)
|
||||
|
||||
|
||||
;;; Code:
|
||||
|
||||
;;; Don't you dare insert any `require' calls at top level in this file--rms.
|
||||
|
||||
;;; Syntax table
|
||||
|
||||
(defvar texinfo-mode-syntax-table nil)
|
||||
|
||||
(if texinfo-mode-syntax-table
|
||||
nil
|
||||
(setq texinfo-mode-syntax-table (make-syntax-table))
|
||||
(modify-syntax-entry ?\" " " texinfo-mode-syntax-table)
|
||||
(modify-syntax-entry ?\\ " " texinfo-mode-syntax-table)
|
||||
(modify-syntax-entry ?@ "\\" texinfo-mode-syntax-table)
|
||||
(modify-syntax-entry ?\^q "\\" texinfo-mode-syntax-table)
|
||||
(modify-syntax-entry ?\[ "(]" texinfo-mode-syntax-table)
|
||||
(modify-syntax-entry ?\] ")[" texinfo-mode-syntax-table)
|
||||
(modify-syntax-entry ?{ "(}" texinfo-mode-syntax-table)
|
||||
(modify-syntax-entry ?} "){" texinfo-mode-syntax-table)
|
||||
(modify-syntax-entry ?\' "w" texinfo-mode-syntax-table))
|
||||
|
||||
;; Written by Wolfgang Bangerth <zcg51122@rpool1.rus.uni-stuttgart.de>
|
||||
;; To override this example, set either `imenu-generic-expression'
|
||||
;; or `imenu-create-index-function'.
|
||||
(defvar texinfo-imenu-generic-expression
|
||||
'((nil "^@node[ \t]+\\([^,\n]*\\)" 1)
|
||||
("Chapters" "^@chapter[ \t]+\\(.*\\)$" 1))
|
||||
|
||||
"Imenu generic expression for TexInfo mode. See `imenu-generic-expression'.")
|
||||
|
||||
(defvar texinfo-font-lock-keywords
|
||||
'(;; All but the first 2 had an OVERRIDE of t.
|
||||
;; It didn't seem to be any better, and it's slower--simon.
|
||||
("^\\(@c\\|@comment\\)\\>.*" . font-lock-comment-face) ;comments
|
||||
;; Robert J. Chassell <bob@gnu.ai.mit.edu> says remove this line.
|
||||
;;("\\$\\([^$]*\\)\\$" 1 font-lock-string-face t)
|
||||
("@\\([a-zA-Z]+\\|[^ \t\n]\\)" 1 font-lock-keyword-face) ;commands
|
||||
("^\\*\\(.*\\)[\t ]*$" 1 font-lock-function-name-face t) ;menu items
|
||||
("@\\(emph\\|strong\\|b\\|i\\){\\([^}]+\\)" 2 font-lock-comment-face)
|
||||
("@\\(file\\|kbd\\|key\\|url\\|email\\){\\([^}]+\\)" 2 font-lock-string-face)
|
||||
("@\\(samp\\|code\\|var\\|math\\){\\([^}]+\\)"
|
||||
2 font-lock-variable-name-face)
|
||||
("@\\(cite\\|xref\\|pxref\\){\\([^}]+\\)" 2 font-lock-reference-face)
|
||||
("@\\(end\\|itemx?\\) +\\(.+\\)" 2 font-lock-function-name-face keep)
|
||||
)
|
||||
"Additional expressions to highlight in TeXinfo mode.")
|
||||
|
||||
(defvar texinfo-section-list
|
||||
'(("top" 1)
|
||||
("majorheading" 1)
|
||||
("chapter" 2)
|
||||
("unnumbered" 2)
|
||||
("appendix" 2)
|
||||
("chapheading" 2)
|
||||
("section" 3)
|
||||
("unnumberedsec" 3)
|
||||
("appendixsec" 3)
|
||||
("heading" 3)
|
||||
("subsection" 4)
|
||||
("unnumberedsubsec" 4)
|
||||
("appendixsubsec" 4)
|
||||
("subheading" 4)
|
||||
("subsubsection" 5)
|
||||
("unnumberedsubsubsec" 5)
|
||||
("appendixsubsubsec" 5)
|
||||
("subsubheading" 5))
|
||||
"Alist of sectioning commands and their relative level.")
|
||||
|
||||
(defun texinfo-outline-level ()
|
||||
;; Calculate level of current texinfo outline heading.
|
||||
(save-excursion
|
||||
(if (bobp)
|
||||
0
|
||||
(forward-char 1)
|
||||
(let* ((word (buffer-substring-no-properties
|
||||
(point) (progn (forward-word 1) (point))))
|
||||
(entry (assoc word texinfo-section-list)))
|
||||
(if entry
|
||||
(nth 1 entry)
|
||||
5)))))
|
||||
|
||||
|
||||
;;; Keybindings
|
||||
(defvar texinfo-mode-map nil)
|
||||
|
||||
;;; Keys common both to Texinfo mode and to TeX shell.
|
||||
|
||||
(defun texinfo-define-common-keys (keymap)
|
||||
"Define the keys both in Texinfo mode and in the texinfo-tex-shell."
|
||||
(define-key keymap "\C-c\C-t\C-k" 'tex-kill-job)
|
||||
(define-key keymap "\C-c\C-t\C-x" 'texinfo-quit-job)
|
||||
(define-key keymap "\C-c\C-t\C-l" 'tex-recenter-output-buffer)
|
||||
(define-key keymap "\C-c\C-t\C-d" 'texinfo-delete-from-print-queue)
|
||||
(define-key keymap "\C-c\C-t\C-q" 'tex-show-print-queue)
|
||||
(define-key keymap "\C-c\C-t\C-p" 'texinfo-tex-print)
|
||||
(define-key keymap "\C-c\C-t\C-v" 'texinfo-tex-view)
|
||||
(define-key keymap "\C-c\C-t\C-i" 'texinfo-texindex)
|
||||
|
||||
(define-key keymap "\C-c\C-t\C-r" 'texinfo-tex-region)
|
||||
(define-key keymap "\C-c\C-t\C-b" 'texinfo-tex-buffer))
|
||||
|
||||
;; Mode documentation displays commands in reverse order
|
||||
;; from how they are listed in the texinfo-mode-map.
|
||||
|
||||
(if texinfo-mode-map
|
||||
nil
|
||||
(setq texinfo-mode-map (make-sparse-keymap))
|
||||
|
||||
;; bindings for `texnfo-tex.el'
|
||||
(texinfo-define-common-keys texinfo-mode-map)
|
||||
|
||||
;; bindings for `makeinfo.el'
|
||||
(define-key texinfo-mode-map "\C-c\C-m\C-k" 'kill-compilation)
|
||||
(define-key texinfo-mode-map "\C-c\C-m\C-l"
|
||||
'makeinfo-recenter-compilation-buffer)
|
||||
(define-key texinfo-mode-map "\C-c\C-m\C-r" 'makeinfo-region)
|
||||
(define-key texinfo-mode-map "\C-c\C-m\C-b" 'makeinfo-buffer)
|
||||
|
||||
;; bindings for `texinfmt.el'
|
||||
(define-key texinfo-mode-map "\C-c\C-e\C-r" 'texinfo-format-region)
|
||||
(define-key texinfo-mode-map "\C-c\C-e\C-b" 'texinfo-format-buffer)
|
||||
|
||||
;; bindings for updating nodes and menus
|
||||
|
||||
(define-key texinfo-mode-map "\C-c\C-um" 'texinfo-master-menu)
|
||||
|
||||
(define-key texinfo-mode-map "\C-c\C-u\C-m" 'texinfo-make-menu)
|
||||
(define-key texinfo-mode-map "\C-c\C-u\C-n" 'texinfo-update-node)
|
||||
(define-key texinfo-mode-map "\C-c\C-u\C-e" 'texinfo-every-node-update)
|
||||
(define-key texinfo-mode-map "\C-c\C-u\C-a" 'texinfo-all-menus-update)
|
||||
|
||||
(define-key texinfo-mode-map "\C-c\C-s" 'texinfo-show-structure)
|
||||
|
||||
(define-key texinfo-mode-map "\C-c}" 'up-list)
|
||||
(define-key texinfo-mode-map "\C-c]" 'up-list)
|
||||
(define-key texinfo-mode-map "\C-c{" 'texinfo-insert-braces)
|
||||
|
||||
;; bindings for inserting strings
|
||||
|
||||
(define-key texinfo-mode-map "\C-c\C-c\C-d" 'texinfo-start-menu-description)
|
||||
|
||||
(define-key texinfo-mode-map "\C-c\C-cv" 'texinfo-insert-@var)
|
||||
(define-key texinfo-mode-map "\C-c\C-ct" 'texinfo-insert-@table)
|
||||
(define-key texinfo-mode-map "\C-c\C-cs" 'texinfo-insert-@samp)
|
||||
(define-key texinfo-mode-map "\C-c\C-co" 'texinfo-insert-@noindent)
|
||||
(define-key texinfo-mode-map "\C-c\C-cn" 'texinfo-insert-@node)
|
||||
(define-key texinfo-mode-map "\C-c\C-ck" 'texinfo-insert-@kbd)
|
||||
(define-key texinfo-mode-map "\C-c\C-ci" 'texinfo-insert-@item)
|
||||
(define-key texinfo-mode-map "\C-c\C-cf" 'texinfo-insert-@file)
|
||||
(define-key texinfo-mode-map "\C-c\C-cx" 'texinfo-insert-@example)
|
||||
(define-key texinfo-mode-map "\C-c\C-ce" 'texinfo-insert-@end)
|
||||
(define-key texinfo-mode-map "\C-c\C-cd" 'texinfo-insert-@dfn)
|
||||
(define-key texinfo-mode-map "\C-c\C-cc" 'texinfo-insert-@code))
|
||||
|
||||
|
||||
;;; Texinfo mode
|
||||
|
||||
(defvar texinfo-chapter-level-regexp
|
||||
"chapter\\|unnumbered \\|appendix \\|majorheading\\|chapheading"
|
||||
"Regular expression matching Texinfo chapter-level headings.
|
||||
This does not match `@node' and does not match the `@top' command.")
|
||||
|
||||
;;;###autoload
|
||||
(defun texinfo-mode ()
|
||||
"Major mode for editing Texinfo files.
|
||||
|
||||
It has these extra commands:
|
||||
\\{texinfo-mode-map}
|
||||
|
||||
These are files that are used as input for TeX to make printed manuals
|
||||
and also to be turned into Info files with \\[makeinfo-buffer] or
|
||||
the `makeinfo' program. These files must be written in a very restricted and
|
||||
modified version of TeX input format.
|
||||
|
||||
Editing commands are like text-mode except that the syntax table is
|
||||
set up so expression commands skip Texinfo bracket groups. To see
|
||||
what the Info version of a region of the Texinfo file will look like,
|
||||
use \\[makeinfo-region], which runs `makeinfo' on the current region.
|
||||
|
||||
You can show the structure of a Texinfo file with \\[texinfo-show-structure].
|
||||
This command shows the structure of a Texinfo file by listing the
|
||||
lines with the @-sign commands for @chapter, @section, and the like.
|
||||
These lines are displayed in another window called the *Occur* window.
|
||||
In that window, you can position the cursor over one of the lines and
|
||||
use \\[occur-mode-goto-occurrence], to jump to the corresponding spot
|
||||
in the Texinfo file.
|
||||
|
||||
In addition, Texinfo mode provides commands that insert various
|
||||
frequently used @-sign commands into the buffer. You can use these
|
||||
commands to save keystrokes. And you can insert balanced braces with
|
||||
\\[texinfo-insert-braces] and later use the command \\[up-list] to
|
||||
move forward past the closing brace.
|
||||
|
||||
Also, Texinfo mode provides functions for automatically creating or
|
||||
updating menus and node pointers. These functions
|
||||
|
||||
* insert the `Next', `Previous' and `Up' pointers of a node,
|
||||
* insert or update the menu for a section, and
|
||||
* create a master menu for a Texinfo source file.
|
||||
|
||||
Here are the functions:
|
||||
|
||||
texinfo-update-node \\[texinfo-update-node]
|
||||
texinfo-every-node-update \\[texinfo-every-node-update]
|
||||
texinfo-sequential-node-update
|
||||
|
||||
texinfo-make-menu \\[texinfo-make-menu]
|
||||
texinfo-all-menus-update \\[texinfo-all-menus-update]
|
||||
texinfo-master-menu
|
||||
|
||||
texinfo-indent-menu-description (column &optional region-p)
|
||||
|
||||
The `texinfo-column-for-description' variable specifies the column to
|
||||
which menu descriptions are indented.
|
||||
|
||||
Passed an argument (a prefix argument, if interactive), the
|
||||
`texinfo-update-node' and `texinfo-make-menu' functions do their jobs
|
||||
in the region.
|
||||
|
||||
To use the updating commands, you must structure your Texinfo file
|
||||
hierarchically, such that each `@node' line, with the exception of the
|
||||
Top node, is accompanied by some kind of section line, such as an
|
||||
`@chapter' or `@section' line.
|
||||
|
||||
If the file has a `top' node, it must be called `top' or `Top' and
|
||||
be the first node in the file.
|
||||
|
||||
Entering Texinfo mode calls the value of text-mode-hook, and then the
|
||||
value of texinfo-mode-hook."
|
||||
(interactive)
|
||||
(text-mode)
|
||||
(setq mode-name "Texinfo")
|
||||
(setq major-mode 'texinfo-mode)
|
||||
(use-local-map texinfo-mode-map)
|
||||
(set-syntax-table texinfo-mode-syntax-table)
|
||||
(make-local-variable 'page-delimiter)
|
||||
(setq page-delimiter
|
||||
(concat
|
||||
"^@node [ \t]*[Tt]op\\|^@\\("
|
||||
texinfo-chapter-level-regexp
|
||||
"\\)"))
|
||||
(make-local-variable 'require-final-newline)
|
||||
(setq require-final-newline t)
|
||||
(make-local-variable 'indent-tabs-mode)
|
||||
(setq indent-tabs-mode nil)
|
||||
(make-local-variable 'paragraph-separate)
|
||||
(setq paragraph-separate
|
||||
(concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-separate))
|
||||
(make-local-variable 'paragraph-start)
|
||||
(setq paragraph-start (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-start))
|
||||
(make-local-variable 'fill-column)
|
||||
(setq fill-column 72)
|
||||
(make-local-variable 'comment-start)
|
||||
(setq comment-start "@c ")
|
||||
(make-local-variable 'comment-start-skip)
|
||||
(setq comment-start-skip "@c +")
|
||||
(make-local-variable 'words-include-escapes)
|
||||
(setq words-include-escapes t)
|
||||
(make-local-variable 'imenu-generic-expression)
|
||||
(setq imenu-generic-expression texinfo-imenu-generic-expression)
|
||||
(make-local-variable 'font-lock-defaults)
|
||||
(setq font-lock-defaults '(texinfo-font-lock-keywords t))
|
||||
(make-local-variable 'outline-regexp)
|
||||
(setq outline-regexp
|
||||
(concat "@\\("
|
||||
(mapconcat 'car texinfo-section-list "\\>\\|")
|
||||
"\\>\\)"))
|
||||
(make-local-variable 'outline-level)
|
||||
(setq outline-level 'texinfo-outline-level)
|
||||
(make-local-variable 'tex-start-of-header)
|
||||
(setq tex-start-of-header "%\\*\\*start")
|
||||
(make-local-variable 'tex-end-of-header)
|
||||
(setq tex-end-of-header "%\\*\\*end")
|
||||
(make-local-variable 'tex-first-line-header-regexp)
|
||||
(setq tex-first-line-header-regexp "^\\\\input")
|
||||
(make-local-variable 'tex-trailer)
|
||||
(setq tex-trailer "@bye\n")
|
||||
(run-hooks 'text-mode-hook 'texinfo-mode-hook))
|
||||
|
||||
|
||||
;;; Insert string commands
|
||||
|
||||
;; Keep as concatinated lists for ease of maintenance
|
||||
(defconst texinfo-environment-regexp
|
||||
(concat
|
||||
"^@"
|
||||
"\\("
|
||||
"cartouche\\|"
|
||||
"display\\|"
|
||||
"end\\|"
|
||||
"enumerate\\|"
|
||||
"example\\|"
|
||||
"f?table\\|"
|
||||
"flushleft\\|"
|
||||
"flushright\\|"
|
||||
"format\\|"
|
||||
"group\\|"
|
||||
"ifhtml\\|"
|
||||
"ifinfo\\|"
|
||||
"iftex\\|"
|
||||
"ignore\\|"
|
||||
"itemize\\|"
|
||||
"lisp\\|"
|
||||
"macro\\|"
|
||||
"multitable\\|"
|
||||
"quotation\\|"
|
||||
"smallexample\\|"
|
||||
"smalllisp\\|"
|
||||
"tex"
|
||||
"\\)")
|
||||
"Regexp for environment-like TexInfo list commands.
|
||||
Subexpression 1 is what goes into the corresponding `@end' statement.")
|
||||
|
||||
;; The following texinfo-insert-@end command not only inserts a SPC
|
||||
;; after the @end, but tries to find out what belongs there. It is
|
||||
;; not very smart: it does not understand nested lists.
|
||||
|
||||
(defun texinfo-insert-@end ()
|
||||
"Insert the matching `@end' for the last Texinfo command that needs one."
|
||||
(interactive)
|
||||
(let ((depth 1) string)
|
||||
(save-excursion
|
||||
(while (and (> depth 0)
|
||||
(re-search-backward texinfo-environment-regexp nil t))
|
||||
(if (looking-at "@end")
|
||||
(setq depth (1+ depth))
|
||||
(setq depth (1- depth))))
|
||||
(looking-at texinfo-environment-regexp)
|
||||
(if (zerop depth)
|
||||
(setq string
|
||||
(buffer-substring (match-beginning 1)
|
||||
(match-end 1)))))
|
||||
(insert "@end ")
|
||||
(if string (insert string "\n"))))
|
||||
|
||||
;; The following insert commands accept a prefix arg N, which is the
|
||||
;; number of words (actually s-exprs) that should be surrounded by
|
||||
;; braces. Thus you can first paste a variable name into a .texinfo
|
||||
;; buffer, then say C-u 1 C-c C-c v at the beginning of the just
|
||||
;; pasted variable name to put @var{...} *around* the variable name.
|
||||
;; Operate on previous word or words with negative arg.
|
||||
|
||||
;; These commands use texinfo-insert-@-with-arg
|
||||
(defun texinfo-insert-@-with-arg (string &optional arg)
|
||||
(if arg
|
||||
(progn
|
||||
(setq arg (prefix-numeric-value arg))
|
||||
(if (< arg 0)
|
||||
(progn
|
||||
(skip-chars-backward " \t\n\r\f")
|
||||
(save-excursion
|
||||
(forward-sexp arg)
|
||||
(insert "@" string "{"))
|
||||
(insert "}"))
|
||||
(skip-chars-forward " \t\n\r\f")
|
||||
(insert "@" string "{")
|
||||
(forward-sexp arg)
|
||||
(insert "}")))
|
||||
(insert "@" string "{}")
|
||||
(backward-char)))
|
||||
|
||||
(defun texinfo-insert-braces ()
|
||||
"Make a pair of braces and be poised to type inside of them.
|
||||
Use \\[up-list] to move forward out of the braces."
|
||||
(interactive)
|
||||
(insert "{}")
|
||||
(backward-char))
|
||||
|
||||
(defun texinfo-insert-@code (&optional arg)
|
||||
"Insert a `@code{...}' command in a Texinfo buffer.
|
||||
A numeric argument says how many words the braces should surround.
|
||||
The default is not to surround any existing words with the braces."
|
||||
(interactive "P")
|
||||
(texinfo-insert-@-with-arg "code" arg))
|
||||
|
||||
(defun texinfo-insert-@dfn (&optional arg)
|
||||
"Insert a `@dfn{...}' command in a Texinfo buffer.
|
||||
A numeric argument says how many words the braces should surround.
|
||||
The default is not to surround any existing words with the braces."
|
||||
(interactive "P")
|
||||
(texinfo-insert-@-with-arg "dfn" arg))
|
||||
|
||||
(defun texinfo-insert-@example ()
|
||||
"Insert the string `@example' in a Texinfo buffer."
|
||||
(interactive)
|
||||
(insert "@example\n"))
|
||||
|
||||
(defun texinfo-insert-@file (&optional arg)
|
||||
"Insert a `@file{...}' command in a Texinfo buffer.
|
||||
A numeric argument says how many words the braces should surround.
|
||||
The default is not to surround any existing words with the braces."
|
||||
(interactive "P")
|
||||
(texinfo-insert-@-with-arg "file" arg))
|
||||
|
||||
(defun texinfo-insert-@item ()
|
||||
"Insert the string `@item' in a Texinfo buffer."
|
||||
(interactive)
|
||||
(insert "@item")
|
||||
(newline))
|
||||
|
||||
(defun texinfo-insert-@kbd (&optional arg)
|
||||
"Insert a `@kbd{...}' command in a Texinfo buffer.
|
||||
A numeric argument says how many words the braces should surround.
|
||||
The default is not to surround any existing words with the braces."
|
||||
(interactive "P")
|
||||
(texinfo-insert-@-with-arg "kbd" arg))
|
||||
|
||||
(defun texinfo-insert-@node ()
|
||||
"Insert the string `@node' in a Texinfo buffer.
|
||||
This also inserts on the following line a comment indicating
|
||||
the order of arguments to @node."
|
||||
(interactive)
|
||||
(insert "@node \n@comment node-name, next, previous, up")
|
||||
(forward-line -1)
|
||||
(forward-char 6))
|
||||
|
||||
(defun texinfo-insert-@noindent ()
|
||||
"Insert the string `@noindent' in a Texinfo buffer."
|
||||
(interactive)
|
||||
(insert "@noindent\n"))
|
||||
|
||||
(defun texinfo-insert-@samp (&optional arg)
|
||||
"Insert a `@samp{...}' command in a Texinfo buffer.
|
||||
A numeric argument says how many words the braces should surround.
|
||||
The default is not to surround any existing words with the braces."
|
||||
(interactive "P")
|
||||
(texinfo-insert-@-with-arg "samp" arg))
|
||||
|
||||
(defun texinfo-insert-@table (&optional arg)
|
||||
"Insert the string `@table' in a Texinfo buffer."
|
||||
(interactive "P")
|
||||
(insert "@table "))
|
||||
|
||||
(defun texinfo-insert-@var (&optional arg)
|
||||
"Insert a `@var{}' command in a Texinfo buffer.
|
||||
A numeric argument says how many words the braces should surround.
|
||||
The default is not to surround any existing words with the braces."
|
||||
(interactive "P")
|
||||
(texinfo-insert-@-with-arg "var" arg))
|
||||
|
||||
;;; Texinfo file structure
|
||||
|
||||
;; These are defined in texnfo-upd.el. defvars here avoid warnings.
|
||||
(defvar texinfo-section-types-regexp)
|
||||
(defvar texinfo-section-level-regexp)
|
||||
(defvar texinfo-subsection-level-regexp)
|
||||
(defvar texinfo-subsubsection-level-regexp)
|
||||
|
||||
(defun texinfo-show-structure (&optional nodes-too)
|
||||
"Show the structure of a Texinfo file.
|
||||
List the lines in the file that begin with the @-sign commands for
|
||||
@chapter, @section, and the like.
|
||||
|
||||
With optional argument (prefix if interactive), list both the lines
|
||||
with @-sign commands for @chapter, @section, and the like, and list
|
||||
@node lines.
|
||||
|
||||
Lines with structuring commands beginning in them are displayed in
|
||||
another buffer named `*Occur*'. In that buffer, you can move point to
|
||||
one of those lines and then use \\<occur-mode-map>\\[occur-mode-goto-occurrence],
|
||||
to jump to the corresponding spot in the Texinfo source file."
|
||||
|
||||
(interactive "P")
|
||||
(require 'texnfo-upd)
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(if nodes-too
|
||||
(occur (concat "\\(^@node\\)\\|" texinfo-section-types-regexp))
|
||||
(occur texinfo-section-types-regexp)))
|
||||
(pop-to-buffer "*Occur*")
|
||||
(goto-char (point-min))
|
||||
(flush-lines "-----")
|
||||
;; Now format the "*Occur*" buffer to show the structure.
|
||||
;; Thanks to ceder@signum.se (Per Cederqvist)
|
||||
(goto-char (point-max))
|
||||
(let ((margin 5))
|
||||
(while (re-search-backward "^ *[0-9]*:" nil 0)
|
||||
(re-search-forward ":")
|
||||
(setq margin
|
||||
(cond
|
||||
((looking-at
|
||||
(concat "@\\(" texinfo-chapter-level-regexp "\\)")) 5)
|
||||
;; ((looking-at "@chapter ") 5)
|
||||
;; ((looking-at "@unnumbered ") 5)
|
||||
;; ((looking-at "@appendix ") 5)
|
||||
;; ((looking-at "@majorheading ") 5)
|
||||
;; ((looking-at "@chapheading ") 5)
|
||||
|
||||
((looking-at
|
||||
(concat "@\\(" texinfo-section-level-regexp "\\)")) 9)
|
||||
;; ((looking-at "@section ") 9)
|
||||
;; ((looking-at "@unnumberedsec ") 9)
|
||||
;; ((looking-at "@appendixsec ") 9)
|
||||
;; ((looking-at "@heading ") 9)
|
||||
|
||||
((looking-at
|
||||
(concat "@\\(" texinfo-subsection-level-regexp "\\)")) 13)
|
||||
;; ((looking-at "@subsection ") 13)
|
||||
;; ((looking-at "@unnumberedsubsec ") 13)
|
||||
;; ((looking-at "@appendixsubsec ") 13)
|
||||
;; ((looking-at "@subheading ") 13)
|
||||
|
||||
((looking-at
|
||||
(concat "@\\(" texinfo-subsubsection-level-regexp "\\)")) 17)
|
||||
;; ((looking-at "@subsubsection ") 17)
|
||||
;; ((looking-at "@unnumberedsubsubsec ") 17)
|
||||
;; ((looking-at "@appendixsubsubsec ") 17)
|
||||
;; ((looking-at "@subsubheading ") 17)
|
||||
(t margin)))
|
||||
(indent-to-column margin)
|
||||
(beginning-of-line))))
|
||||
|
||||
;;; The tex and print function definitions:
|
||||
|
||||
(defcustom texinfo-texi2dvi-command "texi2dvi"
|
||||
"*Command used by `texinfo-tex-buffer' to run TeX and texindex on a buffer."
|
||||
:type 'string
|
||||
:group 'texinfo)
|
||||
|
||||
(defcustom texinfo-tex-command "tex"
|
||||
"*Command used by `texinfo-tex-region' to run TeX on a region."
|
||||
:type 'string
|
||||
:group 'texinfo)
|
||||
|
||||
(defcustom texinfo-texindex-command "texindex"
|
||||
"*Command used by `texinfo-texindex' to sort unsorted index files."
|
||||
:type 'string
|
||||
:group 'texinfo)
|
||||
|
||||
(defcustom texinfo-delete-from-print-queue-command "lprm"
|
||||
"*Command string used to delete a job from the line printer queue.
|
||||
Command is used by \\[texinfo-delete-from-print-queue] based on
|
||||
number provided by a previous \\[tex-show-print-queue]
|
||||
command."
|
||||
:type 'string
|
||||
:group 'texinfo)
|
||||
|
||||
(defvar texinfo-tex-trailer "@bye"
|
||||
"String appended after a region sent to TeX by `texinfo-tex-region'.")
|
||||
|
||||
(defun texinfo-tex-region (beg end)
|
||||
"Run TeX on the current region.
|
||||
This works by writing a temporary file (`tex-zap-file') in the directory
|
||||
that is the value of `tex-directory', then running TeX on that file.
|
||||
|
||||
The first line of the buffer is copied to the
|
||||
temporary file; and if the buffer has a header, it is written to the
|
||||
temporary file before the region itself. The buffer's header is all lines
|
||||
between the strings defined by `tex-start-of-header' and `tex-end-of-header'
|
||||
inclusive. The header must start in the first 100 lines.
|
||||
|
||||
The value of `texinfo-tex-trailer' is appended to the temporary file after the region."
|
||||
(interactive "r")
|
||||
(require 'tex-mode)
|
||||
(let ((tex-command texinfo-tex-command)
|
||||
(tex-trailer "@bye\n"))
|
||||
(tex-region beg end)))
|
||||
|
||||
(defun texinfo-tex-buffer ()
|
||||
"Run TeX on visited file, once or twice, to make a correct `.dvi' file."
|
||||
(interactive)
|
||||
(require 'tex-mode)
|
||||
(let ((tex-command texinfo-texi2dvi-command))
|
||||
(tex-buffer)))
|
||||
|
||||
(defun texinfo-texindex ()
|
||||
"Run `texindex' on unsorted index files.
|
||||
The index files are made by \\[texinfo-tex-region] or \\[texinfo-tex-buffer].
|
||||
This runs the shell command defined by `texinfo-texindex-command'."
|
||||
(interactive)
|
||||
(require 'tex-mode)
|
||||
(tex-send-command texinfo-texindex-command (concat tex-zap-file ".??"))
|
||||
;; alternatively
|
||||
;; (send-string "tex-shell"
|
||||
;; (concat texinfo-texindex-command
|
||||
;; " " tex-zap-file ".??" "\n"))
|
||||
(tex-recenter-output-buffer nil))
|
||||
|
||||
(defun texinfo-tex-print ()
|
||||
"Print `.dvi' file made by \\[texinfo-tex-region] or \\[texinfo-tex-buffer].
|
||||
This runs the shell command defined by `tex-dvi-print-command'."
|
||||
(interactive)
|
||||
(require 'tex-mode)
|
||||
(tex-print))
|
||||
|
||||
(defun texinfo-tex-view ()
|
||||
"View `.dvi' file made by \\[texinfo-tex-region] or \\[texinfo-tex-buffer].
|
||||
This runs the shell command defined by `tex-dvi-view-command'."
|
||||
(interactive)
|
||||
(require 'tex-mode)
|
||||
(tex-view))
|
||||
|
||||
(defun texinfo-quit-job ()
|
||||
"Quit currently running TeX job, by sending an `x' to it."
|
||||
(interactive)
|
||||
(if (not (get-process "tex-shell"))
|
||||
(error "No TeX shell running"))
|
||||
(tex-send-command "x"))
|
||||
;; alternatively:
|
||||
;; save-excursion
|
||||
;; (set-buffer (get-buffer "*tex-shell*"))
|
||||
;; (goto-char (point-max))
|
||||
;; (insert "x")
|
||||
;; (comint-send-input)
|
||||
|
||||
(defun texinfo-delete-from-print-queue (job-number)
|
||||
"Delete job from the line printer spooling queue.
|
||||
You are prompted for the job number (use a number shown by a previous
|
||||
\\[tex-show-print-queue] command)."
|
||||
(interactive "nPrinter job number for deletion: ")
|
||||
(require 'tex-mode)
|
||||
(if (tex-shell-running)
|
||||
(tex-kill-job)
|
||||
(tex-start-shell))
|
||||
(tex-send-command texinfo-delete-from-print-queue-command job-number)
|
||||
;; alternatively
|
||||
;; (send-string "tex-shell"
|
||||
;; (concat
|
||||
;; texinfo-delete-from-print-queue-command
|
||||
;; " "
|
||||
;; job-number"\n"))
|
||||
(tex-recenter-output-buffer nil))
|
||||
|
||||
(provide 'texinfo)
|
||||
|
||||
;;; texinfo.el ends here
|
|
@ -1,346 +0,0 @@
|
|||
;;;; texnfo-tex.el
|
||||
|
||||
;;; Texinfo mode TeX and hardcopy printing commands.
|
||||
|
||||
;; These commands are for running TeX on a region of a Texinfo file in
|
||||
;; GNU Emacs, or on the whole buffer, and for printing the resulting
|
||||
;; DVI file.
|
||||
|
||||
;;; Version 2.07 22 October 1991
|
||||
;;; Robert J. Chassell
|
||||
;;; Please send bug reports to: bug-texinfo@prep.ai.mit.edu
|
||||
|
||||
;;; Copyright (C) 1989, 1990, 1991 Free Software Foundation, Inc.
|
||||
|
||||
|
||||
;;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation; either version 2, or (at your option)
|
||||
;; any later version.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to
|
||||
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
|
||||
|
||||
;;; The Texinfo mode TeX related commands are:
|
||||
|
||||
; texinfo-tex-region to run tex on the current region.
|
||||
; texinfo-tex-buffer to run tex on the current buffer.
|
||||
; texinfo-texindex to sort unsorted index files.
|
||||
; texinfo-tex-print to print the .dvi file made by tex.
|
||||
; texinfo-kill-tex-job to kill the currently running tex job.
|
||||
; texinfo-recenter-tex-output-buffer to redisplay tex output buffer.
|
||||
; texinfo-show-tex-print-queue to show the print queue.
|
||||
|
||||
|
||||
;;; Keys common both to Texinfo mode and to TeX shell.
|
||||
|
||||
;; Defined in `texinfo.el'
|
||||
; (defun texinfo-define-common-keys (keymap)
|
||||
; "Define the keys both in Texinfo mode and in the texinfo-tex-shell."
|
||||
; (define-key keymap "\C-c\C-t\C-k" 'texinfo-kill-tex-job)
|
||||
; (define-key keymap "\C-c\C-t\C-x" 'texinfo-quit-tex-job)
|
||||
; (define-key keymap "\C-c\C-t\C-l" 'texinfo-recenter-tex-output-buffer)
|
||||
; (define-key keymap "\C-c\C-t\C-d" 'texinfo-delete-from-tex-print-queue)
|
||||
; (define-key keymap "\C-c\C-t\C-q" 'texinfo-show-tex-print-queue)
|
||||
; (define-key keymap "\C-c\C-t\C-p" 'texinfo-tex-print)
|
||||
; (define-key keymap "\C-c\C-t\C-i" 'texinfo-texindex)
|
||||
; (define-key keymap "\C-c\C-t\C-r" 'texinfo-tex-region)
|
||||
; (define-key keymap "\C-c\C-t\C-b" 'texinfo-tex-buffer))
|
||||
|
||||
;; See also texinfo-tex-start-shell.
|
||||
;; The following is executed in the `texinfo.el' file
|
||||
;(texinfo-define-common-keys texinfo-mode-map)
|
||||
|
||||
|
||||
;;; Variable definitions:
|
||||
|
||||
(require 'shell)
|
||||
|
||||
(defvar texinfo-tex-shell-cd-command "cd"
|
||||
"Command to give to shell running TeX to change directory.")
|
||||
|
||||
(defvar texinfo-tex-command "tex"
|
||||
"*Command used by texinfo-tex-region to run tex on a region.")
|
||||
|
||||
(defvar texinfo-texindex-command "texindex"
|
||||
"*Command used by texinfo-texindex to sort unsorted index files.")
|
||||
|
||||
(defvar texinfo-tex-dvi-print-command "lpr -d"
|
||||
"*Command string used by \\[tex-print] to print a .dvi file.")
|
||||
|
||||
(defvar texinfo-show-tex-queue-command "lpq"
|
||||
"*Command string used to show the Texinfo TeX print queue.
|
||||
Command is used by \\[texinfo-show-tex-print-queue] and it
|
||||
should show the queue that \\[texinfo-tex-print] puts jobs on.")
|
||||
|
||||
(defvar texinfo-delete-from-print-queue-command "lprm"
|
||||
"*Command string used to delete a job from the line printer queue.
|
||||
Command is used by \\[texinfo-delete-from-tex-print-queue] based on
|
||||
number provided by a previous \\[texinfo-show-tex-print-queue]
|
||||
command.")
|
||||
|
||||
(defvar texinfo-tex-trailer "@bye"
|
||||
"String appended after a region sent to TeX by texinfo-tex-region.")
|
||||
|
||||
(defvar texinfo-tex-original-file ""
|
||||
"Original name of file on which to run TeX.")
|
||||
|
||||
(defvar texinfo-tex-temp-file nil
|
||||
"Temporary file name used for text being sent as input to TeX.")
|
||||
|
||||
(defvar texinfo-tex-root-temp-file nil
|
||||
"Temporary file name used for text being sent as input to TeX.")
|
||||
|
||||
|
||||
;;; Texinfo TeX main functions
|
||||
|
||||
(defun texinfo-tex-region (beginning end)
|
||||
"Run tex on the current region.
|
||||
|
||||
A temporary file is written in the default directory, and tex is run
|
||||
in that directory. The first line of the file is copied to the
|
||||
temporary file; and if the buffer has a header, it is written to the
|
||||
temporary file before the region itself. The buffer's header is all
|
||||
lines between the strings defined by texinfo-start-of-header and
|
||||
texinfo-end-of-header inclusive. The header must start in the first 100
|
||||
lines. The value of texinfo-tex-trailer is appended to the temporary file
|
||||
after the region."
|
||||
|
||||
(interactive "r")
|
||||
(if (get-buffer "*texinfo-tex-shell*")
|
||||
(quit-process (get-process "texinfo-tex-shell") t)
|
||||
(texinfo-tex-start-shell))
|
||||
|
||||
(setq texinfo-tex-root-temp-file
|
||||
(expand-file-name
|
||||
(make-temp-name
|
||||
(prin1-to-string (read (buffer-name))))))
|
||||
|
||||
(let ((texinfo-tex-temp-file (concat texinfo-tex-root-temp-file ".tex")))
|
||||
(save-excursion
|
||||
(save-restriction
|
||||
(widen)
|
||||
(goto-char (point-min))
|
||||
(forward-line 100)
|
||||
(let ((search-end (point))
|
||||
(header-beginning (point-min)) (header-end (point-min)))
|
||||
(goto-char (point-min))
|
||||
;; Copy first line, the `\input texinfo' line, to temp file
|
||||
(write-region (point)
|
||||
(save-excursion (forward-line 1) (point))
|
||||
texinfo-tex-temp-file nil nil)
|
||||
;; Don't copy first line twice if region includes it.
|
||||
(forward-line 1)
|
||||
(if (< beginning (point)) (setq beginning (point)))
|
||||
;; Initialize the temp file with either the header or nothing
|
||||
(if (search-forward texinfo-start-of-header search-end t)
|
||||
(progn
|
||||
(beginning-of-line)
|
||||
(setq header-beginning (point)) ; Mark beginning of header.
|
||||
(if (search-forward texinfo-end-of-header nil t)
|
||||
(progn (beginning-of-line)
|
||||
(setq header-end (point))) ; Mark end of header.
|
||||
(setq header-beginning (point-min))))) ; Else no header.
|
||||
;; Copy header to temp file.
|
||||
(write-region
|
||||
(min header-beginning beginning )
|
||||
header-end
|
||||
texinfo-tex-temp-file t nil)
|
||||
;; Copy region to temp file.
|
||||
(write-region
|
||||
(max beginning header-end)
|
||||
end
|
||||
texinfo-tex-temp-file t nil)
|
||||
;; This is a kludge to insert the texinfo-tex-trailer into the
|
||||
;; texinfo-tex-temp-file. We have to create a special buffer
|
||||
;; in which to insert the texinfo-tex-trailer first because there is
|
||||
;; no function with which to append a literal string directly
|
||||
;; to a file.
|
||||
(let ((local-tex-trailer texinfo-tex-trailer)
|
||||
(temp-buffer (get-buffer-create " texinfo-trailer-buffer")))
|
||||
(set-buffer temp-buffer)
|
||||
(erase-buffer)
|
||||
;; make sure trailer isn't hidden by a comment
|
||||
(insert-string "\n")
|
||||
(if local-tex-trailer (insert local-tex-trailer))
|
||||
(write-region (point-min) (point-max)
|
||||
texinfo-tex-temp-file t nil)))
|
||||
(set-process-sentinel (get-process "texinfo-tex-shell")
|
||||
'texinfo-tex-shell-sentinel)
|
||||
(send-string "texinfo-tex-shell"
|
||||
(concat texinfo-tex-shell-cd-command " "
|
||||
default-directory "\n"))
|
||||
(send-string "texinfo-tex-shell"
|
||||
(concat texinfo-tex-command " "
|
||||
texinfo-tex-temp-file "\n "))
|
||||
(texinfo-recenter-tex-output-buffer 0)))))
|
||||
|
||||
(defun texinfo-tex-buffer (buffer)
|
||||
"Run TeX on current buffer.
|
||||
After running TeX the first time, you may have to run \\[texinfo-texindex]
|
||||
and then \\[texinfo-tex-buffer] again."
|
||||
(interactive
|
||||
(list
|
||||
;; Sometimes you put point into *texinfo-tex-shell*; this prompts
|
||||
;; you for the correct file regardless.
|
||||
(if (and
|
||||
(string= (buffer-name (current-buffer)) "*texinfo-tex-shell*")
|
||||
texinfo-tex-root-temp-file)
|
||||
(read-string (format "Run TeX on: ")
|
||||
texinfo-tex-original-file)
|
||||
(read-string (format "Run TeX on: ") (buffer-name (current-buffer))))))
|
||||
|
||||
;; Set to original buffer if in *texinfo-tex-shell*; otherwise,
|
||||
;; record name of current buffer.
|
||||
(if (string= (buffer-name (current-buffer)) "*texinfo-tex-shell*")
|
||||
(set-buffer buffer)
|
||||
(setq texinfo-tex-original-file
|
||||
(buffer-name (current-buffer))))
|
||||
|
||||
(if (get-buffer "*texinfo-tex-shell*")
|
||||
(quit-process (get-process "texinfo-tex-shell") t)
|
||||
(texinfo-tex-start-shell))
|
||||
(cond ((null buffer-file-name)
|
||||
(error "Buffer not visiting any file!"))
|
||||
((buffer-modified-p)
|
||||
(error "Buffer has been modified since last saved!"))
|
||||
(t (set-process-sentinel (get-process "texinfo-tex-shell")
|
||||
'texinfo-tex-shell-sentinel)
|
||||
(send-string "texinfo-tex-shell"
|
||||
(concat texinfo-tex-shell-cd-command
|
||||
" "
|
||||
(file-name-directory
|
||||
(buffer-file-name
|
||||
(get-buffer buffer)))
|
||||
"\n"))
|
||||
(send-string "texinfo-tex-shell"
|
||||
(concat texinfo-tex-command " " buffer "\n "))
|
||||
|
||||
;; so the texinfo-tex-print command works
|
||||
(setq texinfo-tex-root-temp-file
|
||||
(substring buffer 0
|
||||
(or (string-match "\\.tex" buffer)
|
||||
(length buffer))))
|
||||
|
||||
(texinfo-recenter-tex-output-buffer 0))))
|
||||
|
||||
(defun texinfo-texindex ()
|
||||
"Run texindex on unsorted index files.
|
||||
The index files are made by \\[texinfo-tex-region] or \\[texinfo-tex-buffer].
|
||||
Runs the shell command defined by texinfo-texindex-command."
|
||||
(interactive)
|
||||
(send-string "texinfo-tex-shell"
|
||||
(concat texinfo-texindex-command
|
||||
" " texinfo-tex-root-temp-file ".??" "\n"))
|
||||
(texinfo-recenter-tex-output-buffer nil))
|
||||
|
||||
(defun texinfo-tex-print ()
|
||||
"Print .dvi file made by \\[texinfo-tex-region] or \\[texinfo-tex-buffer].
|
||||
Runs the shell command defined by texinfo-tex-dvi-print-command."
|
||||
(interactive)
|
||||
(send-string "texinfo-tex-shell"
|
||||
(concat texinfo-tex-dvi-print-command
|
||||
" " texinfo-tex-root-temp-file ".dvi" "\n"))
|
||||
(texinfo-recenter-tex-output-buffer nil))
|
||||
|
||||
|
||||
;;; Texinfo TeX utility functions
|
||||
|
||||
(defun texinfo-tex-start-shell ()
|
||||
(save-excursion
|
||||
(require 'texinfo)
|
||||
(set-buffer (make-shell "texinfo-tex-shell" "/bin/sh" nil "-v"))
|
||||
(setq texinfo-tex-shell-map (copy-keymap shell-mode-map))
|
||||
(texinfo-define-common-keys texinfo-tex-shell-map)
|
||||
(use-local-map texinfo-tex-shell-map)
|
||||
(run-hooks 'texinfo-tex-shell-hook)
|
||||
(if (zerop (buffer-size))
|
||||
(sleep-for 1))))
|
||||
|
||||
(defun texinfo-quit-tex-job ()
|
||||
"Quit currently running TeX job, by sending an `x' to it."
|
||||
(interactive)
|
||||
(if (not (get-process "texinfo-tex-shell"))
|
||||
(error "No TeX shell running."))
|
||||
(save-excursion
|
||||
(set-buffer (get-buffer "*texinfo-tex-shell*"))
|
||||
(goto-char (point-max))
|
||||
(insert "x")
|
||||
(shell-send-input)))
|
||||
|
||||
(defun texinfo-kill-tex-job ()
|
||||
"Kill the currently running TeX job."
|
||||
(interactive)
|
||||
(if (get-process "texinfo-tex-shell")
|
||||
;; Use `texinfo-tex-shell-sentinel' to restart
|
||||
;; texinfo-tex-shell after it is killed.
|
||||
(kill-process (get-process "texinfo-tex-shell"))))
|
||||
|
||||
(defun texinfo-tex-shell-sentinel (process event)
|
||||
"Restart texinfo-tex-shell after it is killed."
|
||||
(if (equal event "killed\n")
|
||||
(save-excursion
|
||||
(set-buffer "*texinfo-tex-shell*")
|
||||
(insert "\n")
|
||||
(texinfo-tex-start-shell))))
|
||||
|
||||
(defun texinfo-recenter-tex-output-buffer (linenum)
|
||||
"Redisplay buffer of TeX job output so that most recent output can be seen.
|
||||
The last line of the buffer is displayed on
|
||||
line LINE of the window, or centered if LINE is nil."
|
||||
(interactive "P")
|
||||
(let ((texinfo-tex-shell (get-buffer "*texinfo-tex-shell*"))
|
||||
(old-buffer (current-buffer)))
|
||||
(if (null texinfo-tex-shell)
|
||||
(message "No TeX output buffer")
|
||||
(pop-to-buffer texinfo-tex-shell)
|
||||
(bury-buffer texinfo-tex-shell)
|
||||
(goto-char (point-max))
|
||||
(recenter (if linenum
|
||||
(prefix-numeric-value linenum)
|
||||
(/ (window-height) 2)))
|
||||
(pop-to-buffer old-buffer)
|
||||
)))
|
||||
|
||||
(defun texinfo-show-tex-print-queue ()
|
||||
"Show the print queue that \\[texinfo-tex-print] put your job on.
|
||||
Runs the shell command defined by texinfo-show-tex-queue-command."
|
||||
(interactive)
|
||||
(if (not (texinfo-tex-shell-running-p))
|
||||
(texinfo-tex-start-shell))
|
||||
(send-string "texinfo-tex-shell"
|
||||
(concat texinfo-show-tex-queue-command "\n"))
|
||||
(texinfo-recenter-tex-output-buffer nil))
|
||||
|
||||
(defun texinfo-delete-from-tex-print-queue (job-number)
|
||||
"Delete job from the line printer spooling queue.
|
||||
You are prompted for the job number (shown by a previous
|
||||
\\[texinfo-show-tex-print-queue] command."
|
||||
(interactive "nPrinter job number for deletion: ")
|
||||
(if (texinfo-tex-shell-running-p)
|
||||
(texinfo-kill-tex-job)
|
||||
(texinfo-tex-start-shell))
|
||||
(send-string "texinfo-tex-shell"
|
||||
(concat
|
||||
texinfo-delete-from-print-queue-command
|
||||
" "
|
||||
job-number"\n"))
|
||||
(texinfo-recenter-tex-output-buffer nil))
|
||||
|
||||
(defun texinfo-tex-shell-running-p ()
|
||||
(and (get-process "texinfo-tex-shell")
|
||||
(eq (process-status (get-process "texinfo-tex-shell")) 'run)))
|
||||
|
||||
|
||||
;;; Place `provide' at end of file.
|
||||
(provide 'texnfo-tex)
|
||||
;;;;;;;;;;;;;;;; end texnfo-tex.el ;;;;;;;;;;;;;;;;
|
File diff suppressed because it is too large
Load diff
|
@ -1,101 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# generate an Info directory, given a directory of Info files and a
|
||||
# list of entries. The output will be suitable for a dir.info file,
|
||||
# in the order given in the skeleton file
|
||||
|
||||
INFODIR=$1
|
||||
if [ $# = 2 ] ; then
|
||||
SKELETON=$2
|
||||
else
|
||||
SKELETON=/dev/null
|
||||
fi
|
||||
|
||||
skip=
|
||||
|
||||
if [ $# -gt 2 ] ; then
|
||||
echo usage: $0 info-directory [ skeleton-file ] 1>&2
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
if [ ! -d ${INFODIR} ] ; then
|
||||
echo "$0: first argument must specify a directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
infofiles=`(cd ${INFODIR}; ls *.info | sort | sed "s/dir\.info//")`
|
||||
template=`cat ${SKELETON}`
|
||||
|
||||
### output the dir.info header
|
||||
echo "-*- Text -*-"
|
||||
echo "This file was generated automatically by the gen-info-dir script."
|
||||
echo "This version was generated on `date`"
|
||||
echo "by `whoami`@`hostname` for `(cd ${INFODIR}; pwd)`"
|
||||
|
||||
cat << moobler
|
||||
|
||||
This is the file .../info/dir, which contains the topmost node of the
|
||||
Info hierarchy. The first time you invoke Info you start off
|
||||
looking at that node, which is (dir)Top.
|
||||
|
||||
File: dir Node: Top This is the top of the INFO tree
|
||||
This (the Directory node) gives a menu of major topics.
|
||||
Typing "d" returns here, "q" exits, "?" lists all INFO commands, "h"
|
||||
gives a primer for first-timers, "mTexinfo<Return>" visits Texinfo topic,
|
||||
etc.
|
||||
--- PLEASE ADD DOCUMENTATION TO THIS TREE. (See INFO topic first.) ---
|
||||
|
||||
* Menu: The list of major topics begins on the next line.
|
||||
|
||||
moobler
|
||||
|
||||
|
||||
### go through the list of files in the template. If an info file
|
||||
### exists, grab the ENTRY information from it. If there is no entry
|
||||
### info, then create a minimal dir entry, otherwise use the given info.
|
||||
###
|
||||
### Then remove that file from the list of existing files. If any
|
||||
### additional files remain (ones that don't have a template entry),
|
||||
### then generate entries for those in the same way, putting the info for
|
||||
### those at the very end....
|
||||
|
||||
for file in ${template} ; do
|
||||
if [ "${file}" = "--" ] ; then
|
||||
skip=1
|
||||
else
|
||||
if [ -f ${INFODIR}/${file}.info ] ; then
|
||||
entry=`sed -e '1,/START-INFO-DIR-ENTRY/d' -e '/END-INFO-DIR-ENTRY/,$d' ${INFODIR}/${file}.info`
|
||||
if [ ! -z "${skip}" ] ; then
|
||||
echo
|
||||
skip=
|
||||
fi
|
||||
|
||||
if [ ! -z "${entry}" ] ; then
|
||||
echo "${entry}"
|
||||
else
|
||||
echo "* ${file}: (${file})."
|
||||
fi
|
||||
|
||||
infofiles=`echo ${infofiles} | sed -e "s/${file}\.info//"`
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "${infofiles}" ] ; then
|
||||
exit 0
|
||||
else
|
||||
echo
|
||||
fi
|
||||
|
||||
for file in ${infofiles}; do
|
||||
entry=`sed -e '1,/START-INFO-DIR-ENTRY/d' -e '/END-INFO-DIR-ENTRY/,$d' ${INFODIR}/${file}`
|
||||
|
||||
if [ ! -z "${entry}" ] ; then
|
||||
echo "${entry}"
|
||||
else
|
||||
echo "* ${file}: (${file})."
|
||||
fi
|
||||
done
|
||||
|
|
@ -1,398 +0,0 @@
|
|||
@c This GPL is meant to be included from other files.
|
||||
@c To format a standalone GPL, use license.texi.
|
||||
|
||||
@center Version 2, June 1991
|
||||
|
||||
@display
|
||||
Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc. 675
|
||||
Mass Ave, 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
|
||||
|
||||
@unnumberedsec 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.
|
||||
|
||||
@iftex
|
||||
@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
@end iftex
|
||||
@ifinfo
|
||||
@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
@end ifinfo
|
||||
|
||||
@enumerate 0
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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:
|
||||
|
||||
@enumerate a
|
||||
@item
|
||||
You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.)
|
||||
@end enumerate
|
||||
|
||||
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.
|
||||
|
||||
@item
|
||||
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:
|
||||
|
||||
@enumerate a
|
||||
@item
|
||||
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,
|
||||
|
||||
@item
|
||||
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,
|
||||
|
||||
@item
|
||||
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.)
|
||||
@end enumerate
|
||||
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@iftex
|
||||
@vskip -@baselineskip
|
||||
@vskip -@baselineskip
|
||||
@heading NO WARRANTY
|
||||
@end iftex
|
||||
@ifinfo
|
||||
@center NO WARRANTY
|
||||
@end ifinfo
|
||||
|
||||
@item
|
||||
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.
|
||||
|
||||
@item
|
||||
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 enumerate
|
||||
|
||||
@iftex
|
||||
@heading END OF TERMS AND CONDITIONS
|
||||
@end iftex
|
||||
@ifinfo
|
||||
@center END OF TERMS AND CONDITIONS
|
||||
@end ifinfo
|
||||
|
||||
@page
|
||||
@unnumberedsec 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.
|
||||
|
||||
@smallexample
|
||||
@var{one line to give the program's name and an idea of what it does.}
|
||||
Copyright (C) 19@var{yy} @var{name of author}
|
||||
|
||||
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.
|
||||
@end smallexample
|
||||
|
||||
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:
|
||||
|
||||
@smallexample
|
||||
Gnomovision version 69, Copyright (C) 19@var{yy} @var{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.
|
||||
@end smallexample
|
||||
|
||||
The hypothetical commands @samp{show w} and @samp{show c} should show
|
||||
the appropriate parts of the General Public License. Of course, the
|
||||
commands you use may be called something other than @samp{show w} and
|
||||
@samp{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:
|
||||
|
||||
@example
|
||||
@group
|
||||
Yoyodyne, Inc., hereby disclaims all copyright
|
||||
interest in the program `Gnomovision'
|
||||
(which makes passes at compilers) written
|
||||
by James Hacker.
|
||||
|
||||
@var{signature of Ty Coon}, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
@end group
|
||||
@end example
|
||||
|
||||
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.
|
|
@ -1,45 +0,0 @@
|
|||
## Makefile.am for texinfo/info.
|
||||
## $Id: Makefile.am,v 1.1.1.2 1998/03/24 18:20:06 law Exp $
|
||||
## Run automake in .. to produce Makefile.in from this.
|
||||
|
||||
noinst_PROGRAMS = makedoc
|
||||
|
||||
# Use `ginfo' for building to avoid confusion with the standard `info'
|
||||
# target. The install rule removes the `g' before applying any
|
||||
# user-specified name transformations.
|
||||
bin_PROGRAMS = ginfo
|
||||
transform = s/ginfo/info/; @program_transform_name@
|
||||
|
||||
localedir = $(datadir)/locale
|
||||
|
||||
# -I. for funs.h.
|
||||
# Automake puts -I.. and -I$(srcdir) into DEFS by default, but
|
||||
# we need to override it, so include them ourselves.
|
||||
INCLUDES = -I. -I$(top_srcdir)/lib -I../intl -I.. -I$(srcdir)
|
||||
DEFS = -DINFODIR=\"$(infodir)\" -DLOCALEDIR=\"$(localedir)\" @DEFS@
|
||||
LDADD = ../lib/libtxi.a @TERMLIBS@ @INTLLIBS@
|
||||
|
||||
makedoc_SOURCES = makedoc.c
|
||||
ginfo_SOURCES = dir.c display.c display.h doc.c doc.h dribble.c dribble.h \
|
||||
echo-area.c echo-area.h \
|
||||
filesys.c filesys.h footnotes.c footnotes.h funs.h gc.c gc.h \
|
||||
indices.c indices.h info-utils.c info-utils.h info.c info.h infodoc.c \
|
||||
infomap.c infomap.h m-x.c man.c man.h nodemenu.c nodes.c nodes.h \
|
||||
search.c search.h session.c session.h signals.c signals.h \
|
||||
termdep.h terminal.c terminal.h tilde.c tilde.h \
|
||||
variables.c variables.h window.c window.h
|
||||
|
||||
EXTRA_DIST = README
|
||||
|
||||
# The files `doc.c' and `funs.h' are created by ./makedoc run over the source
|
||||
# files which contain DECLARE_INFO_COMMAND. `funs.h' is a header file
|
||||
# listing the functions found. `doc.c' is a structure containing pointers
|
||||
# to those functions along with completable names and documentation strings.
|
||||
BUILT_SOURCES = doc.c funs.h
|
||||
|
||||
cmd_sources = $(srcdir)/session.c $(srcdir)/echo-area.c $(srcdir)/infodoc.c \
|
||||
$(srcdir)/m-x.c $(srcdir)/indices.c $(srcdir)/nodemenu.c \
|
||||
$(srcdir)/footnotes.c $(srcdir)/variables.c
|
||||
|
||||
$(BUILT_SOURCES): makedoc $(cmd_sources)
|
||||
./makedoc $(cmd_sources)
|
|
@ -1,345 +0,0 @@
|
|||
# Makefile.in generated automatically by automake 1.3 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DISTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
CATALOGS = @CATALOGS@
|
||||
CATOBJEXT = @CATOBJEXT@
|
||||
CC = @CC@
|
||||
DATADIRNAME = @DATADIRNAME@
|
||||
EXEEXT = @EXEEXT@
|
||||
GENCAT = @GENCAT@
|
||||
GMOFILES = @GMOFILES@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GT_NO = @GT_NO@
|
||||
GT_YES = @GT_YES@
|
||||
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTOBJEXT = @INSTOBJEXT@
|
||||
INTLDEPS = @INTLDEPS@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTLOBJS = @INTLOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
PACKAGE = @PACKAGE@
|
||||
POFILES = @POFILES@
|
||||
POSUB = @POSUB@
|
||||
RANLIB = @RANLIB@
|
||||
TERMLIBS = @TERMLIBS@
|
||||
TEXCONFIG = @TEXCONFIG@
|
||||
TEXMF = @TEXMF@
|
||||
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
l = @l@
|
||||
|
||||
noinst_PROGRAMS = makedoc
|
||||
|
||||
# Use `ginfo' for building to avoid confusion with the standard `info'
|
||||
# target. The install rule removes the `g' before applying any
|
||||
# user-specified name transformations.
|
||||
bin_PROGRAMS = ginfo
|
||||
transform = s/ginfo/info/; @program_transform_name@
|
||||
|
||||
localedir = $(datadir)/locale
|
||||
|
||||
# -I. for funs.h.
|
||||
# Automake puts -I.. and -I$(srcdir) into DEFS by default, but
|
||||
# we need to override it, so include them ourselves.
|
||||
INCLUDES = -I. -I$(top_srcdir)/lib -I../intl -I.. -I$(srcdir)
|
||||
DEFS = -DINFODIR=\"$(infodir)\" -DLOCALEDIR=\"$(localedir)\" @DEFS@
|
||||
LDADD = ../lib/libtxi.a @TERMLIBS@ @INTLLIBS@
|
||||
|
||||
makedoc_SOURCES = makedoc.c
|
||||
ginfo_SOURCES = dir.c display.c display.h doc.c doc.h dribble.c dribble.h \
|
||||
echo-area.c echo-area.h \
|
||||
filesys.c filesys.h footnotes.c footnotes.h funs.h gc.c gc.h \
|
||||
indices.c indices.h info-utils.c info-utils.h info.c info.h infodoc.c \
|
||||
infomap.c infomap.h m-x.c man.c man.h nodemenu.c nodes.c nodes.h \
|
||||
search.c search.h session.c session.h signals.c signals.h \
|
||||
termdep.h terminal.c terminal.h tilde.c tilde.h \
|
||||
variables.c variables.h window.c window.h
|
||||
|
||||
EXTRA_DIST = README
|
||||
|
||||
# The files `doc.c' and `funs.h' are created by ./makedoc run over the source
|
||||
# files which contain DECLARE_INFO_COMMAND. `funs.h' is a header file
|
||||
# listing the functions found. `doc.c' is a structure containing pointers
|
||||
# to those functions along with completable names and documentation strings.
|
||||
BUILT_SOURCES = doc.c funs.h
|
||||
|
||||
cmd_sources = $(srcdir)/session.c $(srcdir)/echo-area.c $(srcdir)/infodoc.c \
|
||||
$(srcdir)/m-x.c $(srcdir)/indices.c $(srcdir)/nodemenu.c \
|
||||
$(srcdir)/footnotes.c $(srcdir)/variables.c
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
bin_PROGRAMS = ginfo$(EXEEXT)
|
||||
noinst_PROGRAMS = makedoc$(EXEEXT)
|
||||
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
|
||||
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
ginfo_OBJECTS = dir.o display.o doc.o dribble.o echo-area.o filesys.o \
|
||||
footnotes.o gc.o indices.o info-utils.o info.o infodoc.o infomap.o \
|
||||
m-x.o man.o nodemenu.o nodes.o search.o session.o signals.o terminal.o \
|
||||
tilde.o variables.o window.o
|
||||
ginfo_LDADD = $(LDADD)
|
||||
ginfo_DEPENDENCIES = ../lib/libtxi.a
|
||||
ginfo_LDFLAGS =
|
||||
makedoc_OBJECTS = makedoc.o
|
||||
makedoc_LDADD = $(LDADD)
|
||||
makedoc_DEPENDENCIES = ../lib/libtxi.a
|
||||
makedoc_LDFLAGS =
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
DIST_COMMON = README Makefile.am Makefile.in NEWS
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP = --best
|
||||
SOURCES = $(ginfo_SOURCES) $(makedoc_SOURCES)
|
||||
OBJECTS = $(ginfo_OBJECTS) $(makedoc_OBJECTS)
|
||||
|
||||
all: Makefile $(PROGRAMS)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .o .s
|
||||
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps info/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
mostlyclean-binPROGRAMS:
|
||||
|
||||
clean-binPROGRAMS:
|
||||
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
|
||||
|
||||
distclean-binPROGRAMS:
|
||||
|
||||
maintainer-clean-binPROGRAMS:
|
||||
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
|
||||
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
|
||||
done
|
||||
|
||||
mostlyclean-noinstPROGRAMS:
|
||||
|
||||
clean-noinstPROGRAMS:
|
||||
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
|
||||
|
||||
distclean-noinstPROGRAMS:
|
||||
|
||||
maintainer-clean-noinstPROGRAMS:
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.S.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.o core *.core
|
||||
|
||||
clean-compile:
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
maintainer-clean-compile:
|
||||
|
||||
ginfo$(EXEEXT): $(ginfo_OBJECTS) $(ginfo_DEPENDENCIES)
|
||||
@rm -f ginfo$(EXEEXT)
|
||||
$(LINK) $(ginfo_LDFLAGS) $(ginfo_OBJECTS) $(ginfo_LDADD) $(LIBS)
|
||||
|
||||
makedoc$(EXEEXT): $(makedoc_OBJECTS) $(makedoc_DEPENDENCIES)
|
||||
@rm -f makedoc$(EXEEXT)
|
||||
$(LINK) $(makedoc_LDFLAGS) $(makedoc_OBJECTS) $(makedoc_LDADD) $(LIBS)
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = info
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file; \
|
||||
done
|
||||
info:
|
||||
dvi:
|
||||
check: all
|
||||
$(MAKE)
|
||||
installcheck:
|
||||
install-exec: install-binPROGRAMS
|
||||
@$(NORMAL_INSTALL)
|
||||
|
||||
install-data:
|
||||
@$(NORMAL_INSTALL)
|
||||
|
||||
install: install-exec install-data all
|
||||
@:
|
||||
|
||||
uninstall: uninstall-binPROGRAMS
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DATADIR)$(bindir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(DISTCLEANFILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
mostlyclean: mostlyclean-binPROGRAMS mostlyclean-noinstPROGRAMS \
|
||||
mostlyclean-compile mostlyclean-tags \
|
||||
mostlyclean-generic
|
||||
|
||||
clean: clean-binPROGRAMS clean-noinstPROGRAMS clean-compile clean-tags \
|
||||
clean-generic mostlyclean
|
||||
|
||||
distclean: distclean-binPROGRAMS distclean-noinstPROGRAMS \
|
||||
distclean-compile distclean-tags distclean-generic \
|
||||
clean
|
||||
-rm -f config.status
|
||||
|
||||
maintainer-clean: maintainer-clean-binPROGRAMS \
|
||||
maintainer-clean-noinstPROGRAMS \
|
||||
maintainer-clean-compile maintainer-clean-tags \
|
||||
maintainer-clean-generic distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
|
||||
maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
|
||||
mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
|
||||
clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
|
||||
mostlyclean-compile distclean-compile clean-compile \
|
||||
maintainer-clean-compile tags mostlyclean-tags distclean-tags \
|
||||
clean-tags maintainer-clean-tags distdir info dvi installcheck \
|
||||
install-exec install-data install uninstall all installdirs \
|
||||
mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
$(BUILT_SOURCES): makedoc $(cmd_sources)
|
||||
./makedoc $(cmd_sources)
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -1,200 +0,0 @@
|
|||
This release of Info is version 2.11. Please read the file README.
|
||||
|
||||
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.
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
Info 2.0 is a complete rewrite of the original standalone Info I wrote in
|
||||
1987, the first program I wrote for rms. That program was something like
|
||||
my second Unix program ever, and my die-hard machine language coding habits
|
||||
tended to show through. I found the original Info hard to read and
|
||||
maintain, and thus decided to write this one.
|
||||
|
||||
The rewrite consists of about 12,000 lines of code written in about 12
|
||||
days. I believe this version of Info to be in much better shape than the
|
||||
original Info.
|
||||
|
||||
Info 2.0 is substantially different from its original standalone
|
||||
predecessor. It appears almost identical to the GNU Emacs version, but has
|
||||
the advantages of smaller size, ease of portability, and a built in library
|
||||
which can be used in other programs (to get or display documentation from
|
||||
Info files, for example).
|
||||
|
||||
I eagerly await responses to this newer version of Info; comments on its
|
||||
portability, ease of use and user interface, code quality, and general
|
||||
usefulness are all of interest to me, and I will appreciate any comments
|
||||
that you would care to make.
|
||||
|
||||
A full listing of the commands available in Info can be gotten by typing
|
||||
`?' while within an Info window. This produces a node in a window which
|
||||
can be viewed just like any Info node.
|
||||
|
||||
--Brian Fox <bfox@gnu.org>
|
|
@ -1,112 +0,0 @@
|
|||
/* clib.c: Functions which we normally expect to find in the C library.
|
||||
$Id: clib.c,v 1.1.1.1 1997/08/21 22:57:59 jason Exp $
|
||||
|
||||
This file is part of GNU Info, a program for reading online documentation
|
||||
stored in Info format.
|
||||
|
||||
Copyright (C) 1995 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 <stdio.h>
|
||||
|
||||
#if defined (HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined (HAVE_STDLIB_H)
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#if defined (HAVE_STRING_H)
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include <sys/errno.h>
|
||||
|
||||
extern void *xmalloc (), *xrealloc ();
|
||||
#include "general.h"
|
||||
|
||||
#if !defined (errno)
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#if !defined (HAVE_STRERROR)
|
||||
extern char *sys_errlist[];
|
||||
extern int sys_nerr;
|
||||
|
||||
char *
|
||||
strerror (num)
|
||||
int num;
|
||||
{
|
||||
if (num >= sys_nerr)
|
||||
return ("");
|
||||
else
|
||||
return (sys_errlist[num]);
|
||||
}
|
||||
#endif /* !HAVE_STRERROR */
|
||||
|
||||
#if !defined (HAVE_STRCASECMP)
|
||||
/* This Unix doesn't have the strcasecmp () function. */
|
||||
int
|
||||
strcasecmp (string1, string2)
|
||||
char *string1, *string2;
|
||||
{
|
||||
char ch1, ch2;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
ch1 = *string1++;
|
||||
ch2 = *string2++;
|
||||
|
||||
if (!(ch1 | ch2))
|
||||
return (0);
|
||||
|
||||
ch1 = info_toupper (ch1);
|
||||
ch2 = info_toupper (ch2);
|
||||
|
||||
if (ch1 != ch2)
|
||||
return (ch1 - ch2);
|
||||
}
|
||||
}
|
||||
|
||||
/* Compare at most COUNT characters from string1 to string2. Case
|
||||
doesn't matter. */
|
||||
int
|
||||
strncasecmp (string1, string2, count)
|
||||
char *string1, *string2;
|
||||
int count;
|
||||
{
|
||||
register char ch1, ch2;
|
||||
|
||||
while (count)
|
||||
{
|
||||
ch1 = *string1++;
|
||||
ch2 = *string2++;
|
||||
|
||||
ch1 = info_toupper (ch1);
|
||||
ch2 = info_toupper (ch2);
|
||||
|
||||
if (ch1 == ch2)
|
||||
count--;
|
||||
else
|
||||
break;
|
||||
}
|
||||
return (count);
|
||||
}
|
||||
#endif /* !STRCASECMP */
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
/* clib.h: Declarations of functions which appear in clib.c (or libc.a). */
|
||||
|
||||
/* This file is part of GNU Info, a program for reading online documentation
|
||||
stored in Info format.
|
||||
|
||||
Copyright (C) 1995 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 (_CLIB_H_)
|
||||
#define _CLIB_H_
|
||||
|
||||
#if !defined (HAVE_STRDUP)
|
||||
extern char *strdup ();
|
||||
#endif
|
||||
|
||||
#if !defined (HAVE_STRERROR)
|
||||
extern char *strerror ();
|
||||
#endif
|
||||
|
||||
#if !defined (HAVE_STRCASECMP)
|
||||
extern int strcasecmp ();
|
||||
extern int strncasecmp ();
|
||||
#endif
|
||||
|
||||
#endif /* !_CLIB_H_ */
|
||||
|
||||
|
|
@ -1,293 +0,0 @@
|
|||
/* dir.c -- How to build a special "dir" node from "localdir" files.
|
||||
$Id: dir.c,v 1.1.1.2 1998/03/22 20:42:22 law Exp $
|
||||
|
||||
Copyright (C) 1993, 97 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 "info-utils.h"
|
||||
#include "filesys.h"
|
||||
#include "tilde.h"
|
||||
|
||||
/* The "dir" node can be built from the contents of a file called "dir",
|
||||
with the addition of the menus of every file named in the array
|
||||
dirs_to_add which are found in INFOPATH. */
|
||||
|
||||
static void add_menu_to_file_buffer (), insert_text_into_fb_at_binding ();
|
||||
|
||||
static char *dirs_to_add[] = {
|
||||
"dir", "localdir", (char *)NULL
|
||||
};
|
||||
|
||||
|
||||
/* Return zero if the file represented in the stat structure TEST has
|
||||
already been seen, nonzero else. */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned long device;
|
||||
unsigned long inode;
|
||||
} dir_file_list_entry_type;
|
||||
|
||||
static int
|
||||
new_dir_file_p (test)
|
||||
struct stat *test;
|
||||
{
|
||||
static unsigned dir_file_list_len = 0;
|
||||
static dir_file_list_entry_type *dir_file_list = NULL;
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < dir_file_list_len; i++)
|
||||
{
|
||||
dir_file_list_entry_type entry;
|
||||
entry = dir_file_list[i];
|
||||
if (entry.device == test->st_dev && entry.inode == test->st_ino)
|
||||
return 0;
|
||||
}
|
||||
|
||||
dir_file_list_len++;
|
||||
dir_file_list = xrealloc (dir_file_list,
|
||||
dir_file_list_len * sizeof (dir_file_list_entry_type));
|
||||
dir_file_list[dir_file_list_len - 1].device = test->st_dev;
|
||||
dir_file_list[dir_file_list_len - 1].inode = test->st_ino;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
maybe_build_dir_node (dirname)
|
||||
char *dirname;
|
||||
{
|
||||
int path_index, update_tags;
|
||||
char *this_dir;
|
||||
FILE_BUFFER *dir_buffer = info_find_file (dirname);
|
||||
|
||||
/* If there is no "dir" in the current info path, we cannot build one
|
||||
from nothing. */
|
||||
if (!dir_buffer)
|
||||
return;
|
||||
|
||||
/* If this directory has already been built, return now. */
|
||||
if (dir_buffer->flags & N_CannotGC)
|
||||
return;
|
||||
|
||||
/* Initialize the list we use to avoid reading the same dir file twice
|
||||
with the dir file just found. */
|
||||
new_dir_file_p (&dir_buffer->finfo);
|
||||
|
||||
path_index = update_tags = 0;
|
||||
|
||||
/* Using each element of the path, check for one of the files in
|
||||
DIRS_TO_ADD. Do not check for "localdir.info.Z" or anything else.
|
||||
Only files explictly named are eligible. This is a design decision.
|
||||
There can be an info file name "localdir.info" which contains
|
||||
information on the setting up of "localdir" files. */
|
||||
while ((this_dir = extract_colon_unit (infopath, &path_index)))
|
||||
{
|
||||
register int da_index;
|
||||
char *from_file;
|
||||
|
||||
/* Expand a leading tilde if one is present. */
|
||||
if (*this_dir == '~')
|
||||
{
|
||||
char *tilde_expanded_dirname;
|
||||
|
||||
tilde_expanded_dirname = tilde_expand_word (this_dir);
|
||||
if (tilde_expanded_dirname != this_dir)
|
||||
{
|
||||
free (this_dir);
|
||||
this_dir = tilde_expanded_dirname;
|
||||
}
|
||||
}
|
||||
|
||||
/* For every different file named in DIRS_TO_ADD found in the
|
||||
search path, add that file's menu to our "dir" node. */
|
||||
for (da_index = 0; (from_file = dirs_to_add[da_index]); da_index++)
|
||||
{
|
||||
struct stat finfo;
|
||||
int statable;
|
||||
int namelen = strlen (from_file);
|
||||
char *fullpath = xmalloc (3 + strlen (this_dir) + namelen);
|
||||
|
||||
strcpy (fullpath, this_dir);
|
||||
if (fullpath[strlen (fullpath) - 1] != '/')
|
||||
strcat (fullpath, "/");
|
||||
strcat (fullpath, from_file);
|
||||
|
||||
statable = (stat (fullpath, &finfo) == 0);
|
||||
|
||||
/* Only add this file if we have not seen it before. */
|
||||
if (statable && S_ISREG (finfo.st_mode) && new_dir_file_p (&finfo))
|
||||
{
|
||||
long filesize;
|
||||
char *contents = filesys_read_info_file (fullpath, &filesize,
|
||||
&finfo);
|
||||
if (contents)
|
||||
{
|
||||
update_tags++;
|
||||
add_menu_to_file_buffer (contents, filesize, dir_buffer);
|
||||
free (contents);
|
||||
}
|
||||
}
|
||||
|
||||
free (fullpath);
|
||||
}
|
||||
free (this_dir);
|
||||
}
|
||||
|
||||
if (update_tags)
|
||||
build_tags_and_nodes (dir_buffer);
|
||||
|
||||
/* Flag that the dir buffer has been built. */
|
||||
dir_buffer->flags |= N_CannotGC;
|
||||
}
|
||||
|
||||
/* Given CONTENTS and FB (a file buffer), add the menu found in CONTENTS
|
||||
to the menu found in FB->contents. Second argument SIZE is the total
|
||||
size of CONTENTS. */
|
||||
static void
|
||||
add_menu_to_file_buffer (contents, size, fb)
|
||||
char *contents;
|
||||
long size;
|
||||
FILE_BUFFER *fb;
|
||||
{
|
||||
SEARCH_BINDING contents_binding, fb_binding;
|
||||
long contents_offset, fb_offset;
|
||||
|
||||
contents_binding.buffer = contents;
|
||||
contents_binding.start = 0;
|
||||
contents_binding.end = size;
|
||||
contents_binding.flags = S_FoldCase | S_SkipDest;
|
||||
|
||||
fb_binding.buffer = fb->contents;
|
||||
fb_binding.start = 0;
|
||||
fb_binding.end = fb->filesize;
|
||||
fb_binding.flags = S_FoldCase | S_SkipDest;
|
||||
|
||||
/* Move to the start of the menus in CONTENTS and FB. */
|
||||
contents_offset = search_forward (INFO_MENU_LABEL, &contents_binding);
|
||||
fb_offset = search_forward (INFO_MENU_LABEL, &fb_binding);
|
||||
|
||||
/* If there is no menu in CONTENTS, quit now. */
|
||||
if (contents_offset == -1)
|
||||
return;
|
||||
|
||||
/* There is a menu in CONTENTS, and contents_offset points to the first
|
||||
character following the menu starter string. Skip all whitespace
|
||||
and newline characters. */
|
||||
contents_offset += skip_whitespace_and_newlines (contents + contents_offset);
|
||||
|
||||
/* If there is no menu in FB, make one. */
|
||||
if (fb_offset == -1)
|
||||
{
|
||||
/* Find the start of the second node in this file buffer. If there
|
||||
is only one node, we will be adding the contents to the end of
|
||||
this node. */
|
||||
fb_offset = find_node_separator (&fb_binding);
|
||||
|
||||
/* If not even a single node separator, give up. */
|
||||
if (fb_offset == -1)
|
||||
return;
|
||||
|
||||
fb_binding.start = fb_offset;
|
||||
fb_binding.start +=
|
||||
skip_node_separator (fb_binding.buffer + fb_binding.start);
|
||||
|
||||
/* Try to find the next node separator. */
|
||||
fb_offset = find_node_separator (&fb_binding);
|
||||
|
||||
/* If found one, consider that the start of the menu. Otherwise, the
|
||||
start of this menu is the end of the file buffer (i.e., fb->size). */
|
||||
if (fb_offset != -1)
|
||||
fb_binding.start = fb_offset;
|
||||
else
|
||||
fb_binding.start = fb_binding.end;
|
||||
|
||||
insert_text_into_fb_at_binding
|
||||
(fb, &fb_binding, INFO_MENU_LABEL, strlen (INFO_MENU_LABEL));
|
||||
|
||||
fb_binding.buffer = fb->contents;
|
||||
fb_binding.start = 0;
|
||||
fb_binding.end = fb->filesize;
|
||||
fb_offset = search_forward (INFO_MENU_LABEL, &fb_binding);
|
||||
if (fb_offset == -1)
|
||||
abort ();
|
||||
}
|
||||
|
||||
/* CONTENTS_OFFSET and FB_OFFSET point to the starts of the menus that
|
||||
appear in their respective buffers. Add the remainder of CONTENTS
|
||||
to the end of FB's menu. */
|
||||
fb_binding.start = fb_offset;
|
||||
fb_offset = find_node_separator (&fb_binding);
|
||||
if (fb_offset != -1)
|
||||
fb_binding.start = fb_offset;
|
||||
else
|
||||
fb_binding.start = fb_binding.end;
|
||||
|
||||
/* Leave exactly one blank line between directory entries. */
|
||||
{
|
||||
int num_found = 0;
|
||||
|
||||
while ((fb_binding.start > 0) &&
|
||||
(whitespace_or_newline (fb_binding.buffer[fb_binding.start - 1])))
|
||||
{
|
||||
num_found++;
|
||||
fb_binding.start--;
|
||||
}
|
||||
|
||||
/* Optimize if possible. */
|
||||
if (num_found >= 2)
|
||||
{
|
||||
fb_binding.buffer[fb_binding.start++] = '\n';
|
||||
fb_binding.buffer[fb_binding.start++] = '\n';
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Do it the hard way. */
|
||||
insert_text_into_fb_at_binding (fb, &fb_binding, "\n\n", 2);
|
||||
fb_binding.start += 2;
|
||||
}
|
||||
}
|
||||
|
||||
/* Insert the new menu. */
|
||||
insert_text_into_fb_at_binding
|
||||
(fb, &fb_binding, contents + contents_offset, size - contents_offset);
|
||||
}
|
||||
|
||||
static void
|
||||
insert_text_into_fb_at_binding (fb, binding, text, textlen)
|
||||
FILE_BUFFER *fb;
|
||||
SEARCH_BINDING *binding;
|
||||
char *text;
|
||||
int textlen;
|
||||
{
|
||||
char *contents;
|
||||
long start, end;
|
||||
|
||||
start = binding->start;
|
||||
end = fb->filesize;
|
||||
|
||||
contents = (char *)xmalloc (fb->filesize + textlen + 1);
|
||||
memcpy (contents, fb->contents, start);
|
||||
memcpy (contents + start, text, textlen);
|
||||
memcpy (contents + start + textlen, fb->contents + start, end - start);
|
||||
free (fb->contents);
|
||||
fb->contents = contents;
|
||||
fb->filesize += textlen;
|
||||
fb->finfo.st_size = fb->filesize;
|
||||
}
|
|
@ -1,557 +0,0 @@
|
|||
/* display.c -- How to display Info windows.
|
||||
$Id: display.c,v 1.1.1.2 1998/03/22 20:42:23 law Exp $
|
||||
|
||||
Copyright (C) 1993, 97 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 "display.h"
|
||||
|
||||
extern int info_any_buffered_input_p (); /* Found in session.c. */
|
||||
|
||||
static void free_display ();
|
||||
static DISPLAY_LINE **make_display ();
|
||||
|
||||
/* An array of display lines which tell us what is currently visible on
|
||||
the display. */
|
||||
DISPLAY_LINE **the_display = (DISPLAY_LINE **)NULL;
|
||||
|
||||
/* Non-zero means do no output. */
|
||||
int display_inhibited = 0;
|
||||
|
||||
/* Initialize THE_DISPLAY to WIDTH and HEIGHT, with nothing in it. */
|
||||
void
|
||||
display_initialize_display (width, height)
|
||||
int width, height;
|
||||
{
|
||||
free_display (the_display);
|
||||
the_display = make_display (width, height);
|
||||
display_clear_display (the_display);
|
||||
}
|
||||
|
||||
/* Clear all of the lines in DISPLAY making the screen blank. */
|
||||
void
|
||||
display_clear_display (display)
|
||||
DISPLAY_LINE **display;
|
||||
{
|
||||
register int i;
|
||||
register DISPLAY_LINE *display_line;
|
||||
|
||||
for (i = 0; (display_line = display[i]); i++)
|
||||
{
|
||||
display[i]->text[0] = '\0';
|
||||
display[i]->textlen = 0;
|
||||
display[i]->inverse = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Non-zero if we didn't completely redisplay a window. */
|
||||
int display_was_interrupted_p = 0;
|
||||
|
||||
/* Update the windows pointed to by WINDOW in the_display. This actually
|
||||
writes the text on the screen. */
|
||||
void
|
||||
display_update_display (window)
|
||||
WINDOW *window;
|
||||
{
|
||||
register WINDOW *win;
|
||||
|
||||
display_was_interrupted_p = 0;
|
||||
|
||||
/* For every window in the list, check contents against the display. */
|
||||
for (win = window; win; win = win->next)
|
||||
{
|
||||
/* Only re-display visible windows which need updating. */
|
||||
if (((win->flags & W_WindowVisible) == 0) ||
|
||||
((win->flags & W_UpdateWindow) == 0) ||
|
||||
(win->height == 0))
|
||||
continue;
|
||||
|
||||
display_update_one_window (win);
|
||||
if (display_was_interrupted_p)
|
||||
break;
|
||||
}
|
||||
|
||||
/* Always update the echo area. */
|
||||
display_update_one_window (the_echo_area);
|
||||
}
|
||||
|
||||
/* Display WIN on the_display. Unlike display_update_display (), this
|
||||
function only does one window. */
|
||||
void
|
||||
display_update_one_window (win)
|
||||
WINDOW *win;
|
||||
{
|
||||
register char *nodetext; /* Current character to display. */
|
||||
register char *last_node_char; /* Position of the last character in node. */
|
||||
register int i; /* General use index. */
|
||||
char *printed_line; /* Buffer for a printed line. */
|
||||
int pl_index = 0; /* Index into PRINTED_LINE. */
|
||||
int line_index = 0; /* Number of lines done so far. */
|
||||
DISPLAY_LINE **display = the_display;
|
||||
|
||||
/* If display is inhibited, that counts as an interrupted display. */
|
||||
if (display_inhibited)
|
||||
display_was_interrupted_p = 1;
|
||||
|
||||
/* If the window has no height, or display is inhibited, quit now. */
|
||||
if (!win->height || display_inhibited)
|
||||
return;
|
||||
|
||||
/* If the window's first row doesn't appear in the_screen, then it
|
||||
cannot be displayed. This can happen when the_echo_area is the
|
||||
window to be displayed, and the screen has shrunk to less than one
|
||||
line. */
|
||||
if ((win->first_row < 0) || (win->first_row > the_screen->height))
|
||||
return;
|
||||
|
||||
/* Print each line in the window into our local buffer, and then
|
||||
check the contents of that buffer against the display. If they
|
||||
differ, update the display. */
|
||||
printed_line = (char *)xmalloc (1 + win->width);
|
||||
|
||||
if (!win->node || !win->line_starts)
|
||||
goto done_with_node_display;
|
||||
|
||||
nodetext = win->line_starts[win->pagetop];
|
||||
last_node_char = win->node->contents + win->node->nodelen;
|
||||
|
||||
for (; nodetext < last_node_char; nodetext++)
|
||||
{
|
||||
char *rep, *rep_carried_over, rep_temp[2];
|
||||
int replen;
|
||||
|
||||
if (isprint (*nodetext))
|
||||
{
|
||||
rep_temp[0] = *nodetext;
|
||||
replen = 1;
|
||||
rep_temp[1] = '\0';
|
||||
rep = rep_temp;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*nodetext == '\r' || *nodetext == '\n')
|
||||
{
|
||||
replen = win->width - pl_index;
|
||||
}
|
||||
else
|
||||
{
|
||||
rep = printed_representation (*nodetext, pl_index);
|
||||
replen = strlen (rep);
|
||||
}
|
||||
}
|
||||
|
||||
/* If this character can be printed without passing the width of
|
||||
the line, then stuff it into the line. */
|
||||
if (replen + pl_index < win->width)
|
||||
{
|
||||
/* Optimize if possible. */
|
||||
if (replen == 1)
|
||||
{
|
||||
printed_line[pl_index++] = *rep;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < replen; i++)
|
||||
printed_line[pl_index++] = rep[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DISPLAY_LINE *entry;
|
||||
|
||||
/* If this character cannot be printed in this line, we have
|
||||
found the end of this line as it would appear on the screen.
|
||||
Carefully print the end of the line, and then compare. */
|
||||
if (*nodetext == '\n' || *nodetext == '\r' || *nodetext == '\t')
|
||||
{
|
||||
printed_line[pl_index] = '\0';
|
||||
rep_carried_over = (char *)NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The printed representation of this character extends into
|
||||
the next line. Remember the offset of the last character
|
||||
printed out of REP so that we can carry the character over
|
||||
to the next line. */
|
||||
for (i = 0; pl_index < (win->width - 1);)
|
||||
printed_line[pl_index++] = rep[i++];
|
||||
|
||||
rep_carried_over = rep + i;
|
||||
|
||||
/* If printing the last character in this window couldn't
|
||||
possibly cause the screen to scroll, place a backslash
|
||||
in the rightmost column. */
|
||||
if (1 + line_index + win->first_row < the_screen->height)
|
||||
{
|
||||
if (win->flags & W_NoWrap)
|
||||
printed_line[pl_index++] = '$';
|
||||
else
|
||||
printed_line[pl_index++] = '\\';
|
||||
}
|
||||
printed_line[pl_index] = '\0';
|
||||
}
|
||||
|
||||
/* We have the exact line as it should appear on the screen.
|
||||
Check to see if this line matches the one already appearing
|
||||
on the screen. */
|
||||
entry = display[line_index + win->first_row];
|
||||
|
||||
/* If the screen line is inversed, then we have to clear
|
||||
the line from the screen first. Why, I don't know. */
|
||||
if (entry->inverse)
|
||||
{
|
||||
terminal_goto_xy (0, line_index + win->first_row);
|
||||
terminal_clear_to_eol ();
|
||||
entry->inverse = 0;
|
||||
entry->text[0] = '\0';
|
||||
entry->textlen = 0;
|
||||
}
|
||||
|
||||
/* Find the offset where these lines differ. */
|
||||
for (i = 0; i < pl_index; i++)
|
||||
if (printed_line[i] != entry->text[i])
|
||||
break;
|
||||
|
||||
/* If the lines are not the same length, or if they differed
|
||||
at all, we must do some redrawing. */
|
||||
if ((i != pl_index) || (pl_index != entry->textlen))
|
||||
{
|
||||
/* Move to the proper point on the terminal. */
|
||||
terminal_goto_xy (i, line_index + win->first_row);
|
||||
|
||||
/* If there is any text to print, print it. */
|
||||
if (i != pl_index)
|
||||
terminal_put_text (printed_line + i);
|
||||
|
||||
/* If the printed text didn't extend all the way to the edge
|
||||
of the window, and text was appearing between here and the
|
||||
edge of the window, clear from here to the end of the line. */
|
||||
if ((pl_index < win->width && pl_index < entry->textlen) ||
|
||||
(entry->inverse))
|
||||
terminal_clear_to_eol ();
|
||||
|
||||
fflush (stdout);
|
||||
|
||||
/* Update the display text buffer. */
|
||||
strcpy (entry->text + i, printed_line + i);
|
||||
entry->textlen = pl_index;
|
||||
|
||||
/* Lines showing node text are not in inverse. Only modelines
|
||||
have that distinction. */
|
||||
entry->inverse = 0;
|
||||
}
|
||||
|
||||
/* We have done at least one line. Increment our screen line
|
||||
index, and check against the bottom of the window. */
|
||||
if (++line_index == win->height)
|
||||
break;
|
||||
|
||||
/* A line has been displayed, and the screen reflects that state.
|
||||
If there is typeahead pending, then let that typeahead be read
|
||||
now, instead of continuing with the display. */
|
||||
if (info_any_buffered_input_p ())
|
||||
{
|
||||
free (printed_line);
|
||||
display_was_interrupted_p = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Reset PL_INDEX to the start of the line. */
|
||||
pl_index = 0;
|
||||
|
||||
/* If there are characters from REP left to print, stuff them
|
||||
into the buffer now. */
|
||||
if (rep_carried_over)
|
||||
for (; rep[pl_index]; pl_index++)
|
||||
printed_line[pl_index] = rep[pl_index];
|
||||
|
||||
/* If this window has chosen not to wrap lines, skip to the end
|
||||
of the physical line in the buffer, and start a new line here. */
|
||||
if (pl_index && (win->flags & W_NoWrap))
|
||||
{
|
||||
char *begin;
|
||||
|
||||
pl_index = 0;
|
||||
printed_line[0] = '\0';
|
||||
|
||||
begin = nodetext;
|
||||
|
||||
while ((nodetext < last_node_char) && (*nodetext != '\n'))
|
||||
nodetext++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
done_with_node_display:
|
||||
/* We have reached the end of the node or the end of the window. If it
|
||||
is the end of the node, then clear the lines of the window from here
|
||||
to the end of the window. */
|
||||
for (; line_index < win->height; line_index++)
|
||||
{
|
||||
DISPLAY_LINE *entry = display[line_index + win->first_row];
|
||||
|
||||
/* If this line has text on it then make it go away. */
|
||||
if (entry && entry->textlen)
|
||||
{
|
||||
entry->textlen = 0;
|
||||
entry->text[0] = '\0';
|
||||
|
||||
terminal_goto_xy (0, line_index + win->first_row);
|
||||
terminal_clear_to_eol ();
|
||||
}
|
||||
}
|
||||
|
||||
/* Finally, if this window has a modeline it might need to be redisplayed.
|
||||
Check the window's modeline against the one in the display, and update
|
||||
if necessary. */
|
||||
if ((win->flags & W_InhibitMode) == 0)
|
||||
{
|
||||
window_make_modeline (win);
|
||||
line_index = win->first_row + win->height;
|
||||
|
||||
/* This display line must both be in inverse, and have the same
|
||||
contents. */
|
||||
if ((!display[line_index]->inverse) ||
|
||||
(strcmp (display[line_index]->text, win->modeline) != 0))
|
||||
{
|
||||
terminal_goto_xy (0, line_index);
|
||||
terminal_begin_inverse ();
|
||||
terminal_put_text (win->modeline);
|
||||
terminal_end_inverse ();
|
||||
strcpy (display[line_index]->text, win->modeline);
|
||||
display[line_index]->inverse = 1;
|
||||
display[line_index]->textlen = strlen (win->modeline);
|
||||
fflush (stdout);
|
||||
}
|
||||
}
|
||||
|
||||
/* Okay, this window doesn't need updating anymore. */
|
||||
win->flags &= ~W_UpdateWindow;
|
||||
free (printed_line);
|
||||
fflush (stdout);
|
||||
}
|
||||
|
||||
/* Scroll the region of the_display starting at START, ending at END, and
|
||||
moving the lines AMOUNT lines. If AMOUNT is less than zero, the lines
|
||||
are moved up in the screen, otherwise down. Actually, it is possible
|
||||
for no scrolling to take place in the case that the terminal doesn't
|
||||
support it. This doesn't matter to us. */
|
||||
void
|
||||
display_scroll_display (start, end, amount)
|
||||
int start, end, amount;
|
||||
{
|
||||
register int i, last;
|
||||
DISPLAY_LINE *temp;
|
||||
|
||||
/* If this terminal cannot do scrolling, give up now. */
|
||||
if (!terminal_can_scroll)
|
||||
return;
|
||||
|
||||
/* If there isn't anything displayed on the screen because it is too
|
||||
small, quit now. */
|
||||
if (!the_display[0])
|
||||
return;
|
||||
|
||||
/* If there is typeahead pending, then don't actually do any scrolling. */
|
||||
if (info_any_buffered_input_p ())
|
||||
return;
|
||||
|
||||
/* Do it on the screen. */
|
||||
terminal_scroll_terminal (start, end, amount);
|
||||
|
||||
/* Now do it in the display buffer so our contents match the screen. */
|
||||
if (amount > 0)
|
||||
{
|
||||
last = end + amount;
|
||||
|
||||
/* Shift the lines to scroll right into place. */
|
||||
for (i = 0; i < (end - start); i++)
|
||||
{
|
||||
temp = the_display[last - i];
|
||||
the_display[last - i] = the_display[end - i];
|
||||
the_display[end - i] = temp;
|
||||
}
|
||||
|
||||
/* The lines have been shifted down in the buffer. Clear all of the
|
||||
lines that were vacated. */
|
||||
for (i = start; i != (start + amount); i++)
|
||||
{
|
||||
the_display[i]->text[0] = '\0';
|
||||
the_display[i]->textlen = 0;
|
||||
the_display[i]->inverse = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (amount < 0)
|
||||
{
|
||||
last = start + amount;
|
||||
for (i = 0; i < (end - start); i++)
|
||||
{
|
||||
temp = the_display[last + i];
|
||||
the_display[last + i] = the_display[start + i];
|
||||
the_display[start + i] = temp;
|
||||
}
|
||||
|
||||
/* The lines have been shifted up in the buffer. Clear all of the
|
||||
lines that are left over. */
|
||||
for (i = end + amount; i != end; i++)
|
||||
{
|
||||
the_display[i]->text[0] = '\0';
|
||||
the_display[i]->textlen = 0;
|
||||
the_display[i]->inverse = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Try to scroll lines in WINDOW. OLD_PAGETOP is the pagetop of WINDOW before
|
||||
having had its line starts recalculated. OLD_STARTS is the list of line
|
||||
starts that used to appear in this window. OLD_COUNT is the number of lines
|
||||
that appear in the OLD_STARTS array. */
|
||||
void
|
||||
display_scroll_line_starts (window, old_pagetop, old_starts, old_count)
|
||||
WINDOW *window;
|
||||
int old_pagetop, old_count;
|
||||
char **old_starts;
|
||||
{
|
||||
register int i, old, new; /* Indices into the line starts arrays. */
|
||||
int last_new, last_old; /* Index of the last visible line. */
|
||||
int old_first, new_first; /* Index of the first changed line. */
|
||||
int unchanged_at_top = 0;
|
||||
int already_scrolled = 0;
|
||||
|
||||
/* Locate the first line which was displayed on the old window. */
|
||||
old_first = old_pagetop;
|
||||
new_first = window->pagetop;
|
||||
|
||||
/* Find the last line currently visible in this window. */
|
||||
last_new = window->pagetop + (window->height - 1);
|
||||
if (last_new > window->line_count)
|
||||
last_new = window->line_count - 1;
|
||||
|
||||
/* Find the last line which used to be currently visible in this window. */
|
||||
last_old = old_pagetop + (window->height - 1);
|
||||
if (last_old > old_count)
|
||||
last_old = old_count - 1;
|
||||
|
||||
for (old = old_first, new = new_first;
|
||||
old < last_old && new < last_new;
|
||||
old++, new++)
|
||||
if (old_starts[old] != window->line_starts[new])
|
||||
break;
|
||||
else
|
||||
unchanged_at_top++;
|
||||
|
||||
/* Loop through the old lines looking for a match in the new lines. */
|
||||
for (old = old_first + unchanged_at_top; old < last_old; old++)
|
||||
{
|
||||
for (new = new_first; new < last_new; new++)
|
||||
if (old_starts[old] == window->line_starts[new])
|
||||
{
|
||||
/* Find the extent of the matching lines. */
|
||||
for (i = 0; (old + i) < last_old; i++)
|
||||
if (old_starts[old + i] != window->line_starts[new + i])
|
||||
break;
|
||||
|
||||
/* Scroll these lines if there are enough of them. */
|
||||
{
|
||||
int start, end, amount;
|
||||
|
||||
start = (window->first_row
|
||||
+ ((old + already_scrolled) - old_pagetop));
|
||||
amount = new - (old + already_scrolled);
|
||||
end = window->first_row + window->height;
|
||||
|
||||
/* If we are shifting the block of lines down, then the last
|
||||
AMOUNT lines will become invisible. Thus, don't bother
|
||||
scrolling them. */
|
||||
if (amount > 0)
|
||||
end -= amount;
|
||||
|
||||
if ((end - start) > 0)
|
||||
{
|
||||
display_scroll_display (start, end, amount);
|
||||
|
||||
/* Some lines have been scrolled. Simulate the scrolling
|
||||
by offsetting the value of the old index. */
|
||||
old += i;
|
||||
already_scrolled += amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Move the screen cursor to directly over the current character in WINDOW. */
|
||||
void
|
||||
display_cursor_at_point (window)
|
||||
WINDOW *window;
|
||||
{
|
||||
int vpos, hpos;
|
||||
|
||||
vpos = window_line_of_point (window) - window->pagetop + window->first_row;
|
||||
hpos = window_get_cursor_column (window);
|
||||
terminal_goto_xy (hpos, vpos);
|
||||
fflush (stdout);
|
||||
}
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
/* Functions Static to this File */
|
||||
/* */
|
||||
/* **************************************************************** */
|
||||
|
||||
/* Make a DISPLAY_LINE ** with width and height. */
|
||||
static DISPLAY_LINE **
|
||||
make_display (width, height)
|
||||
int width, height;
|
||||
{
|
||||
register int i;
|
||||
DISPLAY_LINE **display;
|
||||
|
||||
display = (DISPLAY_LINE **)xmalloc ((1 + height) * sizeof (DISPLAY_LINE *));
|
||||
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
display[i] = (DISPLAY_LINE *)xmalloc (sizeof (DISPLAY_LINE));
|
||||
display[i]->text = (char *)xmalloc (1 + width);
|
||||
display[i]->textlen = 0;
|
||||
display[i]->inverse = 0;
|
||||
}
|
||||
display[i] = (DISPLAY_LINE *)NULL;
|
||||
return (display);
|
||||
}
|
||||
|
||||
/* Free the storage allocated to DISPLAY. */
|
||||
static void
|
||||
free_display (display)
|
||||
DISPLAY_LINE **display;
|
||||
{
|
||||
register int i;
|
||||
register DISPLAY_LINE *display_line;
|
||||
|
||||
if (!display)
|
||||
return;
|
||||
|
||||
for (i = 0; (display_line = display[i]); i++)
|
||||
{
|
||||
free (display_line->text);
|
||||
free (display_line);
|
||||
}
|
||||
free (display);
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
/* display.h -- How the display in Info is done.
|
||||
$Id: display.h,v 1.1.1.2 1998/03/22 20:42:24 law 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.
|
||||
|
||||
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_DISPLAY_H
|
||||
#define INFO_DISPLAY_H
|
||||
|
||||
#include "info-utils.h"
|
||||
#include "terminal.h"
|
||||
|
||||
typedef struct {
|
||||
char *text; /* Text of the line as it appears. */
|
||||
int textlen; /* Printable Length of TEXT. */
|
||||
int inverse; /* Non-zero means this line is inverse. */
|
||||
} DISPLAY_LINE;
|
||||
|
||||
/* An array of display lines which tell us what is currently visible on
|
||||
the display. */
|
||||
extern DISPLAY_LINE **the_display;
|
||||
|
||||
/* Non-zero means do no output. */
|
||||
extern int display_inhibited;
|
||||
|
||||
/* Non-zero if we didn't completely redisplay a window. */
|
||||
extern int display_was_interrupted_p;
|
||||
|
||||
/* Initialize THE_DISPLAY to WIDTH and HEIGHT, with nothing in it. */
|
||||
extern void display_initialize_display ();
|
||||
|
||||
/* Clear all of the lines in DISPLAY making the screen blank. */
|
||||
extern void display_clear_display ();
|
||||
|
||||
/* Update the windows pointed to by WINDOWS in THE_DISPLAY. This actually
|
||||
writes the text on the screen. */
|
||||
extern void display_update_display ();
|
||||
|
||||
/* Display WIN on THE_DISPLAY. Unlike display_update_display (), this
|
||||
function only does one window. */
|
||||
extern void display_update_one_window ();
|
||||
|
||||
/* Move the screen cursor to directly over the current character in WINDOW. */
|
||||
extern void display_cursor_at_point ();
|
||||
|
||||
/* Scroll the region of the_display starting at START, ending at END, and
|
||||
moving the lines AMOUNT lines. If AMOUNT is less than zero, the lines
|
||||
are moved up in the screen, otherwise down. Actually, it is possible
|
||||
for no scrolling to take place in the case that the terminal doesn't
|
||||
support it. This doesn't matter to us. */
|
||||
extern void display_scroll_display ();
|
||||
|
||||
/* Try to scroll lines in WINDOW. OLD_PAGETOP is the pagetop of WINDOW before
|
||||
having had its line starts recalculated. OLD_STARTS is the list of line
|
||||
starts that used to appear in this window. OLD_COUNT is the number of lines
|
||||
that appear in the OLD_STARTS array. */
|
||||
extern void display_scroll_line_starts ();
|
||||
|
||||
#endif /* not INFO_DISPLAY_H */
|
|
@ -1,129 +0,0 @@
|
|||
/* doc.c -- Generated structure containing function names and doc strings.
|
||||
|
||||
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_DOC_ARRAY is made for each command
|
||||
found in the above files; each entry consists of a function pointer,
|
||||
a string which is the user-visible name of the function,
|
||||
and a string which documents its purpose. */
|
||||
|
||||
#include "doc.h"
|
||||
#include "funs.h"
|
||||
|
||||
FUNCTION_DOC function_doc_array[] = {
|
||||
|
||||
/* Commands found in "./session.c". */
|
||||
{ info_next_line, "next-line", "Move down to the next line" },
|
||||
{ info_prev_line, "prev-line", "Move up to the previous line" },
|
||||
{ info_end_of_line, "end-of-line", "Move to the end of the line" },
|
||||
{ info_beginning_of_line, "beginning-of-line", "Move to the start of the line" },
|
||||
{ info_forward_char, "forward-char", "Move forward a character" },
|
||||
{ info_backward_char, "backward-char", "Move backward a character" },
|
||||
{ info_forward_word, "forward-word", "Move forward a word" },
|
||||
{ info_backward_word, "backward-word", "Move backward a word" },
|
||||
{ info_global_next_node, "global-next-node", "Move forwards or down through node structure" },
|
||||
{ info_global_prev_node, "global-prev-node", "Move backwards or up through node structure" },
|
||||
{ info_scroll_forward, "scroll-forward", "Scroll forward in this window" },
|
||||
{ info_scroll_backward, "scroll-backward", "Scroll backward in this window" },
|
||||
{ info_beginning_of_node, "beginning-of-node", "Move to the start of this node" },
|
||||
{ info_end_of_node, "end-of-node", "Move to the end of this node" },
|
||||
{ info_next_window, "next-window", "Select the next window" },
|
||||
{ info_prev_window, "prev-window", "Select the previous window" },
|
||||
{ info_split_window, "split-window", "Split the current window" },
|
||||
{ info_delete_window, "delete-window", "Delete the current window" },
|
||||
{ info_keep_one_window, "keep-one-window", "Delete all other windows" },
|
||||
{ info_scroll_other_window, "scroll-other-window", "Scroll the other window" },
|
||||
{ info_grow_window, "grow-window", "Grow (or shrink) this window" },
|
||||
{ info_tile_windows, "tile-windows", "Divide the available screen space among the visible windows" },
|
||||
{ info_toggle_wrap, "toggle-wrap", "Toggle the state of line wrapping in the current window" },
|
||||
{ info_next_node, "next-node", "Select the `Next' node" },
|
||||
{ info_prev_node, "prev-node", "Select the `Prev' node" },
|
||||
{ info_up_node, "up-node", "Select the `Up' node" },
|
||||
{ info_last_node, "last-node", "Select the last node in this file" },
|
||||
{ info_first_node, "first-node", "Select the first node in this file" },
|
||||
{ info_last_menu_item, "last-menu-item", "Select the last item in this node's menu" },
|
||||
{ info_menu_digit, "menu-digit", "Select this menu item" },
|
||||
{ info_menu_item, "menu-item", "Read a menu item and select its node" },
|
||||
{ info_xref_item, "xref-item", "Read a footnote or cross reference and select its node" },
|
||||
{ info_find_menu, "find-menu", "Move to the start of this node's menu" },
|
||||
{ info_visit_menu, "visit-menu", "Visit as many menu items at once as possible" },
|
||||
{ info_goto_node, "goto-node", "Read a node name and select it" },
|
||||
{ info_man, "man", "Read a manpage reference and select it" },
|
||||
{ info_top_node, "top-node", "Select the node `Top' in this file" },
|
||||
{ info_dir_node, "dir-node", "Select the node `(dir)'" },
|
||||
{ info_history_node, "history-node", "Select the most recently selected node" },
|
||||
{ info_kill_node, "kill-node", "Kill this node" },
|
||||
{ info_view_file, "view-file", "Read the name of a file and select it" },
|
||||
{ info_print_node, "print-node", "Pipe the contents of this node through INFO_PRINT_COMMAND" },
|
||||
{ info_search, "search", "Read a string and search for it" },
|
||||
{ isearch_forward, "isearch-forward", "Search interactively for a string as you type it" },
|
||||
{ isearch_backward, "isearch-backward", "Search interactively for a string as you type it" },
|
||||
{ info_move_to_prev_xref, "move-to-prev-xref", "Move to the previous cross reference" },
|
||||
{ info_move_to_next_xref, "move-to-next-xref", "Move to the next cross reference" },
|
||||
{ info_select_reference_this_line, "select-reference-this-line", "Select reference or menu item appearing on this line" },
|
||||
{ info_abort_key, "abort-key", "Cancel current operation" },
|
||||
{ info_move_to_window_line, "move-to-window-line", "Move to the cursor to a specific line of the window" },
|
||||
{ info_redraw_display, "redraw-display", "Redraw the display" },
|
||||
{ info_quit, "quit", "Quit using Info" },
|
||||
{ info_do_lowercase_version, "do-lowercase-version", "" },
|
||||
{ info_add_digit_to_numeric_arg, "add-digit-to-numeric-arg", "Add this digit to the current numeric argument" },
|
||||
{ info_universal_argument, "universal-argument", "Start (or multiply by 4) the current numeric argument" },
|
||||
{ info_numeric_arg_digit_loop, "numeric-arg-digit-loop", "Internally used by \\[universal-argument]" },
|
||||
/* Commands found in "./echo-area.c". */
|
||||
{ ea_forward, "echo-area-forward", "Move forward a character" },
|
||||
{ ea_backward, "echo-area-backward", "Move backward a character" },
|
||||
{ ea_beg_of_line, "echo-area-beg-of-line", "Move to the start of this line" },
|
||||
{ ea_end_of_line, "echo-area-end-of-line", "Move to the end of this line" },
|
||||
{ ea_forward_word, "echo-area-forward-word", "Move forward a word" },
|
||||
{ ea_backward_word, "echo-area-backward-word", "Move backward a word" },
|
||||
{ ea_delete, "echo-area-delete", "Delete the character under the cursor" },
|
||||
{ ea_rubout, "echo-area-rubout", "Delete the character behind the cursor" },
|
||||
{ ea_abort, "echo-area-abort", "Cancel or quit operation" },
|
||||
{ ea_newline, "echo-area-newline", "Accept (or force completion of) this line" },
|
||||
{ ea_quoted_insert, "echo-area-quoted-insert", "Insert next character verbatim" },
|
||||
{ ea_insert, "echo-area-insert", "Insert this character" },
|
||||
{ ea_tab_insert, "echo-area-tab-insert", "Insert a TAB character" },
|
||||
{ ea_transpose_chars, "echo-area-transpose-chars", "Transpose characters at point" },
|
||||
{ ea_yank, "echo-area-yank", "Yank back the contents of the last kill" },
|
||||
{ ea_yank_pop, "echo-area-yank-pop", "Yank back a previous kill" },
|
||||
{ ea_kill_line, "echo-area-kill-line", "Kill to the end of the line" },
|
||||
{ ea_backward_kill_line, "echo-area-backward-kill-line", "Kill to the beginning of the line" },
|
||||
{ ea_kill_word, "echo-area-kill-word", "Kill the word following the cursor" },
|
||||
{ ea_backward_kill_word, "echo-area-backward-kill-word", "Kill the word preceding the cursor" },
|
||||
{ ea_possible_completions, "echo-area-possible-completions", "List possible completions" },
|
||||
{ ea_complete, "echo-area-complete", "Insert completion" },
|
||||
{ ea_scroll_completions_window, "echo-area-scroll-completions-window", "Scroll the completions window" },
|
||||
/* Commands found in "./infodoc.c". */
|
||||
{ info_get_help_window, "get-help-window", "Display help message" },
|
||||
{ info_get_info_help_node, "get-info-help-node", "Visit Info node `(info)Help'" },
|
||||
{ describe_key, "describe-key", "Print documentation for KEY" },
|
||||
{ info_where_is, "where-is", "Show what to type to execute a given command" },
|
||||
/* Commands found in "./m-x.c". */
|
||||
{ describe_command, "describe-command", "Read the name of an Info command and describe it" },
|
||||
{ info_execute_command, "execute-command", "Read a command name in the echo area and execute it" },
|
||||
{ set_screen_height, "set-screen-height", "Set the height of the displayed window" },
|
||||
/* Commands found in "./indices.c". */
|
||||
{ info_index_search, "index-search", "Look up a string in the index for this file" },
|
||||
{ info_next_index_match, "next-index-match", "Go to the next matching index item from the last `\\[index-search]' command" },
|
||||
{ info_index_apropos, "index-apropos", "Grovel all known info file's indices for a string and build a menu" },
|
||||
/* Commands found in "./nodemenu.c". */
|
||||
{ list_visited_nodes, "list-visited-nodes", "Make a window containing a menu of all of the currently visited nodes" },
|
||||
{ select_visited_node, "select-visited-node", "Select a node which has been previously visited in a visible window" },
|
||||
/* Commands found in "./footnotes.c". */
|
||||
{ info_show_footnotes, "show-footnotes", "Show the footnotes associated with this node in another window" },
|
||||
/* Commands found in "./variables.c". */
|
||||
{ describe_variable, "describe-variable", "Explain the use of a variable" },
|
||||
{ set_variable, "set-variable", "Set the value of an Info variable" },
|
||||
{ (VFunction *)NULL, (char *)NULL, (char *)NULL }
|
||||
};
|
|
@ -1,50 +0,0 @@
|
|||
/* doc.h -- Structure associating function pointers with documentation. */
|
||||
|
||||
/* This file is part of GNU Info, a program for reading online documentation
|
||||
stored in Info format.
|
||||
|
||||
Copyright (C) 1993 Free Software Foundation, Inc.
|
||||
|
||||
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 {
|
||||
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 */
|
|
@ -1,71 +0,0 @@
|
|||
/* dribble.c -- Dribble files for Info. */
|
||||
|
||||
/* 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). */
|
||||
|
||||
#include "info.h"
|
||||
#include "dribble.h"
|
||||
|
||||
/* When non-zero, it is a stream to write all input characters to for the
|
||||
duration of this info session. */
|
||||
FILE *info_dribble_file = (FILE *)NULL;
|
||||
|
||||
/* Open a dribble file named NAME, perhaps closing an already open one.
|
||||
This sets the global variable INFO_DRIBBLE_FILE to the open stream. */
|
||||
void
|
||||
open_dribble_file (name)
|
||||
char *name;
|
||||
{
|
||||
/* Perhaps close existing dribble file. */
|
||||
close_dribble_file ();
|
||||
|
||||
info_dribble_file = fopen (name, "w");
|
||||
|
||||
#if defined (HAVE_SETVBUF)
|
||||
if (info_dribble_file)
|
||||
# if defined (SETVBUF_REVERSED)
|
||||
setvbuf (info_dribble_file, _IONBF, (char *)NULL, 1);
|
||||
# else
|
||||
setvbuf (info_dribble_file, (char *)NULL, _IONBF, 1);
|
||||
# endif /* !SETVBUF_REVERSED */
|
||||
#endif /* HAVE_SETVBUF */
|
||||
}
|
||||
|
||||
/* If there is a dribble file already open, close it. */
|
||||
void
|
||||
close_dribble_file ()
|
||||
{
|
||||
if (info_dribble_file)
|
||||
{
|
||||
fflush (info_dribble_file);
|
||||
fclose (info_dribble_file);
|
||||
info_dribble_file = (FILE *)NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Write some output to our existing dribble file. */
|
||||
void
|
||||
dribble (byte)
|
||||
unsigned char byte;
|
||||
{
|
||||
if (info_dribble_file)
|
||||
fwrite (&byte, sizeof (unsigned char), 1, info_dribble_file);
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
/* dribble.h -- Functions and vars declared in dribble.c. */
|
||||
|
||||
/* 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). */
|
||||
|
||||
#if !defined (_DRIBBLE_H_)
|
||||
#define _DRIBBLE_H_
|
||||
|
||||
/* When non-zero, it is a stream to write all input characters to for the
|
||||
duration of this info session. */
|
||||
extern FILE *info_dribble_file;
|
||||
|
||||
/* Open a dribble file named NAME, perhaps closing an already open one.
|
||||
This sets the global variable INFO_DRIBBLE_FILE to the open stream. */
|
||||
extern void open_dribble_file ();
|
||||
|
||||
/* If there is a dribble file already open, close it. */
|
||||
extern void close_dribble_file ();
|
||||
|
||||
/* Write some output to our existing dribble file. */
|
||||
extern void dribble ();
|
||||
|
||||
#endif /* !_DRIBBLE_H_ */
|
File diff suppressed because it is too large
Load diff
|
@ -1,64 +0,0 @@
|
|||
/* echo-area.h -- Functions used in reading information from the echo area.
|
||||
$Id: echo-area.h,v 1.1.1.2 1998/03/24 18:20:09 law 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.
|
||||
|
||||
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_ECHO_AREA_H
|
||||
#define INFO_ECHO_AREA_H
|
||||
|
||||
#define EA_MAX_INPUT 256
|
||||
|
||||
extern int echo_area_is_active, info_aborted_echo_area;
|
||||
|
||||
/* Non-zero means that the last command executed while reading input
|
||||
killed some text. */
|
||||
extern int echo_area_last_command_was_kill;
|
||||
|
||||
extern void inform_in_echo_area (), echo_area_inform_of_deleted_window ();
|
||||
extern void echo_area_prep_read ();
|
||||
extern VFunction *ea_last_executed_command;
|
||||
|
||||
/* 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. */
|
||||
extern char *info_read_in_echo_area ();
|
||||
|
||||
/* Read a line in the echo area with completion over COMPLETIONS.
|
||||
Takes arguments of WINDOW, PROMPT, and COMPLETIONS, a REFERENCE **. */
|
||||
char *info_read_completing_in_echo_area ();
|
||||
|
||||
/* Read a line in the echo area allowing completion over COMPLETIONS, but
|
||||
not requiring it. Takes arguments of WINDOW, PROMPT, and COMPLETIONS,
|
||||
a REFERENCE **. */
|
||||
extern char *info_read_maybe_completing ();
|
||||
|
||||
extern void ea_insert (), ea_quoted_insert ();
|
||||
extern void ea_beg_of_line (), ea_backward (), ea_delete (), ea_end_of_line ();
|
||||
extern void ea_forward (), ea_abort (), ea_rubout (), ea_complete ();
|
||||
extern void ea_newline (), ea_kill_line (), ea_transpose_chars ();
|
||||
extern void ea_yank (), ea_tab_insert (), ea_possible_completions ();
|
||||
extern void ea_backward_word (), ea_kill_word (), ea_forward_word ();
|
||||
extern void ea_yank_pop (), ea_backward_kill_word ();
|
||||
extern void ea_scroll_completions_window ();
|
||||
|
||||
#endif /* not INFO_ECHO_AREA_H */
|
File diff suppressed because it is too large
Load diff
|
@ -1,63 +0,0 @@
|
|||
/* echo_area.h -- Functions used in reading information from the echo area. */
|
||||
|
||||
/* 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). */
|
||||
|
||||
#if !defined (_ECHO_AREA_H_)
|
||||
#define _ECHO_AREA_H_
|
||||
|
||||
#define EA_MAX_INPUT 256
|
||||
|
||||
extern int echo_area_is_active, info_aborted_echo_area;
|
||||
|
||||
/* Non-zero means that the last command executed while reading input
|
||||
killed some text. */
|
||||
extern int echo_area_last_command_was_kill;
|
||||
|
||||
extern void inform_in_echo_area (), echo_area_inform_of_deleted_window ();
|
||||
extern void echo_area_prep_read ();
|
||||
extern VFunction *ea_last_executed_command;
|
||||
|
||||
/* 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. */
|
||||
extern char *info_read_in_echo_area ();
|
||||
|
||||
/* Read a line in the echo area with completion over COMPLETIONS.
|
||||
Takes arguments of WINDOW, PROMPT, and COMPLETIONS, a REFERENCE **. */
|
||||
char *info_read_completing_in_echo_area ();
|
||||
|
||||
/* Read a line in the echo area allowing completion over COMPLETIONS, but
|
||||
not requiring it. Takes arguments of WINDOW, PROMPT, and COMPLETIONS,
|
||||
a REFERENCE **. */
|
||||
extern char *info_read_maybe_completing ();
|
||||
|
||||
extern void ea_insert (), ea_quoted_insert ();
|
||||
extern void ea_beg_of_line (), ea_backward (), ea_delete (), ea_end_of_line ();
|
||||
extern void ea_forward (), ea_abort (), ea_rubout (), ea_complete ();
|
||||
extern void ea_newline (), ea_kill_line (), ea_transpose_chars ();
|
||||
extern void ea_yank (), ea_tab_insert (), ea_possible_completions ();
|
||||
extern void ea_backward_word (), ea_kill_word (), ea_forward_word ();
|
||||
extern void ea_yank_pop (), ea_backward_kill_word ();
|
||||
extern void ea_scroll_completions_window ();
|
||||
|
||||
#endif /* _ECHO_AREA_H_ */
|
|
@ -1,584 +0,0 @@
|
|||
/* filesys.c -- File system specific functions for hacking this system.
|
||||
$Id: filesys.c,v 1.1.1.3 1998/03/24 18:20:10 law Exp $
|
||||
|
||||
Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
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 void remember_info_filename (), maybe_initialize_infopath ();
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *suffix;
|
||||
char *decompressor;
|
||||
} COMPRESSION_ALIST;
|
||||
|
||||
static char *info_suffixes[] = {
|
||||
"",
|
||||
".info",
|
||||
"-info",
|
||||
"/index",
|
||||
(char *)NULL
|
||||
};
|
||||
|
||||
static COMPRESSION_ALIST compress_suffixes[] = {
|
||||
{ ".Z", "uncompress" },
|
||||
{ ".Y", "unyabba" },
|
||||
{ ".z", "gunzip" },
|
||||
{ ".gz", "gunzip" },
|
||||
{ (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 (initial_character == '/')
|
||||
temp = info_file_in_path (partial + 1, "/");
|
||||
else if (initial_character == '~')
|
||||
{
|
||||
expansion = tilde_expand_word (partial);
|
||||
if (*expansion == '/')
|
||||
{
|
||||
temp = info_file_in_path (expansion + 1, "/");
|
||||
free (expansion);
|
||||
}
|
||||
else
|
||||
temp = expansion;
|
||||
}
|
||||
else if (initial_character == '.' &&
|
||||
(partial[1] == '/' || (partial[1] == '.' && 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);
|
||||
return (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;
|
||||
|
||||
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 (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);
|
||||
}
|
||||
|
||||
/* Given a string containing units of information separated by colons,
|
||||
return the next one pointed to by IDX, or NULL if there are no more.
|
||||
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] != ':')
|
||||
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 (strcmp (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, ":");
|
||||
strcat (infopath, path);
|
||||
}
|
||||
else if (where == INFOPATH_PREPEND)
|
||||
{
|
||||
char *temp = xstrdup (infopath);
|
||||
strcpy (infopath, path);
|
||||
strcat (infopath, ":");
|
||||
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;
|
||||
}
|
||||
|
||||
/* 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 cannot be read, return a NULL pointer. */
|
||||
char *
|
||||
filesys_read_info_file (pathname, filesize, finfo)
|
||||
char *pathname;
|
||||
long *filesize;
|
||||
struct stat *finfo;
|
||||
{
|
||||
long st_size;
|
||||
|
||||
*filesize = filesys_error_number = 0;
|
||||
|
||||
if (compressed_filename_p (pathname))
|
||||
return (filesys_read_compressed (pathname, filesize, finfo));
|
||||
else
|
||||
{
|
||||
int descriptor;
|
||||
char *contents;
|
||||
|
||||
descriptor = open (pathname, O_RDONLY, 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);
|
||||
|
||||
*filesize = st_size;
|
||||
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 (10 + strlen (pathname) + strlen (decompressor));
|
||||
sprintf (command, "%s < %s", decompressor, 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, "r");
|
||||
free (command);
|
||||
|
||||
/* Read chunks from this file until there are none left to read. */
|
||||
if (stream)
|
||||
{
|
||||
int 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);
|
||||
pclose (stream);
|
||||
contents = (char *)xrealloc (contents, offset + 1);
|
||||
*filesize = offset;
|
||||
}
|
||||
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 (strcmp (extension, compress_suffixes[i].suffix) == 0)
|
||||
return (compress_suffixes[i].decompressor);
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
/* filesys.h -- External declarations of functions and vars in filesys.c.
|
||||
$Id: filesys.h,v 1.1.1.2 1998/03/22 20:42:28 law 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.
|
||||
|
||||
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_FILESYS_H
|
||||
#define INFO_FILESYS_H
|
||||
|
||||
/* 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. */
|
||||
extern char *infopath;
|
||||
|
||||
/* Make INFOPATH have absolutely nothing in it. */
|
||||
extern void zap_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. */
|
||||
extern void info_add_path ();
|
||||
|
||||
/* Defines that are passed along with the pathname to info_add_path (). */
|
||||
#define INFOPATH_PREPEND 0
|
||||
#define INFOPATH_APPEND 1
|
||||
|
||||
/* 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. */
|
||||
extern char *info_find_fullpath ();
|
||||
|
||||
/* 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 cannot be read, return a NULL pointer. */
|
||||
extern char *filesys_read_info_file ();
|
||||
extern char *filesys_read_compressed ();
|
||||
|
||||
/* Return the command string that would be used to decompress FILENAME. */
|
||||
extern char *filesys_decompressor_for_file ();
|
||||
extern int compressed_filename_p ();
|
||||
|
||||
/* A function which returns a pointer to a static buffer containing
|
||||
an error message for FILENAME and ERROR_NUM. */
|
||||
extern char *filesys_error_string ();
|
||||
|
||||
/* The number of the most recent file system error. */
|
||||
extern int filesys_error_number;
|
||||
|
||||
/* Given a string containing units of information separated by colons,
|
||||
return the next one pointed to by IDX, or NULL if there are no more.
|
||||
Advance IDX to the character after the colon. */
|
||||
extern char *extract_colon_unit ();
|
||||
|
||||
/* The default value of INFOPATH. */
|
||||
#if !defined (DEFAULT_INFOPATH)
|
||||
# define DEFAULT_INFOPATH "/usr/local/info:/usr/info:/usr/local/lib/info:/usr/lib/info:/usr/local/gnu/info:/usr/local/gnu/lib/info:/usr/gnu/info:/usr/gnu/lib/info:/opt/gnu/info:/usr/share/info:/usr/share/lib/info:/usr/local/share/info:/usr/local/share/lib/info:/usr/gnu/lib/emacs/info:/usr/local/gnu/lib/emacs/info:/usr/local/lib/emacs/info:/usr/local/emacs/info:."
|
||||
#endif /* !DEFAULT_INFOPATH */
|
||||
|
||||
#if !defined (S_ISREG) && defined (S_IFREG)
|
||||
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||
#endif /* !S_ISREG && S_IFREG */
|
||||
|
||||
#if !defined (S_ISDIR) && defined (S_IFDIR)
|
||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#endif /* !S_ISDIR && S_IFDIR */
|
||||
|
||||
#endif /* not INFO_FILESYS_H */
|
|
@ -1,261 +0,0 @@
|
|||
/* footnotes.c -- Some functions for manipulating footnotes.
|
||||
$Id: footnotes.c,v 1.1.1.2 1998/03/22 20:42:29 law Exp $
|
||||
|
||||
Copyright (C) 1993, 97 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"
|
||||
|
||||
/* Non-zero means attempt to show footnotes when displaying a new window. */
|
||||
int auto_footnotes_p = 1;
|
||||
|
||||
static char *footnote_nodename = "*Footnotes*";
|
||||
|
||||
#define FOOTNOTE_HEADER_FORMAT \
|
||||
"*** Footnotes appearing in the node \"%s\" ***\n"
|
||||
|
||||
/* Find the window currently showing footnotes. */
|
||||
static WINDOW *
|
||||
find_footnotes_window ()
|
||||
{
|
||||
WINDOW *win;
|
||||
|
||||
/* Try to find an existing window first. */
|
||||
for (win = windows; win; win = win->next)
|
||||
if (internal_info_node_p (win->node) &&
|
||||
(strcmp (win->node->nodename, footnote_nodename) == 0))
|
||||
break;
|
||||
|
||||
return (win);
|
||||
}
|
||||
|
||||
/* Manufacture a node containing the footnotes of this node, and
|
||||
return the manufactured node. If NODE has no footnotes, return a
|
||||
NULL pointer. */
|
||||
NODE *
|
||||
make_footnotes_node (node)
|
||||
NODE *node;
|
||||
{
|
||||
NODE *fn_node, *result = (NODE *)NULL;
|
||||
long fn_start;
|
||||
|
||||
/* Make the initial assumption that the footnotes appear as simple
|
||||
text within this windows node. */
|
||||
fn_node = node;
|
||||
|
||||
/* See if this node contains the magic footnote label. */
|
||||
fn_start =
|
||||
info_search_in_node (FOOTNOTE_LABEL, node, 0, (WINDOW *)NULL, 1);
|
||||
|
||||
/* If it doesn't, check to see if it has an associated footnotes node. */
|
||||
if (fn_start == -1)
|
||||
{
|
||||
REFERENCE **refs;
|
||||
|
||||
refs = info_xrefs_of_node (node);
|
||||
|
||||
if (refs)
|
||||
{
|
||||
register int i;
|
||||
char *refname;
|
||||
|
||||
refname = (char *)xmalloc
|
||||
(1 + strlen ("-Footnotes") + strlen (node->nodename));
|
||||
|
||||
strcpy (refname, node->nodename);
|
||||
strcat (refname, "-Footnotes");
|
||||
|
||||
for (i = 0; refs[i]; i++)
|
||||
if ((refs[i]->nodename != (char *)NULL) &&
|
||||
(strcmp (refs[i]->nodename, refname) == 0))
|
||||
{
|
||||
char *filename;
|
||||
|
||||
filename = node->parent;
|
||||
if (!filename)
|
||||
filename = node->filename;
|
||||
|
||||
fn_node = info_get_node (filename, refname);
|
||||
|
||||
if (fn_node)
|
||||
fn_start = 0;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
free (refname);
|
||||
info_free_references (refs);
|
||||
}
|
||||
}
|
||||
|
||||
/* If we never found the start of a footnotes area, quit now. */
|
||||
if (fn_start == -1)
|
||||
return ((NODE *)NULL);
|
||||
|
||||
/* Make the new node. */
|
||||
result = (NODE *)xmalloc (sizeof (NODE));
|
||||
result->flags = 0;
|
||||
|
||||
/* Get the size of the footnotes appearing within this node. */
|
||||
{
|
||||
char *header;
|
||||
long text_start = fn_start;
|
||||
|
||||
header = (char *)xmalloc
|
||||
(1 + strlen (node->nodename) + strlen (FOOTNOTE_HEADER_FORMAT));
|
||||
sprintf (header, FOOTNOTE_HEADER_FORMAT, node->nodename);
|
||||
|
||||
/* Move the start of the displayed text to right after the first line.
|
||||
This effectively skips either "---- footno...", or "File: foo...". */
|
||||
while (text_start < fn_node->nodelen)
|
||||
if (fn_node->contents[text_start++] == '\n')
|
||||
break;
|
||||
|
||||
result->nodelen = strlen (header) + fn_node->nodelen - text_start;
|
||||
|
||||
/* Set the contents of this node. */
|
||||
result->contents = (char *)xmalloc (1 + result->nodelen);
|
||||
sprintf (result->contents, "%s", header);
|
||||
memcpy (result->contents + strlen (header),
|
||||
fn_node->contents + text_start, fn_node->nodelen - text_start);
|
||||
|
||||
name_internal_node (result, footnote_nodename);
|
||||
free (header);
|
||||
}
|
||||
|
||||
#if defined (NOTDEF)
|
||||
/* If the footnotes were gleaned from the node that we were called with,
|
||||
shorten the calling node's display length. */
|
||||
if (fn_node == node)
|
||||
narrow_node (node, 0, fn_start);
|
||||
#endif /* NOTDEF */
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
/* Create or delete the footnotes window depending on whether footnotes
|
||||
exist in WINDOW's node or not. Returns FN_FOUND if footnotes were found
|
||||
and displayed. Returns FN_UNFOUND if there were no footnotes found
|
||||
in WINDOW's node. Returns FN_UNABLE if there were footnotes, but the
|
||||
window to show them couldn't be made. */
|
||||
int
|
||||
info_get_or_remove_footnotes (window)
|
||||
WINDOW *window;
|
||||
{
|
||||
WINDOW *fn_win;
|
||||
NODE *new_footnotes;
|
||||
|
||||
fn_win = find_footnotes_window ();
|
||||
|
||||
/* If we are in the footnotes window, change nothing. */
|
||||
if (fn_win == window)
|
||||
return (FN_FOUND);
|
||||
|
||||
/* Try to find footnotes for this window's node. */
|
||||
new_footnotes = make_footnotes_node (window->node);
|
||||
|
||||
/* If there was a window showing footnotes, and there are no footnotes
|
||||
for the current window, delete the old footnote window. */
|
||||
if (fn_win && !new_footnotes)
|
||||
{
|
||||
if (windows->next)
|
||||
info_delete_window_internal (fn_win);
|
||||
}
|
||||
|
||||
/* If there are footnotes for this window's node, but no window around
|
||||
showing footnotes, try to make a new window. */
|
||||
if (new_footnotes && !fn_win)
|
||||
{
|
||||
WINDOW *old_active;
|
||||
WINDOW *last, *win;
|
||||
|
||||
/* Always make this window be the last one appearing in the list. Find
|
||||
the last window in the chain. */
|
||||
for (win = windows, last = windows; win; last = win, win = win->next);
|
||||
|
||||
/* Try to split this window, and make the split window the one to
|
||||
contain the footnotes. */
|
||||
old_active = active_window;
|
||||
active_window = last;
|
||||
fn_win = window_make_window (new_footnotes);
|
||||
active_window = old_active;
|
||||
|
||||
if (!fn_win)
|
||||
{
|
||||
free (new_footnotes->contents);
|
||||
free (new_footnotes);
|
||||
|
||||
/* If we are hacking automatic footnotes, and there are footnotes
|
||||
but we couldn't display them, print a message to that effect. */
|
||||
if (auto_footnotes_p)
|
||||
inform_in_echo_area (_("Footnotes could not be displayed"));
|
||||
return (FN_UNABLE);
|
||||
}
|
||||
}
|
||||
|
||||
/* If there are footnotes, and there is a window to display them,
|
||||
make that window be the number of lines appearing in the footnotes. */
|
||||
if (new_footnotes && fn_win)
|
||||
{
|
||||
window_set_node_of_window (fn_win, new_footnotes);
|
||||
|
||||
window_change_window_height
|
||||
(fn_win, fn_win->line_count - fn_win->height);
|
||||
|
||||
remember_window_and_node (fn_win, new_footnotes);
|
||||
add_gcable_pointer (new_footnotes->contents);
|
||||
}
|
||||
|
||||
if (!new_footnotes)
|
||||
return (FN_UNFOUND);
|
||||
else
|
||||
return (FN_FOUND);
|
||||
}
|
||||
|
||||
/* Show the footnotes associated with this node in another window. */
|
||||
DECLARE_INFO_COMMAND (info_show_footnotes,
|
||||
_("Show the footnotes associated with this node in another window"))
|
||||
{
|
||||
/* A negative argument means just make the window go away. */
|
||||
if (count < 0)
|
||||
{
|
||||
WINDOW *fn_win = find_footnotes_window ();
|
||||
|
||||
/* If there is an old footnotes window, and it isn't the only window
|
||||
on the screen, delete it. */
|
||||
if (fn_win && windows->next)
|
||||
info_delete_window_internal (fn_win);
|
||||
}
|
||||
else
|
||||
{
|
||||
int result;
|
||||
|
||||
result = info_get_or_remove_footnotes (window);
|
||||
|
||||
switch (result)
|
||||
{
|
||||
case FN_UNFOUND:
|
||||
info_error (NO_FOOT_NODE);
|
||||
break;
|
||||
|
||||
case FN_UNABLE:
|
||||
info_error (WIN_TOO_SMALL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
/* footnotes.h -- Some functions for manipulating footnotes.
|
||||
$Id: footnotes.h,v 1.1.1.2 1998/03/22 20:42:30 law 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.
|
||||
|
||||
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_FOOTNOTES_H
|
||||
#define INFO_FOOTNOTES_H
|
||||
|
||||
/* Magic string which indicates following text is footnotes. */
|
||||
#define FOOTNOTE_LABEL _("---------- Footnotes ----------")
|
||||
|
||||
#define FN_FOUND 0
|
||||
#define FN_UNFOUND 1
|
||||
#define FN_UNABLE 2
|
||||
|
||||
|
||||
/* Create or delete the footnotes window depending on whether footnotes
|
||||
exist in WINDOW's node or not. Returns FN_FOUND if footnotes were found
|
||||
and displayed. Returns FN_UNFOUND if there were no footnotes found
|
||||
in WINDOW's node. Returns FN_UNABLE if there were footnotes, but the
|
||||
window to show them couldn't be made. */
|
||||
extern int info_get_or_remove_footnotes ();
|
||||
|
||||
/* Non-zero means attempt to show footnotes when displaying a new window. */
|
||||
extern int auto_footnotes_p;
|
||||
|
||||
#endif /* not INFO_FOOTNOTES_H */
|
|
@ -1,111 +0,0 @@
|
|||
/* funs.h -- Generated declarations for Info commands. */
|
||||
|
||||
/* Functions declared in "./session.c". */
|
||||
extern void info_next_line ();
|
||||
extern void info_prev_line ();
|
||||
extern void info_end_of_line ();
|
||||
extern void info_beginning_of_line ();
|
||||
extern void info_forward_char ();
|
||||
extern void info_backward_char ();
|
||||
extern void info_forward_word ();
|
||||
extern void info_backward_word ();
|
||||
extern void info_global_next_node ();
|
||||
extern void info_global_prev_node ();
|
||||
extern void info_scroll_forward ();
|
||||
extern void info_scroll_backward ();
|
||||
extern void info_beginning_of_node ();
|
||||
extern void info_end_of_node ();
|
||||
extern void info_next_window ();
|
||||
extern void info_prev_window ();
|
||||
extern void info_split_window ();
|
||||
extern void info_delete_window ();
|
||||
extern void info_keep_one_window ();
|
||||
extern void info_scroll_other_window ();
|
||||
extern void info_grow_window ();
|
||||
extern void info_tile_windows ();
|
||||
extern void info_toggle_wrap ();
|
||||
extern void info_next_node ();
|
||||
extern void info_prev_node ();
|
||||
extern void info_up_node ();
|
||||
extern void info_last_node ();
|
||||
extern void info_first_node ();
|
||||
extern void info_last_menu_item ();
|
||||
extern void info_menu_digit ();
|
||||
extern void info_menu_item ();
|
||||
extern void info_xref_item ();
|
||||
extern void info_find_menu ();
|
||||
extern void info_visit_menu ();
|
||||
extern void info_goto_node ();
|
||||
extern void info_man ();
|
||||
extern void info_top_node ();
|
||||
extern void info_dir_node ();
|
||||
extern void info_history_node ();
|
||||
extern void info_kill_node ();
|
||||
extern void info_view_file ();
|
||||
extern void info_print_node ();
|
||||
extern void info_search ();
|
||||
extern void isearch_forward ();
|
||||
extern void isearch_backward ();
|
||||
extern void info_move_to_prev_xref ();
|
||||
extern void info_move_to_next_xref ();
|
||||
extern void info_select_reference_this_line ();
|
||||
extern void info_abort_key ();
|
||||
extern void info_move_to_window_line ();
|
||||
extern void info_redraw_display ();
|
||||
extern void info_quit ();
|
||||
extern void info_do_lowercase_version ();
|
||||
extern void info_add_digit_to_numeric_arg ();
|
||||
extern void info_universal_argument ();
|
||||
extern void info_numeric_arg_digit_loop ();
|
||||
|
||||
/* Functions declared in "./echo-area.c". */
|
||||
extern void ea_forward ();
|
||||
extern void ea_backward ();
|
||||
extern void ea_beg_of_line ();
|
||||
extern void ea_end_of_line ();
|
||||
extern void ea_forward_word ();
|
||||
extern void ea_backward_word ();
|
||||
extern void ea_delete ();
|
||||
extern void ea_rubout ();
|
||||
extern void ea_abort ();
|
||||
extern void ea_newline ();
|
||||
extern void ea_quoted_insert ();
|
||||
extern void ea_insert ();
|
||||
extern void ea_tab_insert ();
|
||||
extern void ea_transpose_chars ();
|
||||
extern void ea_yank ();
|
||||
extern void ea_yank_pop ();
|
||||
extern void ea_kill_line ();
|
||||
extern void ea_backward_kill_line ();
|
||||
extern void ea_kill_word ();
|
||||
extern void ea_backward_kill_word ();
|
||||
extern void ea_possible_completions ();
|
||||
extern void ea_complete ();
|
||||
extern void ea_scroll_completions_window ();
|
||||
|
||||
/* Functions declared in "./infodoc.c". */
|
||||
extern void info_get_help_window ();
|
||||
extern void info_get_info_help_node ();
|
||||
extern void describe_key ();
|
||||
extern void info_where_is ();
|
||||
|
||||
/* Functions declared in "./m-x.c". */
|
||||
extern void describe_command ();
|
||||
extern void info_execute_command ();
|
||||
extern void set_screen_height ();
|
||||
|
||||
/* Functions declared in "./indices.c". */
|
||||
extern void info_index_search ();
|
||||
extern void info_next_index_match ();
|
||||
extern void info_index_apropos ();
|
||||
|
||||
/* Functions declared in "./nodemenu.c". */
|
||||
extern void list_visited_nodes ();
|
||||
extern void select_visited_node ();
|
||||
|
||||
/* Functions declared in "./footnotes.c". */
|
||||
extern void info_show_footnotes ();
|
||||
|
||||
/* Functions declared in "./variables.c". */
|
||||
extern void describe_variable ();
|
||||
extern void set_variable ();
|
|
@ -1,95 +0,0 @@
|
|||
/* gc.c -- Functions to remember and garbage collect unused node contents. */
|
||||
|
||||
/* 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). */
|
||||
|
||||
#include "info.h"
|
||||
|
||||
/* Array of pointers to the contents of gc-able nodes. A pointer on this
|
||||
list can be garbage collected when no info window contains a node whose
|
||||
contents member match the pointer. */
|
||||
static char **gcable_pointers = (char **)NULL;
|
||||
static int gcable_pointers_index = 0;
|
||||
static int gcable_pointers_slots = 0;
|
||||
|
||||
/* Add POINTER to the list of garbage collectible pointers. A pointer
|
||||
is not actually garbage collected until no info window contains a node
|
||||
whose contents member is equal to the pointer. */
|
||||
void
|
||||
add_gcable_pointer (pointer)
|
||||
char *pointer;
|
||||
{
|
||||
gc_pointers ();
|
||||
add_pointer_to_array (pointer, gcable_pointers_index, gcable_pointers,
|
||||
gcable_pointers_slots, 10, char *);
|
||||
}
|
||||
|
||||
/* Grovel the list of info windows and gc-able pointers finding those
|
||||
node->contents which are collectible, and free them. */
|
||||
void
|
||||
gc_pointers ()
|
||||
{
|
||||
register int i, j, k;
|
||||
INFO_WINDOW *iw;
|
||||
char **new = (char **)NULL;
|
||||
int new_index = 0;
|
||||
int new_slots = 0;
|
||||
|
||||
if (!info_windows || !gcable_pointers_index)
|
||||
return;
|
||||
|
||||
for (i = 0; (iw = info_windows[i]); i++)
|
||||
{
|
||||
for (j = 0; j < iw->nodes_index; j++)
|
||||
{
|
||||
NODE *node = iw->nodes[j];
|
||||
|
||||
/* If this node->contents appears in our list of gcable_pointers,
|
||||
it is not gc-able, so save it. */
|
||||
for (k = 0; k < gcable_pointers_index; k++)
|
||||
if (gcable_pointers[k] == node->contents)
|
||||
{
|
||||
add_pointer_to_array
|
||||
(node->contents, new_index, new, new_slots, 10, char *);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* We have gathered all of the pointers which need to be saved. Free any
|
||||
of the original pointers which do not appear in the new list. */
|
||||
for (i = 0; i < gcable_pointers_index; i++)
|
||||
{
|
||||
for (j = 0; j < new_index; j++)
|
||||
if (gcable_pointers[i] == new[j])
|
||||
break;
|
||||
|
||||
/* If we got all the way through the new list, then the old pointer
|
||||
can be garbage collected. */
|
||||
if (new && !new[j])
|
||||
free (gcable_pointers[i]);
|
||||
}
|
||||
|
||||
free (gcable_pointers);
|
||||
gcable_pointers = new;
|
||||
gcable_pointers_slots = new_slots;
|
||||
gcable_pointers_index = new_index;
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
/* gc.h -- Functions for garbage collecting unused node contents.
|
||||
$Id: gc.h,v 1.1.1.2 1998/03/22 20:42:32 law 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.
|
||||
|
||||
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_GC_H
|
||||
#define INFO_GC_H
|
||||
|
||||
/* Add POINTER to the list of garbage collectible pointers. A pointer
|
||||
is not actually garbage collected until no info window contains a node
|
||||
whose contents member is equal to the pointer. */
|
||||
extern void add_gcable_pointer ();
|
||||
|
||||
/* Grovel the list of info windows and gc-able pointers finding those
|
||||
node->contents which are collectible, and free them. */
|
||||
extern void gc_pointers ();
|
||||
|
||||
#endif /* not INFO_GC_H */
|
|
@ -1,94 +0,0 @@
|
|||
/* general.h -- Some generally useful defines. */
|
||||
|
||||
/* 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). */
|
||||
|
||||
#if !defined (_GENERAL_H_)
|
||||
#define _GENERAL_H_
|
||||
|
||||
extern void *xmalloc (), *xrealloc ();
|
||||
|
||||
#if defined (HAVE_UNISTD_H)
|
||||
# include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
|
||||
#if defined (HAVE_STRING_H)
|
||||
# include <string.h>
|
||||
#else
|
||||
# include <strings.h>
|
||||
#endif /* !HAVE_STRING_H */
|
||||
|
||||
#include "clib.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 */
|
||||
|
||||
#if !defined (__FUNCTION_DEF)
|
||||
# define __FUNCTION_DEF
|
||||
typedef int Function ();
|
||||
typedef void VFunction ();
|
||||
typedef char *CFunction ();
|
||||
#endif /* _FUNCTION_DEF */
|
||||
|
||||
/* 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 */
|
||||
|
||||
#endif /* !_GENERAL_H_ */
|
|
@ -1,727 +0,0 @@
|
|||
/* indices.c -- Commands for dealing with an Info file Index.
|
||||
$Id: indices.c,v 1.1.1.2 1998/03/22 20:42:33 law Exp $
|
||||
|
||||
Copyright (C) 1993, 97 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"
|
||||
|
||||
/* User-visible variable controls the output of info-index-next. */
|
||||
int show_index_match = 1;
|
||||
|
||||
/* In the Info sense, an index is a menu. This variable holds the last
|
||||
parsed index. */
|
||||
static REFERENCE **index_index = (REFERENCE **)NULL;
|
||||
|
||||
/* The offset of the most recently selected index element. */
|
||||
static int index_offset = 0;
|
||||
|
||||
/* Variable which holds the last string searched for. */
|
||||
static char *index_search = (char *)NULL;
|
||||
|
||||
/* A couple of "globals" describing where the initial index was found. */
|
||||
static char *initial_index_filename = (char *)NULL;
|
||||
static char *initial_index_nodename = (char *)NULL;
|
||||
|
||||
/* A structure associating index names with index offset ranges. */
|
||||
typedef struct {
|
||||
char *name; /* The nodename of this index. */
|
||||
int first; /* The index in our list of the first entry. */
|
||||
int last; /* The index in our list of the last entry. */
|
||||
} INDEX_NAME_ASSOC;
|
||||
|
||||
/* An array associating index nodenames with index offset ranges. */
|
||||
static INDEX_NAME_ASSOC **index_nodenames = (INDEX_NAME_ASSOC **)NULL;
|
||||
static int index_nodenames_index = 0;
|
||||
static int index_nodenames_slots = 0;
|
||||
|
||||
/* Add the name of NODE, and the range of the associated index elements
|
||||
(passed in ARRAY) to index_nodenames. */
|
||||
static void
|
||||
add_index_to_index_nodenames (array, node)
|
||||
REFERENCE **array;
|
||||
NODE *node;
|
||||
{
|
||||
register int i, last;
|
||||
INDEX_NAME_ASSOC *assoc;
|
||||
|
||||
for (last = 0; array[last]; last++);
|
||||
assoc = (INDEX_NAME_ASSOC *)xmalloc (sizeof (INDEX_NAME_ASSOC));
|
||||
assoc->name = xstrdup (node->nodename);
|
||||
|
||||
if (!index_nodenames_index)
|
||||
{
|
||||
assoc->first = 0;
|
||||
assoc->last = last;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; index_nodenames[i + 1]; i++);
|
||||
assoc->first = 1 + index_nodenames[i]->last;
|
||||
assoc->last = assoc->first + last;
|
||||
}
|
||||
add_pointer_to_array
|
||||
(assoc, index_nodenames_index, index_nodenames, index_nodenames_slots,
|
||||
10, INDEX_NAME_ASSOC *);
|
||||
}
|
||||
|
||||
/* Find and return the indices of WINDOW's file. The indices are defined
|
||||
as the first node in the file containing the word "Index" and any
|
||||
immediately following nodes whose names also contain "Index". All such
|
||||
indices are concatenated and the result returned. If WINDOW's info file
|
||||
doesn't have any indices, a NULL pointer is returned. */
|
||||
REFERENCE **
|
||||
info_indices_of_window (window)
|
||||
WINDOW *window;
|
||||
{
|
||||
FILE_BUFFER *fb;
|
||||
|
||||
fb = file_buffer_of_window (window);
|
||||
|
||||
return (info_indices_of_file_buffer (fb));
|
||||
}
|
||||
|
||||
REFERENCE **
|
||||
info_indices_of_file_buffer (file_buffer)
|
||||
FILE_BUFFER *file_buffer;
|
||||
{
|
||||
register int i;
|
||||
REFERENCE **result = (REFERENCE **)NULL;
|
||||
|
||||
/* No file buffer, no indices. */
|
||||
if (!file_buffer)
|
||||
return ((REFERENCE **)NULL);
|
||||
|
||||
/* Reset globals describing where the index was found. */
|
||||
maybe_free (initial_index_filename);
|
||||
maybe_free (initial_index_nodename);
|
||||
initial_index_filename = (char *)NULL;
|
||||
initial_index_nodename = (char *)NULL;
|
||||
|
||||
if (index_nodenames)
|
||||
{
|
||||
for (i = 0; index_nodenames[i]; i++)
|
||||
{
|
||||
free (index_nodenames[i]->name);
|
||||
free (index_nodenames[i]);
|
||||
}
|
||||
|
||||
index_nodenames_index = 0;
|
||||
index_nodenames[0] = (INDEX_NAME_ASSOC *)NULL;
|
||||
}
|
||||
|
||||
/* Grovel the names of the nodes found in this file. */
|
||||
if (file_buffer->tags)
|
||||
{
|
||||
TAG *tag;
|
||||
|
||||
for (i = 0; (tag = file_buffer->tags[i]); i++)
|
||||
{
|
||||
if (string_in_line ("Index", tag->nodename) != -1)
|
||||
{
|
||||
NODE *node;
|
||||
REFERENCE **menu;
|
||||
|
||||
/* Found one. Get its menu. */
|
||||
node = info_get_node (tag->filename, tag->nodename);
|
||||
if (!node)
|
||||
continue;
|
||||
|
||||
/* Remember the filename and nodename of this index. */
|
||||
initial_index_filename = xstrdup (file_buffer->filename);
|
||||
initial_index_nodename = xstrdup (tag->nodename);
|
||||
|
||||
menu = info_menu_of_node (node);
|
||||
|
||||
/* If we have a menu, add this index's nodename and range
|
||||
to our list of index_nodenames. */
|
||||
if (menu)
|
||||
{
|
||||
add_index_to_index_nodenames (menu, node);
|
||||
|
||||
/* Concatenate the references found so far. */
|
||||
result = info_concatenate_references (result, menu);
|
||||
}
|
||||
free (node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* If there is a result, clean it up so that every entry has a filename. */
|
||||
for (i = 0; result && result[i]; i++)
|
||||
if (!result[i]->filename)
|
||||
result[i]->filename = xstrdup (file_buffer->filename);
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
DECLARE_INFO_COMMAND (info_index_search,
|
||||
_("Look up a string in the index for this file"))
|
||||
{
|
||||
do_info_index_search (window, count, 0);
|
||||
}
|
||||
|
||||
/* Look up SEARCH_STRING in the index for this file. If SEARCH_STRING
|
||||
is NULL, prompt user for input. */
|
||||
void
|
||||
do_info_index_search (window, count, search_string)
|
||||
WINDOW *window;
|
||||
int count;
|
||||
char *search_string;
|
||||
{
|
||||
FILE_BUFFER *fb;
|
||||
char *line;
|
||||
|
||||
/* Reset the index offset, since this is not the info-index-next command. */
|
||||
index_offset = 0;
|
||||
|
||||
/* The user is selecting a new search string, so flush the old one. */
|
||||
maybe_free (index_search);
|
||||
index_search = (char *)NULL;
|
||||
|
||||
/* If this window's file is not the same as the one that we last built an
|
||||
index for, build and remember an index now. */
|
||||
fb = file_buffer_of_window (window);
|
||||
if (!initial_index_filename ||
|
||||
(strcmp (initial_index_filename, fb->filename) != 0))
|
||||
{
|
||||
info_free_references (index_index);
|
||||
window_message_in_echo_area (_("Finding index entries..."));
|
||||
index_index = info_indices_of_file_buffer (fb);
|
||||
}
|
||||
|
||||
/* If there is no index, quit now. */
|
||||
if (!index_index)
|
||||
{
|
||||
info_error (_("No indices found."));
|
||||
return;
|
||||
}
|
||||
|
||||
/* Okay, there is an index. Look for SEARCH_STRING, or, if it is
|
||||
empty, prompt for one. */
|
||||
if (search_string && *search_string)
|
||||
line = xstrdup (search_string);
|
||||
else
|
||||
{
|
||||
line = info_read_maybe_completing (window, _("Index entry: "),
|
||||
index_index);
|
||||
window = active_window;
|
||||
|
||||
/* User aborted? */
|
||||
if (!line)
|
||||
{
|
||||
info_abort_key (active_window, 1, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Empty line means move to the Index node. */
|
||||
if (!*line)
|
||||
{
|
||||
free (line);
|
||||
|
||||
if (initial_index_filename && initial_index_nodename)
|
||||
{
|
||||
NODE *node;
|
||||
|
||||
node = info_get_node (initial_index_filename,
|
||||
initial_index_nodename);
|
||||
set_remembered_pagetop_and_point (window);
|
||||
window_set_node_of_window (window, node);
|
||||
remember_window_and_node (window, node);
|
||||
window_clear_echo_area ();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* The user typed either a completed index label, or a partial string.
|
||||
Find an exact match, or, failing that, the first index entry containing
|
||||
the partial string. So, we just call info_next_index_match () with minor
|
||||
manipulation of INDEX_OFFSET. */
|
||||
{
|
||||
int old_offset;
|
||||
|
||||
/* Start the search right after/before this index. */
|
||||
if (count < 0)
|
||||
{
|
||||
register int i;
|
||||
for (i = 0; index_index[i]; i++);
|
||||
index_offset = i;
|
||||
}
|
||||
else
|
||||
index_offset = -1;
|
||||
|
||||
old_offset = index_offset;
|
||||
|
||||
/* The "last" string searched for is this one. */
|
||||
index_search = line;
|
||||
|
||||
/* Find it, or error. */
|
||||
info_next_index_match (window, count, 0);
|
||||
|
||||
/* If the search failed, return the index offset to where it belongs. */
|
||||
if (index_offset == old_offset)
|
||||
index_offset = 0;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
index_entry_exists (window, string)
|
||||
WINDOW *window;
|
||||
char *string;
|
||||
{
|
||||
register int i;
|
||||
FILE_BUFFER *fb;
|
||||
|
||||
/* If there is no previous search string, the user hasn't built an index
|
||||
yet. */
|
||||
if (!string)
|
||||
return 0;
|
||||
|
||||
fb = file_buffer_of_window (window);
|
||||
if (!initial_index_filename
|
||||
|| (strcmp (initial_index_filename, fb->filename) != 0))
|
||||
{
|
||||
info_free_references (index_index);
|
||||
index_index = info_indices_of_file_buffer (fb);
|
||||
}
|
||||
|
||||
/* If there is no index, that is an error. */
|
||||
if (!index_index)
|
||||
return 0;
|
||||
|
||||
for (i = 0; (i > -1) && (index_index[i]); i++)
|
||||
if (strcmp (string, index_index[i]->label) == 0)
|
||||
break;
|
||||
|
||||
/* If that failed, look for the next substring match. */
|
||||
if ((i < 0) || (!index_index[i]))
|
||||
{
|
||||
for (i = 0; (i > -1) && (index_index[i]); i++)
|
||||
if (string_in_line (string, index_index[i]->label) != -1)
|
||||
break;
|
||||
|
||||
if ((i > -1) && (index_index[i]))
|
||||
string_in_line (string, index_index[i]->label);
|
||||
}
|
||||
|
||||
/* If that failed, return 0. */
|
||||
if ((i < 0) || (!index_index[i]))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
DECLARE_INFO_COMMAND (info_next_index_match,
|
||||
_("Go to the next matching index item from the last `\\[index-search]' command"))
|
||||
{
|
||||
register int i;
|
||||
int partial, dir;
|
||||
NODE *node;
|
||||
|
||||
/* If there is no previous search string, the user hasn't built an index
|
||||
yet. */
|
||||
if (!index_search)
|
||||
{
|
||||
info_error (_("No previous index search string."));
|
||||
return;
|
||||
}
|
||||
|
||||
/* If there is no index, that is an error. */
|
||||
if (!index_index)
|
||||
{
|
||||
info_error (_("No index entries."));
|
||||
return;
|
||||
}
|
||||
|
||||
/* The direction of this search is controlled by the value of the
|
||||
numeric argument. */
|
||||
if (count < 0)
|
||||
dir = -1;
|
||||
else
|
||||
dir = 1;
|
||||
|
||||
/* Search for the next occurence of index_search. First try to find
|
||||
an exact match. */
|
||||
partial = 0;
|
||||
|
||||
for (i = index_offset + dir; (i > -1) && (index_index[i]); i += dir)
|
||||
if (strcmp (index_search, index_index[i]->label) == 0)
|
||||
break;
|
||||
|
||||
/* If that failed, look for the next substring match. */
|
||||
if ((i < 0) || (!index_index[i]))
|
||||
{
|
||||
for (i = index_offset + dir; (i > -1) && (index_index[i]); i += dir)
|
||||
if (string_in_line (index_search, index_index[i]->label) != -1)
|
||||
break;
|
||||
|
||||
if ((i > -1) && (index_index[i]))
|
||||
partial = string_in_line (index_search, index_index[i]->label);
|
||||
}
|
||||
|
||||
/* If that failed, print an error. */
|
||||
if ((i < 0) || (!index_index[i]))
|
||||
{
|
||||
info_error (_("No %sindex entries containing \"%s\"."),
|
||||
index_offset > 0 ? _("more ") : "", index_search);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Okay, we found the next one. Move the offset to the current entry. */
|
||||
index_offset = i;
|
||||
|
||||
/* Report to the user on what we have found. */
|
||||
{
|
||||
register int j;
|
||||
char *name = _("CAN'T SEE THIS");
|
||||
char *match;
|
||||
|
||||
for (j = 0; index_nodenames[j]; j++)
|
||||
{
|
||||
if ((i >= index_nodenames[j]->first) &&
|
||||
(i <= index_nodenames[j]->last))
|
||||
{
|
||||
name = index_nodenames[j]->name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we had a partial match, indicate to the user which part of the
|
||||
string matched. */
|
||||
match = xstrdup (index_index[i]->label);
|
||||
|
||||
if (partial && show_index_match)
|
||||
{
|
||||
int j, ls, start, upper;
|
||||
|
||||
ls = strlen (index_search);
|
||||
start = partial - ls;
|
||||
upper = isupper (match[start]) ? 1 : 0;
|
||||
|
||||
for (j = 0; j < ls; j++)
|
||||
if (upper)
|
||||
match[j + start] = info_tolower (match[j + start]);
|
||||
else
|
||||
match[j + start] = info_toupper (match[j + start]);
|
||||
}
|
||||
|
||||
{
|
||||
char *format;
|
||||
|
||||
format = replace_in_documentation
|
||||
(_("Found \"%s\" in %s. (`\\[next-index-match]' tries to find next.)"));
|
||||
|
||||
window_message_in_echo_area (format, match, name);
|
||||
}
|
||||
|
||||
free (match);
|
||||
}
|
||||
|
||||
/* Select the node corresponding to this index entry. */
|
||||
node = info_get_node (index_index[i]->filename, index_index[i]->nodename);
|
||||
|
||||
if (!node)
|
||||
{
|
||||
info_error (CANT_FILE_NODE,
|
||||
index_index[i]->filename, index_index[i]->nodename);
|
||||
return;
|
||||
}
|
||||
|
||||
set_remembered_pagetop_and_point (window);
|
||||
window_set_node_of_window (window, node);
|
||||
remember_window_and_node (window, node);
|
||||
|
||||
|
||||
/* Try to find an occurence of LABEL in this node. */
|
||||
{
|
||||
long start, loc;
|
||||
|
||||
start = window->line_starts[1] - window->node->contents;
|
||||
loc = info_target_search_node (node, index_index[i]->label, start);
|
||||
|
||||
if (loc != -1)
|
||||
{
|
||||
window->point = loc;
|
||||
window_adjust_pagetop (window);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
/* Info APROPOS: Search every known index. */
|
||||
/* */
|
||||
/* **************************************************************** */
|
||||
|
||||
/* For every menu item in DIR, search the indices of that file for
|
||||
SEARCH_STRING. */
|
||||
REFERENCE **
|
||||
apropos_in_all_indices (search_string, inform)
|
||||
char *search_string;
|
||||
int inform;
|
||||
{
|
||||
register int i, dir_index;
|
||||
REFERENCE **all_indices = (REFERENCE **)NULL;
|
||||
REFERENCE **dir_menu = (REFERENCE **)NULL;
|
||||
NODE *dir_node;
|
||||
|
||||
dir_node = info_get_node ("dir", "Top");
|
||||
if (dir_node)
|
||||
dir_menu = info_menu_of_node (dir_node);
|
||||
|
||||
if (!dir_menu)
|
||||
return NULL;
|
||||
|
||||
/* For every menu item in DIR, get the associated node's file buffer and
|
||||
read the indices of that file buffer. Gather all of the indices into
|
||||
one large one. */
|
||||
for (dir_index = 0; dir_menu[dir_index]; dir_index++)
|
||||
{
|
||||
REFERENCE **this_index, *this_item;
|
||||
NODE *this_node;
|
||||
FILE_BUFFER *this_fb;
|
||||
|
||||
this_item = dir_menu[dir_index];
|
||||
|
||||
if (!this_item->filename)
|
||||
{
|
||||
if (dir_node->parent)
|
||||
this_item->filename = xstrdup (dir_node->parent);
|
||||
else
|
||||
this_item->filename = xstrdup (dir_node->filename);
|
||||
}
|
||||
|
||||
/* Find this node. If we cannot find it, try using the label of the
|
||||
entry as a file (i.e., "(LABEL)Top"). */
|
||||
this_node = info_get_node (this_item->filename, this_item->nodename);
|
||||
|
||||
if (!this_node && this_item->nodename &&
|
||||
(strcmp (this_item->label, this_item->nodename) == 0))
|
||||
this_node = info_get_node (this_item->label, "Top");
|
||||
|
||||
if (!this_node)
|
||||
continue;
|
||||
|
||||
/* Get the file buffer associated with this node. */
|
||||
{
|
||||
char *files_name;
|
||||
|
||||
files_name = this_node->parent;
|
||||
if (!files_name)
|
||||
files_name = this_node->filename;
|
||||
|
||||
this_fb = info_find_file (files_name);
|
||||
|
||||
if (this_fb && inform)
|
||||
message_in_echo_area (_("Scanning indices of \"%s\"..."), files_name);
|
||||
|
||||
this_index = info_indices_of_file_buffer (this_fb);
|
||||
free (this_node);
|
||||
|
||||
if (this_fb && inform)
|
||||
unmessage_in_echo_area ();
|
||||
}
|
||||
|
||||
if (this_index)
|
||||
{
|
||||
/* Remember the filename which contains this set of references. */
|
||||
for (i = 0; this_index && this_index[i]; i++)
|
||||
if (!this_index[i]->filename)
|
||||
this_index[i]->filename = xstrdup (this_fb->filename);
|
||||
|
||||
/* Concatenate with the other indices. */
|
||||
all_indices = info_concatenate_references (all_indices, this_index);
|
||||
}
|
||||
}
|
||||
|
||||
info_free_references (dir_menu);
|
||||
|
||||
/* Build a list of the references which contain SEARCH_STRING. */
|
||||
if (all_indices)
|
||||
{
|
||||
REFERENCE *entry, **apropos_list = (REFERENCE **)NULL;
|
||||
int apropos_list_index = 0;
|
||||
int apropos_list_slots = 0;
|
||||
|
||||
for (i = 0; (entry = all_indices[i]); i++)
|
||||
{
|
||||
if (string_in_line (search_string, entry->label) != -1)
|
||||
{
|
||||
add_pointer_to_array
|
||||
(entry, apropos_list_index, apropos_list, apropos_list_slots,
|
||||
100, REFERENCE *);
|
||||
}
|
||||
else
|
||||
{
|
||||
maybe_free (entry->label);
|
||||
maybe_free (entry->filename);
|
||||
maybe_free (entry->nodename);
|
||||
free (entry);
|
||||
}
|
||||
}
|
||||
|
||||
free (all_indices);
|
||||
all_indices = apropos_list;
|
||||
}
|
||||
return (all_indices);
|
||||
}
|
||||
|
||||
#define APROPOS_NONE \
|
||||
_("No available info files reference \"%s\" in their indices.")
|
||||
|
||||
void
|
||||
info_apropos (string)
|
||||
char *string;
|
||||
{
|
||||
REFERENCE **apropos_list;
|
||||
|
||||
apropos_list = apropos_in_all_indices (string, 0);
|
||||
|
||||
if (!apropos_list)
|
||||
{
|
||||
info_error (APROPOS_NONE, string);
|
||||
}
|
||||
else
|
||||
{
|
||||
register int i;
|
||||
REFERENCE *entry;
|
||||
|
||||
for (i = 0; (entry = apropos_list[i]); i++)
|
||||
fprintf (stderr, "\"(%s)%s\" -- %s\n",
|
||||
entry->filename, entry->nodename, entry->label);
|
||||
}
|
||||
info_free_references (apropos_list);
|
||||
}
|
||||
|
||||
static char *apropos_list_nodename = "*Apropos*";
|
||||
|
||||
DECLARE_INFO_COMMAND (info_index_apropos,
|
||||
_("Grovel all known info file's indices for a string and build a menu"))
|
||||
{
|
||||
char *line;
|
||||
|
||||
line = info_read_in_echo_area (window, _("Index apropos: "));
|
||||
|
||||
window = active_window;
|
||||
|
||||
/* User aborted? */
|
||||
if (!line)
|
||||
{
|
||||
info_abort_key (window, 1, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
/* User typed something? */
|
||||
if (*line)
|
||||
{
|
||||
REFERENCE **apropos_list;
|
||||
NODE *apropos_node;
|
||||
|
||||
apropos_list = apropos_in_all_indices (line, 1);
|
||||
|
||||
if (!apropos_list)
|
||||
{
|
||||
info_error (APROPOS_NONE, line);
|
||||
}
|
||||
else
|
||||
{
|
||||
register int i;
|
||||
char *line_buffer;
|
||||
|
||||
initialize_message_buffer ();
|
||||
printf_to_message_buffer
|
||||
(_("\n* Menu: Nodes whoses indices contain \"%s\":\n"), line);
|
||||
line_buffer = (char *)xmalloc (500);
|
||||
|
||||
for (i = 0; apropos_list[i]; i++)
|
||||
{
|
||||
int len;
|
||||
sprintf (line_buffer, "* (%s)%s::",
|
||||
apropos_list[i]->filename, apropos_list[i]->nodename);
|
||||
len = pad_to (36, line_buffer);
|
||||
sprintf (line_buffer + len, "%s", apropos_list[i]->label);
|
||||
printf_to_message_buffer ("%s\n", line_buffer);
|
||||
}
|
||||
free (line_buffer);
|
||||
}
|
||||
|
||||
apropos_node = message_buffer_to_node ();
|
||||
add_gcable_pointer (apropos_node->contents);
|
||||
name_internal_node (apropos_node, apropos_list_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. */
|
||||
apropos_node->flags &= ~N_IsInternal;
|
||||
|
||||
/* Find/Create a window to contain this node. */
|
||||
{
|
||||
WINDOW *new;
|
||||
NODE *node;
|
||||
|
||||
set_remembered_pagetop_and_point (window);
|
||||
|
||||
/* If a window is visible and showing an apropos list already,
|
||||
re-use it. */
|
||||
for (new = windows; new; new = new->next)
|
||||
{
|
||||
node = new->node;
|
||||
|
||||
if (internal_info_node_p (node) &&
|
||||
(strcmp (node->nodename, apropos_list_nodename) == 0))
|
||||
break;
|
||||
}
|
||||
|
||||
/* If we couldn't find an existing window, try to use the next window
|
||||
in the chain. */
|
||||
if (!new && window->next)
|
||||
new = window->next;
|
||||
|
||||
/* If we still don't have a window, make a new one to contain
|
||||
the list. */
|
||||
if (!new)
|
||||
{
|
||||
WINDOW *old_active;
|
||||
|
||||
old_active = active_window;
|
||||
active_window = window;
|
||||
new = window_make_window ((NODE *)NULL);
|
||||
active_window = old_active;
|
||||
}
|
||||
|
||||
/* If we couldn't make a new window, use this one. */
|
||||
if (!new)
|
||||
new = window;
|
||||
|
||||
/* Lines do not wrap in this window. */
|
||||
new->flags |= W_NoWrap;
|
||||
|
||||
window_set_node_of_window (new, apropos_node);
|
||||
remember_window_and_node (new, apropos_node);
|
||||
active_window = new;
|
||||
}
|
||||
info_free_references (apropos_list);
|
||||
}
|
||||
free (line);
|
||||
|
||||
if (!info_error_was_printed)
|
||||
window_clear_echo_area ();
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
/* indices.h -- Functions defined in indices.c.
|
||||
$Id: indices.h,v 1.1.1.2 1998/03/22 20:42:34 law 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.
|
||||
|
||||
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_INDICES_H
|
||||
#define INFO_INDICES_H
|
||||
|
||||
/* User-visible variable controls the output of info-index-next. */
|
||||
extern int show_index_match;
|
||||
|
||||
extern REFERENCE **info_indices_of_window (), **info_indices_of_file_buffer ();
|
||||
extern void info_apropos ();
|
||||
|
||||
/* For every menu item in DIR, search the indices of that file for STRING. */
|
||||
REFERENCE **apropos_in_all_indices ();
|
||||
|
||||
/* User visible functions declared in indices.c. */
|
||||
extern void info_index_search (), info_next_index_match ();
|
||||
extern void do_info_index_search ();
|
||||
extern int index_intry_exists ();
|
||||
|
||||
#endif /* not INFO_INDICES_H */
|
File diff suppressed because it is too large
Load diff
|
@ -1,665 +0,0 @@
|
|||
/* info-utils.c -- Useful functions for manipulating Info file quirks. */
|
||||
|
||||
/* 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). */
|
||||
|
||||
#include "info.h"
|
||||
#include "info-utils.h"
|
||||
#if defined (HANDLE_MAN_PAGES)
|
||||
# include "man.h"
|
||||
#endif /* HANDLE_MAN_PAGES */
|
||||
|
||||
/* When non-zero, various display and input functions handle ISO Latin
|
||||
character sets correctly. */
|
||||
int ISO_Latin_p = 0;
|
||||
|
||||
/* Variable which holds the most recent filename parsed as a result of
|
||||
calling info_parse_xxx (). */
|
||||
char *info_parsed_filename = (char *)NULL;
|
||||
|
||||
/* Variable which holds the most recent nodename parsed as a result of
|
||||
calling info_parse_xxx (). */
|
||||
char *info_parsed_nodename = (char *)NULL;
|
||||
|
||||
/* Functions to remember a filename or nodename for later return. */
|
||||
static void save_filename (), saven_filename ();
|
||||
static void save_nodename (), saven_nodename ();
|
||||
|
||||
/* How to get a reference (either menu or cross). */
|
||||
static REFERENCE **info_references_internal ();
|
||||
|
||||
/* Parse the filename and nodename out of STRING. If STRING doesn't
|
||||
contain a filename (i.e., it is NOT (FILENAME)NODENAME) then set
|
||||
INFO_PARSED_FILENAME to NULL. If second argument NEWLINES_OKAY is
|
||||
non-zero, it says to allow the nodename specification to cross a
|
||||
newline boundary (i.e., only `,', `.', or `TAB' can end the spec). */
|
||||
void
|
||||
info_parse_node (string, newlines_okay)
|
||||
char *string;
|
||||
int newlines_okay;
|
||||
{
|
||||
register int i = 0;
|
||||
|
||||
/* Default the answer. */
|
||||
save_filename ((char *)NULL);
|
||||
save_nodename ((char *)NULL);
|
||||
|
||||
/* Special case of nothing passed. Return nothing. */
|
||||
if (!string || !*string)
|
||||
return;
|
||||
|
||||
string += skip_whitespace (string);
|
||||
|
||||
/* Check for (FILENAME)NODENAME. */
|
||||
if (*string == '(')
|
||||
{
|
||||
i = 0;
|
||||
/* Advance past the opening paren. */
|
||||
string++;
|
||||
|
||||
/* Find the closing paren. */
|
||||
while (string[i] && string[i] != ')')
|
||||
i++;
|
||||
|
||||
/* Remember parsed filename. */
|
||||
saven_filename (string, i);
|
||||
|
||||
/* Point directly at the nodename. */
|
||||
string += i;
|
||||
|
||||
if (*string)
|
||||
string++;
|
||||
}
|
||||
|
||||
/* Parse out nodename. */
|
||||
i = skip_node_characters (string, newlines_okay);
|
||||
saven_nodename (string, i);
|
||||
canonicalize_whitespace (info_parsed_nodename);
|
||||
if (info_parsed_nodename && !*info_parsed_nodename)
|
||||
{
|
||||
free (info_parsed_nodename);
|
||||
info_parsed_nodename = (char *)NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Return the node addressed by LABEL in NODE (usually one of "Prev:",
|
||||
"Next:", "Up:", "File:", or "Node:". After a call to this function,
|
||||
the global INFO_PARSED_NODENAME and INFO_PARSED_FILENAME contain
|
||||
the information. */
|
||||
void
|
||||
info_parse_label (label, node)
|
||||
char *label;
|
||||
NODE *node;
|
||||
{
|
||||
register int i;
|
||||
char *nodeline;
|
||||
|
||||
/* Default answer to failure. */
|
||||
save_nodename ((char *)NULL);
|
||||
save_filename ((char *)NULL);
|
||||
|
||||
/* Find the label in the first line of this node. */
|
||||
nodeline = node->contents;
|
||||
i = string_in_line (label, nodeline);
|
||||
|
||||
if (i == -1)
|
||||
return;
|
||||
|
||||
nodeline += i;
|
||||
nodeline += skip_whitespace (nodeline);
|
||||
info_parse_node (nodeline, DONT_SKIP_NEWLINES);
|
||||
}
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
/* Finding and Building Menus */
|
||||
/* */
|
||||
/* **************************************************************** */
|
||||
|
||||
/* Return a NULL terminated array of REFERENCE * which represents the menu
|
||||
found in NODE. If there is no menu in NODE, just return a NULL pointer. */
|
||||
REFERENCE **
|
||||
info_menu_of_node (node)
|
||||
NODE *node;
|
||||
{
|
||||
long position;
|
||||
SEARCH_BINDING search;
|
||||
REFERENCE **menu = (REFERENCE **)NULL;
|
||||
|
||||
search.buffer = node->contents;
|
||||
search.start = 0;
|
||||
search.end = node->nodelen;
|
||||
search.flags = S_FoldCase;
|
||||
|
||||
/* Find the start of the menu. */
|
||||
position = search_forward (INFO_MENU_LABEL, &search);
|
||||
|
||||
if (position == -1)
|
||||
return ((REFERENCE **) NULL);
|
||||
|
||||
/* We have the start of the menu now. Glean menu items from the rest
|
||||
of the node. */
|
||||
search.start = position + strlen (INFO_MENU_LABEL);
|
||||
search.start += skip_line (search.buffer + search.start);
|
||||
search.start--;
|
||||
menu = info_menu_items (&search);
|
||||
return (menu);
|
||||
}
|
||||
|
||||
/* Return a NULL terminated array of REFERENCE * which represents the cross
|
||||
refrences found in NODE. If there are no cross references in NODE, just
|
||||
return a NULL pointer. */
|
||||
REFERENCE **
|
||||
info_xrefs_of_node (node)
|
||||
NODE *node;
|
||||
{
|
||||
SEARCH_BINDING search;
|
||||
|
||||
#if defined (HANDLE_MAN_PAGES)
|
||||
if (node->flags & N_IsManPage)
|
||||
return (xrefs_of_manpage (node));
|
||||
#endif
|
||||
|
||||
search.buffer = node->contents;
|
||||
search.start = 0;
|
||||
search.end = node->nodelen;
|
||||
search.flags = S_FoldCase;
|
||||
|
||||
return (info_xrefs (&search));
|
||||
}
|
||||
|
||||
/* Glean menu entries from BINDING->buffer + BINDING->start until we
|
||||
have looked at the entire contents of BINDING. Return an array
|
||||
of REFERENCE * that represents each menu item in this range. */
|
||||
REFERENCE **
|
||||
info_menu_items (binding)
|
||||
SEARCH_BINDING *binding;
|
||||
{
|
||||
return (info_references_internal (INFO_MENU_ENTRY_LABEL, binding));
|
||||
}
|
||||
|
||||
/* Glean cross references from BINDING->buffer + BINDING->start until
|
||||
BINDING->end. Return an array of REFERENCE * that represents each
|
||||
cross reference in this range. */
|
||||
REFERENCE **
|
||||
info_xrefs (binding)
|
||||
SEARCH_BINDING *binding;
|
||||
{
|
||||
return (info_references_internal (INFO_XREF_LABEL, binding));
|
||||
}
|
||||
|
||||
/* Glean cross references or menu items from BINDING. Return an array
|
||||
of REFERENCE * that represents the items found. */
|
||||
static REFERENCE **
|
||||
info_references_internal (label, binding)
|
||||
char *label;
|
||||
SEARCH_BINDING *binding;
|
||||
{
|
||||
SEARCH_BINDING search;
|
||||
REFERENCE **refs = (REFERENCE **)NULL;
|
||||
int refs_index = 0, refs_slots = 0;
|
||||
int searching_for_menu_items = 0;
|
||||
long position;
|
||||
|
||||
search.buffer = binding->buffer;
|
||||
search.start = binding->start;
|
||||
search.end = binding->end;
|
||||
search.flags = S_FoldCase | S_SkipDest;
|
||||
|
||||
searching_for_menu_items = (strcasecmp (label, INFO_MENU_ENTRY_LABEL) == 0);
|
||||
|
||||
while ((position = search_forward (label, &search)) != -1)
|
||||
{
|
||||
int offset, start;
|
||||
char *refdef;
|
||||
REFERENCE *entry;
|
||||
|
||||
search.start = position;
|
||||
search.start += skip_whitespace (search.buffer + search.start);
|
||||
start = search.start - binding->start;
|
||||
refdef = search.buffer + search.start;
|
||||
offset = string_in_line (":", refdef);
|
||||
|
||||
/* When searching for menu items, if no colon, there is no
|
||||
menu item on this line. */
|
||||
if (offset == -1)
|
||||
{
|
||||
if (searching_for_menu_items)
|
||||
continue;
|
||||
else
|
||||
{
|
||||
int temp;
|
||||
|
||||
temp = skip_line (refdef);
|
||||
offset = string_in_line (":", refdef + temp);
|
||||
if (offset == -1)
|
||||
continue; /* Give up? */
|
||||
else
|
||||
offset += temp;
|
||||
}
|
||||
}
|
||||
|
||||
entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
|
||||
entry->filename = (char *)NULL;
|
||||
entry->nodename = (char *)NULL;
|
||||
entry->label = (char *)xmalloc (offset);
|
||||
strncpy (entry->label, refdef, offset - 1);
|
||||
entry->label[offset - 1] = '\0';
|
||||
canonicalize_whitespace (entry->label);
|
||||
|
||||
refdef += offset;
|
||||
entry->start = start;
|
||||
entry->end = refdef - binding->buffer;
|
||||
|
||||
/* If this reference entry continues with another ':' then the
|
||||
nodename is the same as the label. */
|
||||
if (*refdef == ':')
|
||||
{
|
||||
entry->nodename = xstrdup (entry->label);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* This entry continues with a specific nodename. Parse the
|
||||
nodename from the specification. */
|
||||
|
||||
refdef += skip_whitespace_and_newlines (refdef);
|
||||
|
||||
if (searching_for_menu_items)
|
||||
info_parse_node (refdef, DONT_SKIP_NEWLINES);
|
||||
else
|
||||
info_parse_node (refdef, SKIP_NEWLINES);
|
||||
|
||||
if (info_parsed_filename)
|
||||
entry->filename = xstrdup (info_parsed_filename);
|
||||
|
||||
if (info_parsed_nodename)
|
||||
entry->nodename = xstrdup (info_parsed_nodename);
|
||||
}
|
||||
|
||||
add_pointer_to_array
|
||||
(entry, refs_index, refs, refs_slots, 50, REFERENCE *);
|
||||
}
|
||||
return (refs);
|
||||
}
|
||||
|
||||
/* Get the entry associated with LABEL in MENU. Return a pointer to the
|
||||
REFERENCE if found, or NULL. */
|
||||
REFERENCE *
|
||||
info_get_labeled_reference (label, references)
|
||||
char *label;
|
||||
REFERENCE **references;
|
||||
{
|
||||
register int i;
|
||||
REFERENCE *entry;
|
||||
|
||||
for (i = 0; references && (entry = references[i]); i++)
|
||||
{
|
||||
if (strcmp (label, entry->label) == 0)
|
||||
return (entry);
|
||||
}
|
||||
return ((REFERENCE *)NULL);
|
||||
}
|
||||
|
||||
/* A utility function for concatenating REFERENCE **. Returns a new
|
||||
REFERENCE ** which is the concatenation of REF1 and REF2. The REF1
|
||||
and REF2 arrays are freed, but their contents are not. */
|
||||
REFERENCE **
|
||||
info_concatenate_references (ref1, ref2)
|
||||
REFERENCE **ref1, **ref2;
|
||||
{
|
||||
register int i, j;
|
||||
REFERENCE **result;
|
||||
int size;
|
||||
|
||||
/* With one argument passed as NULL, simply return the other arg. */
|
||||
if (!ref1)
|
||||
return (ref2);
|
||||
else if (!ref2)
|
||||
return (ref1);
|
||||
|
||||
/* Get the total size of the slots that we will need. */
|
||||
for (i = 0; ref1[i]; i++);
|
||||
size = i;
|
||||
for (i = 0; ref2[i]; i++);
|
||||
size += i;
|
||||
|
||||
result = (REFERENCE **)xmalloc ((1 + size) * sizeof (REFERENCE *));
|
||||
|
||||
/* Copy the contents over. */
|
||||
for (i = 0; ref1[i]; i++)
|
||||
result[i] = ref1[i];
|
||||
|
||||
j = i;
|
||||
for (i = 0; ref2[i]; i++)
|
||||
result[j++] = ref2[i];
|
||||
|
||||
result[j] = (REFERENCE *)NULL;
|
||||
free (ref1);
|
||||
free (ref2);
|
||||
return (result);
|
||||
}
|
||||
|
||||
/* Free the data associated with REFERENCES. */
|
||||
void
|
||||
info_free_references (references)
|
||||
REFERENCE **references;
|
||||
{
|
||||
register int i;
|
||||
REFERENCE *entry;
|
||||
|
||||
if (references)
|
||||
{
|
||||
for (i = 0; references && (entry = references[i]); i++)
|
||||
{
|
||||
maybe_free (entry->label);
|
||||
maybe_free (entry->filename);
|
||||
maybe_free (entry->nodename);
|
||||
|
||||
free (entry);
|
||||
}
|
||||
|
||||
free (references);
|
||||
}
|
||||
}
|
||||
|
||||
/* Search for sequences of whitespace or newlines in STRING, replacing
|
||||
all such sequences with just a single space. Remove whitespace from
|
||||
start and end of string. */
|
||||
void
|
||||
canonicalize_whitespace (string)
|
||||
char *string;
|
||||
{
|
||||
register int i, j;
|
||||
int len, whitespace_found, whitespace_loc;
|
||||
char *temp;
|
||||
|
||||
if (!string)
|
||||
return;
|
||||
|
||||
len = strlen (string);
|
||||
temp = (char *)xmalloc (1 + len);
|
||||
|
||||
/* Search for sequences of whitespace or newlines. Replace all such
|
||||
sequences in the string with just a single space. */
|
||||
|
||||
whitespace_found = 0;
|
||||
for (i = 0, j = 0; string[i]; i++)
|
||||
{
|
||||
if (whitespace_or_newline (string[i]))
|
||||
{
|
||||
whitespace_found++;
|
||||
whitespace_loc = i;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (whitespace_found && whitespace_loc)
|
||||
{
|
||||
whitespace_found = 0;
|
||||
|
||||
/* Suppress whitespace at start of string. */
|
||||
if (j)
|
||||
temp[j++] = ' ';
|
||||
}
|
||||
|
||||
temp[j++] = string[i];
|
||||
}
|
||||
}
|
||||
|
||||
/* Kill trailing whitespace. */
|
||||
if (j && whitespace (temp[j - 1]))
|
||||
j--;
|
||||
|
||||
temp[j] = '\0';
|
||||
strcpy (string, temp);
|
||||
free (temp);
|
||||
}
|
||||
|
||||
/* String representation of a char returned by printed_representation (). */
|
||||
static char the_rep[10];
|
||||
|
||||
/* Return a pointer to a string which is the printed representation
|
||||
of CHARACTER if it were printed at HPOS. */
|
||||
char *
|
||||
printed_representation (character, hpos)
|
||||
unsigned char character;
|
||||
int hpos;
|
||||
{
|
||||
register int i = 0;
|
||||
int printable_limit;
|
||||
|
||||
if (ISO_Latin_p)
|
||||
printable_limit = 160;
|
||||
else
|
||||
printable_limit = 127;
|
||||
|
||||
if (character == '\177')
|
||||
{
|
||||
the_rep[i++] = '^';
|
||||
the_rep[i++] = '?';
|
||||
}
|
||||
else if (iscntrl (character))
|
||||
{
|
||||
switch (character)
|
||||
{
|
||||
case '\r':
|
||||
case '\n':
|
||||
the_rep[i++] = character;
|
||||
break;
|
||||
|
||||
case '\t':
|
||||
{
|
||||
int tw;
|
||||
|
||||
tw = ((hpos + 8) & 0xf8) - hpos;
|
||||
while (i < tw)
|
||||
the_rep[i++] = ' ';
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
the_rep[i++] = '^';
|
||||
the_rep[i++] = (character | 0x40);
|
||||
}
|
||||
}
|
||||
else if (character > printable_limit)
|
||||
{
|
||||
sprintf (the_rep + i, "\\%0o", character);
|
||||
i = strlen (the_rep);
|
||||
}
|
||||
else
|
||||
the_rep[i++] = character;
|
||||
|
||||
the_rep[i] = '\0';
|
||||
|
||||
return (the_rep);
|
||||
}
|
||||
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
/* Functions Static To This File */
|
||||
/* */
|
||||
/* **************************************************************** */
|
||||
|
||||
/* Amount of space allocated to INFO_PARSED_FILENAME via xmalloc (). */
|
||||
static int parsed_filename_size = 0;
|
||||
|
||||
/* Amount of space allocated to INFO_PARSED_NODENAME via xmalloc (). */
|
||||
static int parsed_nodename_size = 0;
|
||||
|
||||
static void save_string (), saven_string ();
|
||||
|
||||
/* Remember FILENAME in PARSED_FILENAME. An empty FILENAME is translated
|
||||
to a NULL pointer in PARSED_FILENAME. */
|
||||
static void
|
||||
save_filename (filename)
|
||||
char *filename;
|
||||
{
|
||||
save_string (filename, &info_parsed_filename, &parsed_filename_size);
|
||||
}
|
||||
|
||||
/* Just like save_filename (), but you pass the length of the string. */
|
||||
static void
|
||||
saven_filename (filename, len)
|
||||
char *filename;
|
||||
int len;
|
||||
{
|
||||
saven_string (filename, len,
|
||||
&info_parsed_filename, &parsed_filename_size);
|
||||
}
|
||||
|
||||
/* Remember NODENAME in PARSED_NODENAME. An empty NODENAME is translated
|
||||
to a NULL pointer in PARSED_NODENAME. */
|
||||
static void
|
||||
save_nodename (nodename)
|
||||
char *nodename;
|
||||
{
|
||||
save_string (nodename, &info_parsed_nodename, &parsed_nodename_size);
|
||||
}
|
||||
|
||||
/* Just like save_nodename (), but you pass the length of the string. */
|
||||
static void
|
||||
saven_nodename (nodename, len)
|
||||
char *nodename;
|
||||
int len;
|
||||
{
|
||||
saven_string (nodename, len,
|
||||
&info_parsed_nodename, &parsed_nodename_size);
|
||||
}
|
||||
|
||||
/* Remember STRING in STRING_P. STRING_P should currently have STRING_SIZE_P
|
||||
bytes allocated to it. An empty STRING is translated to a NULL pointer
|
||||
in STRING_P. */
|
||||
static void
|
||||
save_string (string, string_p, string_size_p)
|
||||
char *string;
|
||||
char **string_p;
|
||||
int *string_size_p;
|
||||
{
|
||||
if (!string || !*string)
|
||||
{
|
||||
if (*string_p)
|
||||
free (*string_p);
|
||||
|
||||
*string_p = (char *)NULL;
|
||||
*string_size_p = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strlen (string) >= *string_size_p)
|
||||
*string_p = (char *)xrealloc
|
||||
(*string_p, (*string_size_p = 1 + strlen (string)));
|
||||
|
||||
strcpy (*string_p, string);
|
||||
}
|
||||
}
|
||||
|
||||
/* Just like save_string (), but you also pass the length of STRING. */
|
||||
static void
|
||||
saven_string (string, len, string_p, string_size_p)
|
||||
char *string;
|
||||
int len;
|
||||
char **string_p;
|
||||
int *string_size_p;
|
||||
{
|
||||
if (!string)
|
||||
{
|
||||
if (*string_p)
|
||||
free (*string_p);
|
||||
|
||||
*string_p = (char *)NULL;
|
||||
*string_size_p = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (len >= *string_size_p)
|
||||
*string_p = (char *)xrealloc (*string_p, (*string_size_p = 1 + len));
|
||||
|
||||
strncpy (*string_p, string, len);
|
||||
(*string_p)[len] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
/* Return a pointer to the part of PATHNAME that simply defines the file. */
|
||||
char *
|
||||
filename_non_directory (pathname)
|
||||
char *pathname;
|
||||
{
|
||||
char *filename;
|
||||
|
||||
filename = (char *) strrchr (pathname, '/');
|
||||
|
||||
if (filename)
|
||||
filename++;
|
||||
else
|
||||
filename = pathname;
|
||||
|
||||
return (filename);
|
||||
}
|
||||
|
||||
/* Return non-zero if NODE is one especially created by Info. */
|
||||
int
|
||||
internal_info_node_p (node)
|
||||
NODE *node;
|
||||
{
|
||||
#if defined (NEVER)
|
||||
if (node &&
|
||||
(node->filename && !*node->filename) &&
|
||||
!node->parent && node->nodename)
|
||||
return (1);
|
||||
else
|
||||
return (0);
|
||||
#else
|
||||
return ((node != (NODE *)NULL) && ((node->flags & N_IsInternal) != 0));
|
||||
#endif /* !NEVER */
|
||||
}
|
||||
|
||||
/* Make NODE appear to be one especially created by Info. */
|
||||
void
|
||||
name_internal_node (node, name)
|
||||
NODE *node;
|
||||
char *name;
|
||||
{
|
||||
if (!node)
|
||||
return;
|
||||
|
||||
node->filename = "";
|
||||
node->parent = (char *)NULL;
|
||||
node->nodename = name;
|
||||
node->flags |= N_IsInternal;
|
||||
}
|
||||
|
||||
/* Return the window displaying NAME, the name of an internally created
|
||||
Info window. */
|
||||
WINDOW *
|
||||
get_internal_info_window (name)
|
||||
char *name;
|
||||
{
|
||||
WINDOW *win;
|
||||
|
||||
for (win = windows; win; win = win->next)
|
||||
if (internal_info_node_p (win->node) &&
|
||||
(strcmp (win->node->nodename, name) == 0))
|
||||
break;
|
||||
|
||||
return (win);
|
||||
}
|
|
@ -1,140 +0,0 @@
|
|||
/* info-utils.h -- Exported functions and variables from info-util.c.
|
||||
$Id: info-utils.h,v 1.1.1.2 1998/03/22 20:42:36 law Exp $
|
||||
|
||||
This file is part of GNU Info, a program for reading online documentation
|
||||
stored in Info format.
|
||||
|
||||
Copyright (C) 1993, 96 Free Software Foundation, Inc.
|
||||
|
||||
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_UTILS_H
|
||||
#define INFO_UTILS_H
|
||||
|
||||
#if !defined (HAVE_STRCHR)
|
||||
# undef strchr
|
||||
# undef strrchr
|
||||
# define strchr index
|
||||
# define strrchr rindex
|
||||
#endif /* !HAVE_STRCHR */
|
||||
|
||||
#include "nodes.h"
|
||||
#include "window.h"
|
||||
#include "search.h"
|
||||
|
||||
/* Structure which describes a node reference, such as a menu entry or
|
||||
cross reference. Arrays of such references can be built by calling
|
||||
info_menus_of_node () or info_xrefs_of_node (). */
|
||||
typedef struct {
|
||||
char *label; /* User Label. */
|
||||
char *filename; /* File where this node can be found. */
|
||||
char *nodename; /* Name of the node. */
|
||||
int start, end; /* Offsets within the containing node of LABEL. */
|
||||
} REFERENCE;
|
||||
|
||||
/* When non-zero, various display and input functions handle ISO Latin
|
||||
character sets correctly. */
|
||||
extern int ISO_Latin_p;
|
||||
|
||||
/* Variable which holds the most recent filename parsed as a result of
|
||||
calling info_parse_xxx (). */
|
||||
extern char *info_parsed_filename;
|
||||
|
||||
/* Variable which holds the most recent nodename parsed as a result of
|
||||
calling info_parse_xxx (). */
|
||||
extern char *info_parsed_nodename;
|
||||
|
||||
/* Parse the filename and nodename out of STRING. If STRING doesn't
|
||||
contain a filename (i.e., it is NOT (FILENAME)NODENAME) then set
|
||||
INFO_PARSED_FILENAME to NULL. If second argument NEWLINES_OKAY is
|
||||
non-zero, it says to allow the nodename specification to cross a
|
||||
newline boundary (i.e., only `,', `.', or `TAB' can end the spec). */
|
||||
void info_parse_node ();
|
||||
|
||||
/* Return a NULL terminated array of REFERENCE * which represents the menu
|
||||
found in NODE. If there is no menu in NODE, just return a NULL pointer. */
|
||||
extern REFERENCE **info_menu_of_node ();
|
||||
|
||||
/* Return a NULL terminated array of REFERENCE * which represents the cross
|
||||
refrences found in NODE. If there are no cross references in NODE, just
|
||||
return a NULL pointer. */
|
||||
extern REFERENCE **info_xrefs_of_node ();
|
||||
|
||||
/* Glean cross references from BINDING->buffer + BINDING->start until
|
||||
BINDING->end. Return an array of REFERENCE * that represents each
|
||||
cross reference in this range. */
|
||||
extern REFERENCE **info_xrefs ();
|
||||
|
||||
/* Get the entry associated with LABEL in REFERENCES. Return a pointer to
|
||||
the reference if found, or NULL. */
|
||||
extern REFERENCE *info_get_labeled_reference ();
|
||||
|
||||
/* Glean menu entries from BINDING->buffer + BINDING->start until we
|
||||
have looked at the entire contents of BINDING. Return an array
|
||||
of REFERENCE * that represents each menu item in this range. */
|
||||
extern REFERENCE **info_menu_items ();
|
||||
|
||||
/* A utility function for concatenating REFERENCE **. Returns a new
|
||||
REFERENCE ** which is the concatenation of REF1 and REF2. The REF1
|
||||
and REF2 arrays are freed, but their contents are not. */
|
||||
REFERENCE **info_concatenate_references ();
|
||||
|
||||
/* Free the data associated with REFERENCES. */
|
||||
extern void info_free_references ();
|
||||
|
||||
/* Search for sequences of whitespace or newlines in STRING, replacing
|
||||
all such sequences with just a single space. Remove whitespace from
|
||||
start and end of string. */
|
||||
void canonicalize_whitespace ();
|
||||
|
||||
/* Return a pointer to a string which is the printed representation
|
||||
of CHARACTER if it were printed at HPOS. */
|
||||
extern char *printed_representation ();
|
||||
|
||||
/* Return a pointer to the part of PATHNAME that simply defines the file. */
|
||||
extern char *filename_non_directory ();
|
||||
|
||||
/* Return non-zero if NODE is one especially created by Info. */
|
||||
extern int internal_info_node_p ();
|
||||
|
||||
/* Make NODE appear to be one especially created by Info, and give it NAME. */
|
||||
extern void name_internal_node ();
|
||||
|
||||
/* Return the window displaying NAME, the name of an internally created
|
||||
Info window. */
|
||||
extern WINDOW *get_internal_info_window ();
|
||||
|
||||
/* Return the node addressed by LABEL in NODE (usually one of "Prev:",
|
||||
"Next:", "Up:", "File:", or "Node:". After a call to this function,
|
||||
the global INFO_PARSED_NODENAME and INFO_PARSED_FILENAME contain
|
||||
the information. */
|
||||
extern void info_parse_label (/* label, node */);
|
||||
|
||||
#define info_label_was_found \
|
||||
(info_parsed_nodename != NULL || info_parsed_filename != NULL)
|
||||
|
||||
#define info_file_label_of_node(n) info_parse_label (INFO_FILE_LABEL, n)
|
||||
#define info_next_label_of_node(n) info_parse_label (INFO_NEXT_LABEL, n)
|
||||
#define info_up_label_of_node(n) info_parse_label (INFO_UP_LABEL, n)
|
||||
#define info_prev_label_of_node(n) \
|
||||
do { \
|
||||
info_parse_label (INFO_PREV_LABEL, n); \
|
||||
if (!info_label_was_found) \
|
||||
info_parse_label (INFO_ALTPREV_LABEL, n); \
|
||||
} while (0)
|
||||
|
||||
#endif /* not INFO_UTILS_H */
|
|
@ -1,229 +0,0 @@
|
|||
.TH info 1 "7th December 1990"
|
||||
.SH NAME
|
||||
info \- GNU's hypertext system
|
||||
.SH SYNOPSIS
|
||||
.B info
|
||||
[
|
||||
.B \-\-option-name option-value
|
||||
]
|
||||
.B \menu-item...
|
||||
.SH COPYRIGHT
|
||||
.if n Copyright (C) 1989, 1993 Free Software Foundation, Inc.
|
||||
.if t Copyright \(co 1989, 1993 Free Software Foundation, Inc.
|
||||
.SH DESCRIPTION
|
||||
.LP
|
||||
The GNU project has a hypertext system called
|
||||
.I Info
|
||||
which allows the same source file to be either printed as a
|
||||
paper manual, or viewed using
|
||||
.B info.
|
||||
It is possible to use the
|
||||
.B info
|
||||
program from inside Emacs, or to use the stand-alone version described here.
|
||||
This manual page gives a brief summary of its capabilities.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-\-directory directory-path
|
||||
Add
|
||||
.B directory-path
|
||||
to the list of directory paths searched when
|
||||
.B info
|
||||
needs to find a file. You may issue
|
||||
.B \-\-directory
|
||||
multiple times.
|
||||
Alternatively, you may specify a value for the environment variable
|
||||
.B INFOPATH;
|
||||
if
|
||||
.B \-\-directory
|
||||
is not given, the value of
|
||||
.B INFOPATH
|
||||
is used. The value of
|
||||
.B INFOPATH
|
||||
is a colon separated list of directory names. If you do not supply either
|
||||
.B INFOPATH
|
||||
or
|
||||
.B \-\-directory-path,
|
||||
.B info
|
||||
uses a default path.
|
||||
.TP
|
||||
.B \-f filename
|
||||
Specify a particular
|
||||
.B info
|
||||
file to visit. By default,
|
||||
.B info
|
||||
visits
|
||||
the file
|
||||
.B dir;
|
||||
if you use this option,
|
||||
.B info
|
||||
will start with
|
||||
.B (FILENAME)Top
|
||||
as the first file and node.
|
||||
.TP
|
||||
.B \-n nodename
|
||||
Specify a particular node to visit in the initial file that
|
||||
.B info
|
||||
loads. This is especially useful in conjunction with
|
||||
.B \-\-file.
|
||||
You may specify
|
||||
.B \-\-node
|
||||
multiple times.
|
||||
.TP
|
||||
.B -o file
|
||||
Direct output to
|
||||
.B file
|
||||
instead of starting an interactive
|
||||
.B info
|
||||
session.
|
||||
.TP
|
||||
.B \-h
|
||||
Produce a relatively brief description of the available
|
||||
.B info
|
||||
options.
|
||||
.TP
|
||||
.B \-\-version
|
||||
Print the version information of
|
||||
.B info
|
||||
and exit.
|
||||
.TP
|
||||
.B menu-item
|
||||
.B info
|
||||
treats its remaining arguments as the names of menu items.
|
||||
The first argument is a menu item in the initial node visited,
|
||||
while the second argument is a menu item in the first argument's
|
||||
node. You can easily move to the node of your choice by
|
||||
specifying the menu names which describe the path to that node.
|
||||
For example,
|
||||
|
||||
.B info emacs buffers
|
||||
|
||||
first selects the menu item
|
||||
.B emacs
|
||||
in the node
|
||||
.B (dir)Top,
|
||||
and then selects the menu item
|
||||
.B buffers
|
||||
in the node
|
||||
.B (emacs)Top.
|
||||
.SH COMMANDS
|
||||
When in
|
||||
.B info
|
||||
the following commands are available:
|
||||
.TP
|
||||
.B h
|
||||
Invoke the Info tutorial.
|
||||
.TP
|
||||
.B ?
|
||||
Get a short summary of
|
||||
.B info
|
||||
commands.
|
||||
.TP
|
||||
.B h
|
||||
Select the
|
||||
.B info
|
||||
node from the main directory; this is much more complete than just
|
||||
using
|
||||
.B ?.
|
||||
.TP
|
||||
.B Ctrl-g
|
||||
Abort whatever you are doing.
|
||||
.TP
|
||||
.B Ctrl-l
|
||||
Redraw the screen.
|
||||
.PP
|
||||
Selecting other nodes:
|
||||
.TP
|
||||
.B n
|
||||
Move to the "next" node of this node.
|
||||
.TP
|
||||
.B p
|
||||
Move to the "previous" node of this node.
|
||||
.TP
|
||||
.B u
|
||||
Move to this node's "up" node.
|
||||
.TP
|
||||
.B m
|
||||
Pick a menu item specified by name. Picking a menu item causes another
|
||||
node to be selected. You do not need to type a complete nodename; if
|
||||
you type a few letters and then a space or tab
|
||||
.B info
|
||||
will try to fill in the rest of the nodename. If you ask for further
|
||||
completion without typing any more characters you'll be given a list
|
||||
of possibilities; you can also get the list with
|
||||
.B ?.
|
||||
If you type a few characters and then hit return
|
||||
.B info
|
||||
will try to do a completion, and if it is ambigous use the first possibility.
|
||||
.TP
|
||||
.B f
|
||||
Follow a cross reference. You are asked for the name of the reference,
|
||||
using command completion as for
|
||||
.B m.
|
||||
.TP
|
||||
.B l
|
||||
Move to the last node you were at.
|
||||
.PP
|
||||
Moving within a node:
|
||||
.TP
|
||||
.B Space
|
||||
Scroll forward a page.
|
||||
.TP
|
||||
.B DEL
|
||||
Scroll backward a page.
|
||||
.TP
|
||||
.B b
|
||||
Go to the beginning of this node.
|
||||
.PP
|
||||
Advanced commands:
|
||||
.TP
|
||||
.B q
|
||||
Quit
|
||||
.B info.
|
||||
.TP
|
||||
.B 1
|
||||
Pick first item in node's menu.
|
||||
.TP
|
||||
.B 2 \-\- 5
|
||||
Pick second ... fifth item in node's menu.
|
||||
.TP
|
||||
.B g
|
||||
Move to node specified by name. You may include a filename as well,
|
||||
as
|
||||
.B (FILENAME)NODENAME.
|
||||
.TP
|
||||
.B s
|
||||
Search through this
|
||||
.B info
|
||||
file for a specified string, and select the node in which
|
||||
the next occurrence is found.
|
||||
.TP
|
||||
.B M-x print-node
|
||||
Pipe the contents of the current node through the command in the
|
||||
environment variable
|
||||
.B INFO_PRINT_COMMAND.
|
||||
If the variable does not exist, the node is simply piped to
|
||||
.B lpr.
|
||||
.SH ENVIRONMENT
|
||||
.TP
|
||||
.B INFOPATH
|
||||
A colon-separated list of directories to search for
|
||||
.B info
|
||||
files. Used if
|
||||
.B \-\-directory
|
||||
is not given.
|
||||
.TP
|
||||
.B INFO_PRINT_COMMAND
|
||||
The command used for printing.
|
||||
.SH SEE ALSO
|
||||
.BR emacs (1)
|
||||
.SH AUTHOR
|
||||
.RS
|
||||
Brian Fox, Free Software Foundation
|
||||
.br
|
||||
bfox@ai.mit.edu
|
||||
.SH MANUAL AUTHOR
|
||||
.RS
|
||||
Robert Lupton; updated by Robert J. Chassell.
|
||||
.br
|
||||
rhl@astro.princeton.edu; bob@gnu.ai.mit.edu
|
|
@ -1,627 +0,0 @@
|
|||
/* info.c -- Display nodes of Info files in multiple windows.
|
||||
$Id: info.c,v 1.1.1.3 1998/03/24 18:20:13 law Exp $
|
||||
|
||||
Copyright (C) 1993, 96, 97, 98 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
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 */
|
||||
|
||||
/* The version numbers of this version of Info. */
|
||||
int info_major_version = 2;
|
||||
int info_minor_version = 18;
|
||||
|
||||
/* basename (argv[0]) */
|
||||
static char *program_name = NULL;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* 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' },
|
||||
{ "help", 0, &print_help_p, 1 },
|
||||
{ "version", 0, &print_version_p, 1 },
|
||||
{ "dribble", 1, 0, DRIBBLE_OPTION },
|
||||
{ "restore", 1, 0, RESTORE_OPTION },
|
||||
{ "index-search", 1, 0, IDXSRCH_OPTION },
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
/* String describing the shorthand versions of the long options found above. */
|
||||
static char *short_options = "d:n:f:o:s";
|
||||
|
||||
/* 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 ();
|
||||
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
/* 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. */
|
||||
|
||||
remember_info_program_name (argv[0]);
|
||||
|
||||
#ifdef HAVE_SETLOCALE
|
||||
/* Set locale via LC_ALL. */
|
||||
setlocale (LC_ALL, "");
|
||||
#endif
|
||||
|
||||
/* Set the text message domain. */
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
while (1)
|
||||
{
|
||||
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 is specifying that she wishes to dump the subnodes of
|
||||
the node that she is dumping. */
|
||||
case 's':
|
||||
dump_subnodes = 1;
|
||||
break;
|
||||
|
||||
/* 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."));
|
||||
exit (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) %s\n", program_name, PACKAGE, VERSION,
|
||||
version_string ());
|
||||
printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
|
||||
There is NO warranty. You may redistribute this software\n\
|
||||
under the terms of the GNU General Public License.\n\
|
||||
For more information about these matters, see the files named COPYING.\n"),
|
||||
"1998");
|
||||
exit (0);
|
||||
}
|
||||
|
||||
/* If the `--help' option was present, show the help and exit. */
|
||||
if (print_help_p)
|
||||
{
|
||||
info_short_help ();
|
||||
exit (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_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)
|
||||
{
|
||||
*temp = 0;
|
||||
info_add_path (directory_name, INFOPATH_PREPEND);
|
||||
}
|
||||
|
||||
free (directory_name);
|
||||
}
|
||||
|
||||
/* 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);
|
||||
exit (0);
|
||||
}
|
||||
|
||||
/* Get the initial Info node. It is either "(dir)Top", or what the user
|
||||
specifed with values in user_filename and user_nodenames. */
|
||||
initial_node = info_get_node (user_filename,
|
||||
user_nodenames ? user_nodenames[0] : NULL);
|
||||
|
||||
/* 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
|
||||
(CANT_FIND_NODE, user_nodenames ? user_nodenames[0] : "Top");
|
||||
exit (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);
|
||||
|
||||
exit (0);
|
||||
}
|
||||
|
||||
/* If the user specified `--index-search=STRING', start the info
|
||||
session in the node corresponding to the first match. */
|
||||
if (index_search_p)
|
||||
{
|
||||
int status = 0;
|
||||
|
||||
initialize_info_session (initial_node, 0);
|
||||
|
||||
if (index_entry_exists (windows, index_search_string))
|
||||
{
|
||||
terminal_clear_screen ();
|
||||
terminal_prep_terminal ();
|
||||
display_update_display (windows);
|
||||
info_last_executed_command = (VFunction *)NULL;
|
||||
|
||||
do_info_index_search (windows, 0, index_search_string);
|
||||
|
||||
info_read_and_dispatch ();
|
||||
|
||||
terminal_unprep_terminal ();
|
||||
|
||||
/* On program exit, leave the cursor at the bottom of the
|
||||
window, and restore the terminal IO. */
|
||||
terminal_goto_xy (0, screenheight - 1);
|
||||
terminal_clear_to_eol ();
|
||||
fflush (stdout);
|
||||
}
|
||||
else
|
||||
{
|
||||
fputs (_("no entries found\n"), stderr);
|
||||
status = 2;
|
||||
}
|
||||
|
||||
close_dribble_file ();
|
||||
exit (status);
|
||||
}
|
||||
|
||||
/* If there are arguments remaining, they are the names of menu items
|
||||
in sequential info files starting from the first one loaded. That
|
||||
file name is either "dir", or the contents of user_filename if one
|
||||
was specified. */
|
||||
while (optind != argc)
|
||||
{
|
||||
REFERENCE **menu;
|
||||
REFERENCE *entry;
|
||||
NODE *node;
|
||||
char *arg;
|
||||
static char *first_arg = (char *)NULL;
|
||||
|
||||
/* Remember the name of the menu entry we want. */
|
||||
arg = argv[optind++];
|
||||
|
||||
if (!first_arg)
|
||||
first_arg = arg;
|
||||
|
||||
/* Build and return a list of the menu items in this node. */
|
||||
menu = info_menu_of_node (initial_node);
|
||||
|
||||
/* If there wasn't a menu item in this node, stop here, but let
|
||||
the user continue to use Info. Perhaps they wanted this node
|
||||
and didn't realize it. */
|
||||
if (!menu)
|
||||
{
|
||||
#if defined (HANDLE_MAN_PAGES)
|
||||
if (first_arg == arg)
|
||||
{
|
||||
node = make_manpage_node (first_arg);
|
||||
if (node)
|
||||
goto maybe_got_node;
|
||||
}
|
||||
#endif /* HANDLE_MAN_PAGES */
|
||||
begin_info_session_with_error
|
||||
(initial_node, _("There is no menu in this node."));
|
||||
exit (0);
|
||||
}
|
||||
|
||||
/* Find the specified menu item. */
|
||||
entry = info_get_labeled_reference (arg, menu);
|
||||
|
||||
/* If the item wasn't found, search the list sloppily. Perhaps this
|
||||
user typed "buffer" when they really meant "Buffers". */
|
||||
if (!entry)
|
||||
{
|
||||
register int i;
|
||||
int best_guess = -1;
|
||||
|
||||
for (i = 0; (entry = menu[i]); i++)
|
||||
{
|
||||
if (strcasecmp (entry->label, arg) == 0)
|
||||
break;
|
||||
else
|
||||
if (strncasecmp (entry->label, arg, strlen (arg)) == 0)
|
||||
best_guess = i;
|
||||
}
|
||||
|
||||
if (!entry && best_guess != -1)
|
||||
entry = menu[best_guess];
|
||||
}
|
||||
|
||||
/* If we failed to find the reference, start Info with the current
|
||||
node anyway. It is probably a misspelling. */
|
||||
if (!entry)
|
||||
{
|
||||
char *error_message = _("There is no menu item \"%s\" in this node.");
|
||||
|
||||
#if defined (HANDLE_MAN_PAGES)
|
||||
if (first_arg == arg)
|
||||
{
|
||||
node = make_manpage_node (first_arg);
|
||||
if (node)
|
||||
goto maybe_got_node;
|
||||
}
|
||||
#endif /* HANDLE_MAN_PAGES */
|
||||
|
||||
info_free_references (menu);
|
||||
|
||||
/* If we were supposed to dump this node, complain. */
|
||||
if (user_output_filename)
|
||||
info_error (error_message, arg);
|
||||
else
|
||||
begin_info_session_with_error (initial_node, error_message, arg);
|
||||
|
||||
exit (0);
|
||||
}
|
||||
|
||||
/* We have found the reference that the user specified. Clean it
|
||||
up a little bit. */
|
||||
if (!entry->filename)
|
||||
{
|
||||
if (initial_node->parent)
|
||||
entry->filename = xstrdup (initial_node->parent);
|
||||
else
|
||||
entry->filename = xstrdup (initial_node->filename);
|
||||
}
|
||||
|
||||
/* Find this node. If we can find it, then turn the initial_node
|
||||
into this one. If we cannot find it, try using the label of the
|
||||
entry as a file (i.e., "(LABEL)Top"). Otherwise the Info file is
|
||||
malformed in some way, and we will just use the current value of
|
||||
initial node. */
|
||||
node = info_get_node (entry->filename, entry->nodename);
|
||||
|
||||
#if defined (HANDLE_MAN_PAGES)
|
||||
if ((first_arg == arg) && !node)
|
||||
{
|
||||
node = make_manpage_node (first_arg);
|
||||
if (node)
|
||||
goto maybe_got_node;
|
||||
}
|
||||
#endif /* HANDLE_MAN_PAGES */
|
||||
|
||||
if (!node && entry->nodename &&
|
||||
(strcmp (entry->label, entry->nodename) == 0))
|
||||
node = info_get_node (entry->label, "Top");
|
||||
|
||||
maybe_got_node:
|
||||
if (node)
|
||||
{
|
||||
free (initial_node);
|
||||
initial_node = node;
|
||||
info_free_references (menu);
|
||||
}
|
||||
else
|
||||
{
|
||||
char *temp = xstrdup (entry->label);
|
||||
char *error_message;
|
||||
|
||||
error_message = _("Unable to find the node referenced by \"%s\".");
|
||||
|
||||
info_free_references (menu);
|
||||
|
||||
/* If we were trying to dump the node, then give up. Otherwise,
|
||||
start the session with an error message. */
|
||||
if (user_output_filename)
|
||||
info_error (error_message, temp);
|
||||
else
|
||||
begin_info_session_with_error (initial_node, error_message, temp);
|
||||
|
||||
exit (0);
|
||||
}
|
||||
}
|
||||
|
||||
/* If the user specified that this node should be output, then do that
|
||||
now. Otherwise, start the Info session with this node. */
|
||||
if (user_output_filename)
|
||||
dump_node_to_file (initial_node, user_output_filename, dump_subnodes);
|
||||
else
|
||||
begin_info_session (initial_node);
|
||||
|
||||
exit (0);
|
||||
}
|
||||
|
||||
/* Return a string describing the current version of Info. */
|
||||
char *
|
||||
version_string ()
|
||||
{
|
||||
static char *vstring = (char *)NULL;
|
||||
|
||||
if (!vstring)
|
||||
{
|
||||
vstring = (char *)xmalloc (50);
|
||||
sprintf (vstring, "%d.%d", info_major_version, info_minor_version);
|
||||
}
|
||||
return (vstring);
|
||||
}
|
||||
|
||||
|
||||
/* Error handling. */
|
||||
|
||||
static void
|
||||
remember_info_program_name (fullpath)
|
||||
char *fullpath;
|
||||
{
|
||||
char *filename;
|
||||
|
||||
filename = filename_non_directory (fullpath);
|
||||
program_name = xstrdup (filename);
|
||||
}
|
||||
|
||||
/* Non-zero if an error has been signalled. */
|
||||
int info_error_was_printed = 0;
|
||||
|
||||
/* 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 ()
|
||||
{
|
||||
printf (_("\
|
||||
Usage: %s [OPTION]... [INFO-FILE [MENU-ITEM...]]\n\
|
||||
\n\
|
||||
Read documentation in Info format.\n\
|
||||
For more complete documentation on how to use Info, run `info info options'.\n\
|
||||
\n\
|
||||
Options:\n\
|
||||
--directory DIR add DIR to INFOPATH.\n\
|
||||
--dribble FILENAME remember user keystrokes in FILENAME.\n\
|
||||
--file FILENAME specify Info file to visit.\n\
|
||||
--node NODENAME specify nodes in first visited Info file.\n\
|
||||
--output FILENAME output selected nodes to FILENAME.\n\
|
||||
--restore FILENAME read initial keystrokes from FILENAME.\n\
|
||||
--subnodes recursively output menu items.\n\
|
||||
--help display this help and exit.\n\
|
||||
--version display version information and exit.\n\
|
||||
\n\
|
||||
The first argument, if present, is the name of the Info file to read.\n\
|
||||
Any remaining arguments are treated as the names of menu\n\
|
||||
items in the initial node visited. For example, `info emacs buffers'\n\
|
||||
moves to the node `buffers' in the info file `emacs'.\n\
|
||||
\n\
|
||||
Email bug reports to bug-texinfo@gnu.org."), program_name);
|
||||
|
||||
exit (0);
|
||||
}
|
|
@ -1,165 +0,0 @@
|
|||
/* info.h -- Header file which includes all of the other headers.
|
||||
$Id: info.h,v 1.1.1.3 1998/03/24 18:20:14 law Exp $
|
||||
|
||||
This file is part of GNU Info, a program for reading online documentation
|
||||
stored in Info format.
|
||||
|
||||
Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
|
||||
|
||||
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 (INFO_H)
|
||||
#define INFO_H
|
||||
|
||||
/* We always want these, so why clutter up the compile command? */
|
||||
#define HANDLE_MAN_PAGES
|
||||
#define NAMED_FUNCTIONS
|
||||
|
||||
/* System dependencies. */
|
||||
#include "system.h"
|
||||
|
||||
/* Some of our other include files use these. */
|
||||
typedef int Function ();
|
||||
typedef void VFunction ();
|
||||
typedef char *CFunction ();
|
||||
|
||||
|
||||
#include "filesys.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;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* How to get the version string for this version of Info. Returns
|
||||
something similar to "2.11". */
|
||||
extern char *version_string ();
|
||||
|
||||
/* Error message defines. */
|
||||
#define CANT_FIND_NODE _("Cannot find the node \"%s\".")
|
||||
#define CANT_FILE_NODE _("Cannot find the node \"(%s)%s\".")
|
||||
#define CANT_FIND_WIND _("Cannot find a window!")
|
||||
#define CANT_FIND_POINT _("Point doesn't appear within this window's node!")
|
||||
#define CANT_KILL_LAST _("Cannot delete the last window.")
|
||||
#define NO_MENU_NODE _("No menu in this node.")
|
||||
#define NO_FOOT_NODE _("No footnotes in this node.")
|
||||
#define NO_XREF_NODE _("No cross references in this node.")
|
||||
#define NO_POINTER _("No \"%s\" pointer for this node.")
|
||||
#define UNKNOWN_COMMAND _("Unknown Info command `%c'. `?' for help.")
|
||||
#define TERM_TOO_DUMB _("Terminal type \"%s\" is not smart enough to run Info.")
|
||||
#define AT_NODE_BOTTOM _("You are already at the last page of this node.")
|
||||
#define AT_NODE_TOP _("You are already at the first page of this node.")
|
||||
#define ONE_WINDOW _("Only one window.")
|
||||
#define WIN_TOO_SMALL _("Resulting window would be too small.")
|
||||
#define CANT_MAKE_HELP \
|
||||
_("There isn't enough room to make a help window. Please delete a window.")
|
||||
|
||||
|
||||
/* Found in info-utils.c. */
|
||||
extern char *filename_non_directory ();
|
||||
|
||||
#if !defined (BUILDING_LIBRARY)
|
||||
/* Found in session.c */
|
||||
extern int info_windows_initialized_p;
|
||||
|
||||
/* Found in window.c. */
|
||||
extern void message_in_echo_area (), unmessage_in_echo_area ();
|
||||
#endif /* !BUILDING_LIBRARY */
|
||||
|
||||
#endif /* !INFO_H */
|
|
@ -1,929 +0,0 @@
|
|||
\input texinfo @c -*-texinfo-*-
|
||||
@comment %**start of header
|
||||
@setfilename info.info
|
||||
@settitle Info 1.0
|
||||
@comment %**end of header
|
||||
@comment $Id: info.texi,v 1.1.1.1 1997/08/21 22:58:02 jason Exp $
|
||||
|
||||
@ifinfo
|
||||
@c This is a dir.info fragment to support semi-automated addition of
|
||||
@c manuals to an info tree.
|
||||
@format
|
||||
START-INFO-DIR-ENTRY
|
||||
* info: (info). Reading GNU online documentation.
|
||||
END-INFO-DIR-ENTRY
|
||||
@end format
|
||||
@end ifinfo
|
||||
|
||||
@iftex
|
||||
@finalout
|
||||
@end iftex
|
||||
@dircategory Texinfo documentation system
|
||||
@direntry
|
||||
* Info: (info). Documentation browsing system.
|
||||
@end direntry
|
||||
|
||||
@ifinfo
|
||||
This file describes how to use Info,
|
||||
the on-line, menu-driven GNU documentation system.
|
||||
|
||||
Copyright (C) 1989, 92, 96 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
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.
|
||||
@end ifinfo
|
||||
|
||||
@titlepage
|
||||
@sp 11
|
||||
@center @titlefont{Info}
|
||||
@sp 2
|
||||
@center The
|
||||
@sp 2
|
||||
@center On-line, Menu-driven
|
||||
@sp 2
|
||||
@center GNU Documentation System
|
||||
|
||||
@page
|
||||
@vskip 0pt plus 1filll
|
||||
Copyright @copyright{} 1989, 1992, 1993 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.
|
||||
@end titlepage
|
||||
|
||||
@ifinfo
|
||||
@node Top, Getting Started, (dir), (dir)
|
||||
@top Info: An Introduction
|
||||
|
||||
Info is a program for reading documentation, which you are using now.
|
||||
|
||||
To learn how to use Info, type the command @kbd{h}. It brings you
|
||||
to a programmed instruction sequence.
|
||||
|
||||
@c Need to make sure that `Info-help' goes to the right node,
|
||||
@c which is the first node of the first chapter. (It should.)
|
||||
@c (Info-find-node "info"
|
||||
@c (if (< (window-height) 23)
|
||||
@c "Help-Small-Screen"
|
||||
@c "Help")))
|
||||
|
||||
To learn advanced Info commands, type @kbd{n} twice. This brings you to
|
||||
@cite{Info for Experts}, skipping over the `Getting Started' chapter.
|
||||
@end ifinfo
|
||||
|
||||
@menu
|
||||
* Getting Started:: Getting started using an Info reader.
|
||||
* Advanced Info:: Advanced commands within Info.
|
||||
* Create an Info File:: How to make your own Info file.
|
||||
* The Standalone Info Program: (info-stnd.info).
|
||||
@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
|
||||
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
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
@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.
|
||||
@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
|
||||
|
||||
@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-M:: Menus
|
||||
* Help-Adv:: Some advanced Info commands
|
||||
* Help-Q:: Quitting Info
|
||||
@end menu
|
||||
|
||||
@node Help-Small-Screen, Help, , Getting Started
|
||||
@comment node-name, next, previous, up
|
||||
@section Starting Info on a Small Screen
|
||||
|
||||
@iftex
|
||||
(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
|
||||
|
||||
Since your terminal has an unusually 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
|
||||
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}.
|
||||
|
||||
@ifinfo
|
||||
Here are 40 lines of junk, so you can try Spaces and Deletes 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 @*
|
||||
|
||||
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.
|
||||
@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.
|
||||
|
||||
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''.
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
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;
|
||||
do not type the quotes and do not type a @key{RET} afterward.
|
||||
|
||||
@samp{>>} in the margin means it is really time to try a command.
|
||||
|
||||
@node Help-P, Help-^L, Help, Getting Started
|
||||
@comment node-name, next, previous, up
|
||||
@section Returning to the Previous node
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
@node Help-^L, Help-M, Help-P, Getting Started
|
||||
@comment node-name, next, previous, up
|
||||
@section The Space, Delete, 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 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}).
|
||||
|
||||
>> Type @kbd{C-l} now.
|
||||
|
||||
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.
|
||||
>> 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.
|
||||
|
||||
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?
|
||||
|
||||
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 typing a @key{SPC}.
|
||||
|
||||
>> Type a @key{?} now. After it finishes, type a @key{SPC}.
|
||||
|
||||
(If you are using the standalone Info reader, type `l' to return here.)
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
@node Help-M, Help-Adv, 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.
|
||||
|
||||
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
|
||||
@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:}.]]
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
command. At such times, commands do not work, because Info tries to
|
||||
use them as the argument. You must either type the argument 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.
|
||||
|
||||
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}.
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
Here is a menu to give you a chance to practice.
|
||||
|
||||
* Menu: The menu starts here.
|
||||
|
||||
This menu gives you three ways of going to one place, Help-FOO.
|
||||
|
||||
* Foo: Help-FOO. A node you can visit for fun.@*
|
||||
* Bar: Help-FOO. Strange! two ways to get to the same place.@*
|
||||
* Help-FOO:: And yet another!@*
|
||||
|
||||
|
||||
>> Now type just an @kbd{m} and see what happens:
|
||||
|
||||
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.
|
||||
|
||||
>> Try that now; notice the bottom line clear.
|
||||
|
||||
>> Then type another @kbd{m}.
|
||||
|
||||
>> Now type @samp{BAR} item name. Do not type Return yet.
|
||||
|
||||
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.
|
||||
|
||||
>> 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.
|
||||
|
||||
>> 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).
|
||||
|
||||
@menu
|
||||
* Help-FOO::
|
||||
@end menu
|
||||
|
||||
@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''
|
||||
|
||||
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.
|
||||
|
||||
>> Now type @kbd{u} to move back up to @samp{Help-M}.
|
||||
|
||||
@node Help-Adv, Help-Q, Help-M, Getting Started
|
||||
@comment node-name, next, previous, up
|
||||
@section Some advanced Info commands
|
||||
|
||||
The course is almost over, so please stick with it to the end.
|
||||
|
||||
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.
|
||||
|
||||
Then follow directions again and you will end up back here.
|
||||
|
||||
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,
|
||||
@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.
|
||||
|
||||
>> Now type @kbd{n} to see the last node of the course.
|
||||
|
||||
@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
|
||||
@comment node-name, next, previous, up
|
||||
@unnumberedsubsec 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, Create an Info File, Getting Started, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Info for Experts
|
||||
|
||||
This chapter describes various advanced Info commands, and how to write
|
||||
an Info as distinct from a Texinfo file. (However, in most cases, writing a
|
||||
Texinfo file is better, since you can use it @emph{both} to generate an
|
||||
Info file and to make a printed manual. @xref{Top,, Overview of
|
||||
Texinfo, texinfo, Texinfo: The GNU Documentation Format}.)
|
||||
|
||||
@menu
|
||||
* Expert:: Advanced Info commands: g, s, e, and 1 - 5.
|
||||
* 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.
|
||||
* Checking:: Checking an Info File
|
||||
* Emacs Info Variables:: Variables modifying the behavior of Emacs Info.
|
||||
@end menu
|
||||
|
||||
@node Expert, Add, , Advanced Info
|
||||
@comment node-name, next, previous, up
|
||||
@section Advanced Info Commands
|
||||
|
||||
@kbd{g}, @kbd{s}, @kbd{1}, -- @kbd{9}, and @kbd{e}
|
||||
|
||||
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.
|
||||
|
||||
Unlike @kbd{m}, @kbd{g} does not allow the use of abbreviations.
|
||||
|
||||
To go to a node in another file, you can include the filename 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 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}}.
|
||||
|
||||
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} 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.
|
||||
|
||||
If you display supports multiple fonts, and you are using Emacs' Info
|
||||
mode to read Info files, the @samp{*} for the fifth menu item is
|
||||
underlines, and so is the @samp{*} for the ninth item; these underlines
|
||||
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
|
||||
@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: The GNU Documentation Format}); this has the
|
||||
advantage that you can also make a printed manual from them. However,
|
||||
if hyou want to edit an Info file, here is how.
|
||||
|
||||
The new node can live in an existing documentation file, or in a new
|
||||
one. It must have a @key{^_} character before it (invisible to the
|
||||
user; this node has one but you cannot see it), and it ends with either
|
||||
a @key{^_}, a @key{^L}, or the end of file. Note: If you put in a
|
||||
@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 line must give the node's name (by which Info finds it),
|
||||
and state the names of the @samp{Next}, @samp{Previous}, and @samp{Up} nodes (if
|
||||
there are any). As you can see, this node's @samp{Up} node is the node
|
||||
@samp{Top}, which points at all the documentation for Info. The @samp{Next}
|
||||
node is @samp{Menus}.
|
||||
|
||||
The keywords @dfn{Node}, @dfn{Previous}, @dfn{Up}, and @dfn{Next},
|
||||
may appear in any order, anywhere in the header line, but the
|
||||
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.
|
||||
|
||||
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:
|
||||
(dir)} in it.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
|
||||
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{*}.
|
||||
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!
|
||||
|
||||
@node Tags, Checking, Cross-refs, Advanced Info
|
||||
@comment node-name, next, previous, up
|
||||
@section Tag Tables for 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
|
||||
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
|
||||
@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
|
||||
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.
|
||||
|
||||
An Info file tag table appears at the end of the file and looks like
|
||||
this:
|
||||
|
||||
@example
|
||||
^_
|
||||
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
|
||||
beginning of the node.
|
||||
|
||||
@node Checking, Emacs Info Variables, Tags, Advanced Info
|
||||
@comment node-name, next, previous, up
|
||||
@section Checking an Info File
|
||||
|
||||
When creating an Info file, it is easy to forget the name of a node
|
||||
when you are making a pointer to it from another node. If you put in
|
||||
the wrong name for a node, this is not detected until someone
|
||||
tries to go through the pointer using Info. Verification of the Info
|
||||
file is an automatic process which checks all pointers to nodes and
|
||||
reports any pointers which are invalid. Every @samp{Next}, @samp{Previous}, and
|
||||
@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.
|
||||
|
||||
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;
|
||||
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}.
|
||||
|
||||
@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-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.
|
||||
|
||||
@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).
|
||||
|
||||
@item Info-directory
|
||||
The standard directory for Info documentation files. Only used when the
|
||||
function @code{Info-directory} is called.
|
||||
@end vtable
|
||||
|
||||
@node Create an Info File, , Advanced Info, Top
|
||||
@comment node-name, next, previous, up
|
||||
@chapter Creating an Info File from a Makeinfo file
|
||||
|
||||
@code{makeinfo} is a utility that converts a Texinfo file into an Info
|
||||
file; @code{texinfo-format-region} and @code{texinfo-format-buffer} are
|
||||
GNU Emacs functions that do the same.
|
||||
|
||||
@xref{Create an Info File, , Creating an Info File, texinfo, the Texinfo
|
||||
Manual}, to learn how to create an Info file from a Texinfo file.
|
||||
|
||||
@xref{Top,, Overview of Texinfo, texinfo, Texinfo: The GNU Documentation
|
||||
Format}, to learn how to write a Texinfo file.
|
||||
|
||||
@bye
|
|
@ -1,770 +0,0 @@
|
|||
/* infodoc.c -- Functions which build documentation nodes.
|
||||
$Id: infodoc.c,v 1.1.1.2 1998/03/22 20:42:39 law Exp $
|
||||
|
||||
Copyright (C) 1993, 97 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"
|
||||
|
||||
/* Normally we do not define HELP_NODE_GETS_REGENERATED because the
|
||||
contents of the help node currently can never change once an info
|
||||
session has been started. You should consider defining this in
|
||||
the case that you place information about dynamic variables in the
|
||||
help text. When that happens, the contents of the help node will
|
||||
change dependent on the value of those variables, and the user will
|
||||
expect to see those changes. */
|
||||
/* #define HELP_NODE_GETS_REGENERATED 1 */
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
/* 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. */
|
||||
static char *info_internal_help_text[] = {
|
||||
N_ ("Basic Commands in Info Windows"),
|
||||
"******************************",
|
||||
"",
|
||||
" h Invoke the Info tutorial.",
|
||||
" CTRL-x 0 Quit this help.",
|
||||
" q Quit Info altogether.",
|
||||
"",
|
||||
"Selecting other nodes:",
|
||||
"----------------------",
|
||||
" n Move to the \"next\" node of this node.",
|
||||
" p Move to the \"previous\" node of this node.",
|
||||
" u Move \"up\" from this node.",
|
||||
" m Pick menu item specified by name.",
|
||||
" Picking a menu item causes another node to be selected.",
|
||||
" f Follow a cross reference. Reads name of reference.",
|
||||
" l Move to the last node seen in this window.",
|
||||
" d Move to the `directory' node. Equivalent to `g(DIR)'.",
|
||||
"",
|
||||
"Moving within a node:",
|
||||
"---------------------",
|
||||
" SPC Scroll forward a page.",
|
||||
" DEL Scroll backward a page.",
|
||||
" b Go to the beginning of this node.",
|
||||
" e Go to the end of this node.",
|
||||
"",
|
||||
"Other commands:",
|
||||
"--------------------",
|
||||
" 1 Pick first item in node's menu.",
|
||||
" 2-9 Pick second ... ninth item in node's menu.",
|
||||
" 0 Pick last item in node's menu.",
|
||||
" g Move to node specified by name.",
|
||||
" You may include a filename as well, as in (FILENAME)NODENAME.",
|
||||
" s Search through this Info file for a specified string,",
|
||||
" and select the node in which the next occurrence is found.",
|
||||
NULL
|
||||
};
|
||||
|
||||
static char *where_is (), *where_is_internal ();
|
||||
|
||||
void
|
||||
dump_map_to_message_buffer (prefix, map)
|
||||
char *prefix;
|
||||
Keymap map;
|
||||
{
|
||||
register int i;
|
||||
|
||||
for (i = 0; i < 256; 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));
|
||||
i = last - 1;
|
||||
}
|
||||
else
|
||||
printf_to_message_buffer ("%s%s\t", prefix, pretty_keyname (i));
|
||||
|
||||
#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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* How to create internal_info_help_node. */
|
||||
static void
|
||||
create_internal_info_help_node ()
|
||||
{
|
||||
register int i;
|
||||
char *contents = (char *)NULL;
|
||||
NODE *node;
|
||||
|
||||
#if !defined (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++)
|
||||
printf_to_message_buffer ("%s\n", info_internal_help_text[i]);
|
||||
|
||||
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. */
|
||||
for (i = 0; function_doc_array[i].func; i++)
|
||||
{
|
||||
VFunction *func = function_doc_array[i].func;
|
||||
|
||||
if ((!where_is_internal (info_keymap, func)) &&
|
||||
(!where_is_internal (echo_area_keymap, func)))
|
||||
{
|
||||
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"));
|
||||
printed_one_mx = 1;
|
||||
}
|
||||
|
||||
printf_to_message_buffer
|
||||
("M-x %s\n %s\n",
|
||||
function_doc_array[i].func_name,
|
||||
replace_in_documentation (function_doc_array[i].doc));
|
||||
}
|
||||
}
|
||||
|
||||
if (printed_one_mx)
|
||||
printf_to_message_buffer ("\n");
|
||||
#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. */
|
||||
static WINDOW *
|
||||
info_find_or_create_help_window ()
|
||||
{
|
||||
WINDOW *help_window, *eligible, *window;
|
||||
|
||||
eligible = (WINDOW *)NULL;
|
||||
help_window = get_internal_info_window (info_help_nodename);
|
||||
|
||||
/* If we couldn't find the help window, then make it. */
|
||||
if (!help_window)
|
||||
{
|
||||
int max = 0;
|
||||
|
||||
for (window = windows; window; window = window->next)
|
||||
{
|
||||
if (window->height > max)
|
||||
{
|
||||
max = window->height;
|
||||
eligible = window;
|
||||
}
|
||||
}
|
||||
|
||||
if (!eligible)
|
||||
return ((WINDOW *)NULL);
|
||||
}
|
||||
#if !defined (HELP_NODE_GETS_REGENERATED)
|
||||
else
|
||||
return (help_window);
|
||||
#endif /* !HELP_NODE_GETS_REGENERATED */
|
||||
|
||||
/* Make sure that we have a node containing the help text. */
|
||||
create_internal_info_help_node ();
|
||||
|
||||
/* 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 > 30)
|
||||
{
|
||||
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 (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 (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;
|
||||
{
|
||||
register int i;
|
||||
|
||||
for (i = 0; function_doc_array[i].func; i++)
|
||||
if (function == function_doc_array[i].func)
|
||||
break;
|
||||
|
||||
return (replace_in_documentation (function_doc_array[i].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;
|
||||
{
|
||||
register int i;
|
||||
|
||||
for (i = 0; function_doc_array[i].func; i++)
|
||||
if (function == function_doc_array[i].func)
|
||||
break;
|
||||
|
||||
return (function_doc_array[i].func_name);
|
||||
}
|
||||
|
||||
/* Return a pointer to the function named NAME. */
|
||||
VFunction *
|
||||
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);
|
||||
}
|
||||
#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;
|
||||
|
||||
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;
|
||||
unsigned char keystroke;
|
||||
char *rep;
|
||||
Keymap map;
|
||||
|
||||
keyname[0] = '\0';
|
||||
map = window->keymap;
|
||||
|
||||
while (1)
|
||||
{
|
||||
message_in_echo_area (_("Describe key: %s"), keyname);
|
||||
keystroke = info_get_input_char ();
|
||||
unmessage_in_echo_area ();
|
||||
|
||||
if (Meta_p (keystroke) && (!ISO_Latin_p || key < 160))
|
||||
{
|
||||
if (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);
|
||||
keystroke = UnMeta (keystroke);
|
||||
map = (Keymap)map[ESC].function;
|
||||
}
|
||||
|
||||
/* Add the printed representation of KEYSTROKE to our keyname. */
|
||||
rep = pretty_keyname (keystroke);
|
||||
strcpy (keyname + keyname_index, rep);
|
||||
keyname_index = strlen (keyname);
|
||||
|
||||
if (map[keystroke].function == (VFunction *)NULL)
|
||||
{
|
||||
message_in_echo_area (_("%s is undefined."), keyname);
|
||||
return;
|
||||
}
|
||||
else if (map[keystroke].type == ISKMAP)
|
||||
{
|
||||
map = (Keymap)map[keystroke].function;
|
||||
strcat (keyname, " ");
|
||||
keyname_index = strlen (keyname);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
char *message, *fundoc, *funname = "";
|
||||
|
||||
#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];
|
||||
|
||||
char *
|
||||
pretty_keyname (key)
|
||||
unsigned char key;
|
||||
{
|
||||
char *rep;
|
||||
|
||||
if (Meta_p (key))
|
||||
{
|
||||
char temp[20];
|
||||
|
||||
rep = pretty_keyname (UnMeta (key));
|
||||
|
||||
sprintf (temp, "ESC %s", rep);
|
||||
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);
|
||||
}
|
||||
|
||||
/* Replace the names of functions with the key that invokes them. */
|
||||
char *
|
||||
replace_in_documentation (string)
|
||||
char *string;
|
||||
{
|
||||
register int i, start, next;
|
||||
static char *result = (char *)NULL;
|
||||
|
||||
maybe_free (result);
|
||||
result = (char *)xmalloc (1 + strlen (string));
|
||||
|
||||
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);
|
||||
|
||||
/* 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++;
|
||||
}
|
||||
}
|
||||
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)
|
||||
Keymap map;
|
||||
VFunction *function;
|
||||
{
|
||||
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);
|
||||
|
||||
/* If it couldn't be found, return "M-x Foo". */
|
||||
if (!rep)
|
||||
{
|
||||
char *name;
|
||||
|
||||
name = function_name (function);
|
||||
|
||||
if (name)
|
||||
sprintf (where_is_rep, "M-x %s", name);
|
||||
|
||||
rep = where_is_rep;
|
||||
}
|
||||
return (rep);
|
||||
}
|
||||
|
||||
/* Return the printed rep of FUNCTION as found in MAP, or NULL. */
|
||||
static char *
|
||||
where_is_internal (map, function)
|
||||
Keymap map;
|
||||
VFunction *function;
|
||||
{
|
||||
register int i;
|
||||
|
||||
/* If the function is directly invokable in MAP, return the representation
|
||||
of that keystroke. */
|
||||
for (i = 0; i < 256; i++)
|
||||
if ((map[i].type == ISFUNC) && map[i].function == function)
|
||||
{
|
||||
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);
|
||||
|
||||
if (rep)
|
||||
return (where_is_rep);
|
||||
|
||||
where_is_rep_index = saved_index;
|
||||
}
|
||||
}
|
||||
|
||||
return ((char *)NULL);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
function = named_function (command_name);
|
||||
|
||||
if (function)
|
||||
{
|
||||
char *location;
|
||||
|
||||
location = where_is (active_window->keymap, function);
|
||||
|
||||
if (!location)
|
||||
{
|
||||
info_error (_("`%s' is not on any keys"), command_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strncmp (location, "M-x ", 4) == 0)
|
||||
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);
|
||||
}
|
|
@ -1,368 +0,0 @@
|
|||
/* infomap.c -- Keymaps for Info.
|
||||
$Id: infomap.c,v 1.1.1.2 1998/03/22 20:42:40 law Exp $
|
||||
|
||||
Copyright (C) 1993, 97 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 "infomap.h"
|
||||
#include "funs.h"
|
||||
#include "terminal.h"
|
||||
|
||||
/* Return a new keymap which has all the uppercase letters mapped to run
|
||||
the function info_do_lowercase_version (). */
|
||||
Keymap
|
||||
keymap_make_keymap ()
|
||||
{
|
||||
register int i;
|
||||
Keymap keymap;
|
||||
|
||||
keymap = (Keymap)xmalloc (256 * sizeof (KEYMAP_ENTRY));
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
keymap[i].type = ISFUNC;
|
||||
keymap[i].function = (VFunction *)NULL;
|
||||
}
|
||||
|
||||
for (i = 'A'; i < ('Z' + 1); i++)
|
||||
{
|
||||
keymap[i].type = ISFUNC;
|
||||
keymap[i].function = info_do_lowercase_version;
|
||||
}
|
||||
|
||||
return (keymap);
|
||||
}
|
||||
|
||||
/* Return a new keymap which is a copy of MAP. */
|
||||
Keymap
|
||||
keymap_copy_keymap (map)
|
||||
Keymap map;
|
||||
{
|
||||
register int i;
|
||||
Keymap keymap;
|
||||
|
||||
keymap = keymap_make_keymap ();
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
keymap[i].type = map[i].type;
|
||||
keymap[i].function = map[i].function;
|
||||
}
|
||||
return (keymap);
|
||||
}
|
||||
|
||||
/* Free the keymap and it's descendents. */
|
||||
void
|
||||
keymap_discard_keymap (map)
|
||||
Keymap (map);
|
||||
{
|
||||
register int i;
|
||||
|
||||
if (!map)
|
||||
return;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
switch (map[i].type)
|
||||
{
|
||||
case ISFUNC:
|
||||
break;
|
||||
|
||||
case ISKMAP:
|
||||
keymap_discard_keymap ((Keymap)map[i].function);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Conditionally bind key sequence. */
|
||||
int
|
||||
keymap_bind_keyseq (map, keyseq, keyentry)
|
||||
Keymap map;
|
||||
const unsigned char *keyseq;
|
||||
KEYMAP_ENTRY *keyentry;
|
||||
{
|
||||
register Keymap m = map;
|
||||
register const unsigned char *s = keyseq;
|
||||
register int c;
|
||||
|
||||
if (s == NULL || *s == '\0') return 0;
|
||||
|
||||
while ((c = *s++) != '\0')
|
||||
{
|
||||
switch (m[c].type)
|
||||
{
|
||||
case ISFUNC:
|
||||
if (!(m[c].function == NULL ||
|
||||
(m != map && m[c].function == info_do_lowercase_version)))
|
||||
return 0;
|
||||
|
||||
if (*s != '\0')
|
||||
{
|
||||
m[c].type = ISKMAP;
|
||||
m[c].function = (VFunction *)keymap_make_keymap ();
|
||||
}
|
||||
break;
|
||||
|
||||
case ISKMAP:
|
||||
if (*s == '\0')
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
if (*s != '\0')
|
||||
{
|
||||
m = (Keymap)m[c].function;
|
||||
}
|
||||
else
|
||||
{
|
||||
m[c] = *keyentry;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Initialize the standard info keymaps. */
|
||||
|
||||
Keymap info_keymap = (Keymap)NULL;
|
||||
Keymap echo_area_keymap = (Keymap)NULL;
|
||||
|
||||
void
|
||||
initialize_info_keymaps ()
|
||||
{
|
||||
register int i;
|
||||
Keymap map;
|
||||
|
||||
if (!info_keymap)
|
||||
{
|
||||
info_keymap = keymap_make_keymap ();
|
||||
info_keymap[ESC].type = ISKMAP;
|
||||
info_keymap[ESC].function = (VFunction *)keymap_make_keymap ();
|
||||
info_keymap[Control ('x')].type = ISKMAP;
|
||||
info_keymap[Control ('x')].function = (VFunction *)keymap_make_keymap ();
|
||||
echo_area_keymap = keymap_make_keymap ();
|
||||
echo_area_keymap[ESC].type = ISKMAP;
|
||||
echo_area_keymap[ESC].function = (VFunction *)keymap_make_keymap ();
|
||||
echo_area_keymap[Control ('x')].type = ISKMAP;
|
||||
echo_area_keymap[Control ('x')].function =
|
||||
(VFunction *)keymap_make_keymap ();
|
||||
}
|
||||
|
||||
/* Bind numeric arg functions for both echo area and info window maps. */
|
||||
for (i = '0'; i < '9' + 1; i++)
|
||||
{
|
||||
((Keymap) info_keymap[ESC].function)[i].function =
|
||||
((Keymap) echo_area_keymap[ESC].function)[i].function =
|
||||
info_add_digit_to_numeric_arg;
|
||||
}
|
||||
((Keymap) info_keymap[ESC].function)['-'].function =
|
||||
((Keymap) echo_area_keymap[ESC].function)['-'].function =
|
||||
info_add_digit_to_numeric_arg;
|
||||
|
||||
/* Bind the echo area routines. */
|
||||
map = echo_area_keymap;
|
||||
|
||||
/* Bind the echo area insert routines. */
|
||||
for (i = 0; i < 160; i++)
|
||||
if (isprint (i))
|
||||
map[i].function = ea_insert;
|
||||
|
||||
map[Control ('a')].function = ea_beg_of_line;
|
||||
map[Control ('b')].function = ea_backward;
|
||||
map[Control ('d')].function = ea_delete;
|
||||
map[Control ('e')].function = ea_end_of_line;
|
||||
map[Control ('f')].function = ea_forward;
|
||||
map[Control ('g')].function = ea_abort;
|
||||
map[Control ('h')].function = ea_rubout;
|
||||
map[Control ('k')].function = ea_kill_line;
|
||||
map[Control ('l')].function = info_redraw_display;
|
||||
map[Control ('q')].function = ea_quoted_insert;
|
||||
map[Control ('t')].function = ea_transpose_chars;
|
||||
map[Control ('u')].function = info_universal_argument;
|
||||
map[Control ('y')].function = ea_yank;
|
||||
|
||||
map[LFD].function = ea_newline;
|
||||
map[RET].function = ea_newline;
|
||||
map[SPC].function = ea_complete;
|
||||
map[TAB].function = ea_complete;
|
||||
map['?'].function = ea_possible_completions;
|
||||
map[DEL].function = ea_rubout;
|
||||
|
||||
/* Bind the echo area ESC keymap. */
|
||||
map = (Keymap)echo_area_keymap[ESC].function;
|
||||
|
||||
map[Control ('g')].function = ea_abort;
|
||||
map[Control ('v')].function = ea_scroll_completions_window;
|
||||
map['b'].function = ea_backward_word;
|
||||
map['d'].function = ea_kill_word;
|
||||
map['f'].function = ea_forward_word;
|
||||
#if defined (NAMED_FUNCTIONS)
|
||||
/* map['x'].function = info_execute_command; */
|
||||
#endif /* NAMED_FUNCTIONS */
|
||||
map['y'].function = ea_yank_pop;
|
||||
map['?'].function = ea_possible_completions;
|
||||
map[TAB].function = ea_tab_insert;
|
||||
map[DEL].function = ea_backward_kill_word;
|
||||
|
||||
/* Bind the echo area Control-x keymap. */
|
||||
map = (Keymap)echo_area_keymap[Control ('x')].function;
|
||||
|
||||
map['o'].function = info_next_window;
|
||||
map[DEL].function = ea_backward_kill_line;
|
||||
|
||||
/* Arrow key bindings for echo area keymaps. It seems that some
|
||||
terminals do not match their termcap entries, so it's best to just
|
||||
define everything with both of the usual prefixes. */
|
||||
map = echo_area_keymap;
|
||||
keymap_bind_keyseq (map, term_ku, &map[Control ('p')]); /* up */
|
||||
keymap_bind_keyseq (map, "\033OA", &map[Control ('p')]);
|
||||
keymap_bind_keyseq (map, "\033[A", &map[Control ('p')]);
|
||||
keymap_bind_keyseq (map, term_kd, &map[Control ('n')]); /* down */
|
||||
keymap_bind_keyseq (map, "\033OB", &map[Control ('n')]);
|
||||
keymap_bind_keyseq (map, "\033[B", &map[Control ('n')]);
|
||||
keymap_bind_keyseq (map, term_kr, &map[Control ('f')]); /* right */
|
||||
keymap_bind_keyseq (map, "\033OC", &map[Control ('f')]);
|
||||
keymap_bind_keyseq (map, "\033[C", &map[Control ('f')]);
|
||||
keymap_bind_keyseq (map, term_kl, &map[Control ('b')]); /* left */
|
||||
keymap_bind_keyseq (map, "\033OD", &map[Control ('b')]);
|
||||
keymap_bind_keyseq (map, "\033[D", &map[Control ('b')]);
|
||||
|
||||
map = (Keymap)echo_area_keymap[ESC].function;
|
||||
keymap_bind_keyseq (map, term_kl, &map['b']); /* left */
|
||||
keymap_bind_keyseq (map, "\033OA", &map['b']);
|
||||
keymap_bind_keyseq (map, "\033[A", &map['b']);
|
||||
keymap_bind_keyseq (map, term_kr, &map['f']); /* right */
|
||||
keymap_bind_keyseq (map, "\033OB", &map['f']);
|
||||
keymap_bind_keyseq (map, "\033[B", &map['f']);
|
||||
|
||||
/* Bind commands for Info window keymaps. */
|
||||
map = info_keymap;
|
||||
map[TAB].function = info_move_to_next_xref;
|
||||
map[LFD].function = info_select_reference_this_line;
|
||||
map[RET].function = info_select_reference_this_line;
|
||||
map[SPC].function = info_scroll_forward;
|
||||
map[Control ('a')].function = info_beginning_of_line;
|
||||
map[Control ('b')].function = info_backward_char;
|
||||
map[Control ('e')].function = info_end_of_line;
|
||||
map[Control ('f')].function = info_forward_char;
|
||||
map[Control ('g')].function = info_abort_key;
|
||||
map[Control ('h')].function = info_get_help_window;
|
||||
map[Control ('l')].function = info_redraw_display;
|
||||
map[Control ('n')].function = info_next_line;
|
||||
map[Control ('p')].function = info_prev_line;
|
||||
map[Control ('r')].function = isearch_backward;
|
||||
map[Control ('s')].function = isearch_forward;
|
||||
map[Control ('u')].function = info_universal_argument;
|
||||
map[Control ('v')].function = info_scroll_forward;
|
||||
map[','].function = info_next_index_match;
|
||||
|
||||
for (i = '1'; i < '9' + 1; i++)
|
||||
map[i].function = info_menu_digit;
|
||||
map['0'].function = info_last_menu_item;
|
||||
|
||||
map['<'].function = info_first_node;
|
||||
map['>'].function = info_last_node;
|
||||
map['?'].function = info_get_help_window;
|
||||
map['['].function = info_global_prev_node;
|
||||
map[']'].function = info_global_next_node;
|
||||
|
||||
map['b'].function = info_beginning_of_node;
|
||||
map['d'].function = info_dir_node;
|
||||
map['e'].function = info_end_of_node;
|
||||
map['f'].function = info_xref_item;
|
||||
map['g'].function = info_goto_node;
|
||||
map['h'].function = info_get_info_help_node;
|
||||
map['i'].function = info_index_search;
|
||||
map['l'].function = info_history_node;
|
||||
map['m'].function = info_menu_item;
|
||||
map['n'].function = info_next_node;
|
||||
map['p'].function = info_prev_node;
|
||||
map['q'].function = info_quit;
|
||||
map['r'].function = info_xref_item;
|
||||
map['s'].function = info_search;
|
||||
map['t'].function = info_top_node;
|
||||
map['u'].function = info_up_node;
|
||||
map[DEL].function = info_scroll_backward;
|
||||
|
||||
/* Bind members in the ESC map for Info windows. */
|
||||
map = (Keymap)info_keymap[ESC].function;
|
||||
map[Control ('f')].function = info_show_footnotes;
|
||||
map[Control ('g')].function = info_abort_key;
|
||||
map[TAB].function = info_move_to_prev_xref;
|
||||
map[Control ('v')].function = info_scroll_other_window;
|
||||
map['<'].function = info_beginning_of_node;
|
||||
map['>'].function = info_end_of_node;
|
||||
map['b'].function = info_backward_word;
|
||||
map['f'].function = info_forward_word;
|
||||
map['r'].function = info_move_to_window_line;
|
||||
map['v'].function = info_scroll_backward;
|
||||
#if defined (NAMED_FUNCTIONS)
|
||||
map['x'].function = info_execute_command;
|
||||
#endif /* NAMED_FUNCTIONS */
|
||||
|
||||
/* Bind members in the Control-X map for Info windows. */
|
||||
map = (Keymap)info_keymap[Control ('x')].function;
|
||||
|
||||
map[Control ('b')].function = list_visited_nodes;
|
||||
map[Control ('c')].function = info_quit;
|
||||
map[Control ('f')].function = info_view_file;
|
||||
map[Control ('g')].function = info_abort_key;
|
||||
map[Control ('v')].function = info_view_file;
|
||||
map['0'].function = info_delete_window;
|
||||
map['1'].function = info_keep_one_window;
|
||||
map['2'].function = info_split_window;
|
||||
map['^'].function = info_grow_window;
|
||||
map['b'].function = select_visited_node;
|
||||
map['k'].function = info_kill_node;
|
||||
map['o'].function = info_next_window;
|
||||
map['t'].function = info_tile_windows;
|
||||
map['w'].function = info_toggle_wrap;
|
||||
|
||||
/* Arrow key bindings for Info windows keymap. */
|
||||
map = info_keymap;
|
||||
keymap_bind_keyseq (map, term_kN, &map[Control ('v')]); /* pagedown */
|
||||
keymap_bind_keyseq (map, term_ku, &map[Control ('p')]); /* up */
|
||||
keymap_bind_keyseq (map, "\033OA", &map[Control ('p')]);
|
||||
keymap_bind_keyseq (map, "\033[A", &map[Control ('p')]);
|
||||
keymap_bind_keyseq (map, term_kd, &map[Control ('n')]); /* down */
|
||||
keymap_bind_keyseq (map, "\033OB", &map[Control ('n')]);
|
||||
keymap_bind_keyseq (map, "\033[B", &map[Control ('n')]);
|
||||
keymap_bind_keyseq (map, term_kr, &map[Control ('f')]); /* right */
|
||||
keymap_bind_keyseq (map, "\033OC", &map[Control ('f')]);
|
||||
keymap_bind_keyseq (map, "\033[C", &map[Control ('f')]);
|
||||
keymap_bind_keyseq (map, term_kl, &map[Control ('b')]); /* left */
|
||||
keymap_bind_keyseq (map, "\033OD", &map[Control ('b')]);
|
||||
keymap_bind_keyseq (map, "\033[D", &map[Control ('b')]);
|
||||
|
||||
map = (Keymap)info_keymap[ESC].function;
|
||||
keymap_bind_keyseq (map, term_kl, &map['b']); /* left */
|
||||
keymap_bind_keyseq (map, "\033OA", &map['b']);
|
||||
keymap_bind_keyseq (map, "\033[A", &map['b']);
|
||||
keymap_bind_keyseq (map, term_kr, &map['f']); /* right */
|
||||
keymap_bind_keyseq (map, "\033OB", &map['f']);
|
||||
keymap_bind_keyseq (map, "\033[B", &map['f']);
|
||||
keymap_bind_keyseq (map, term_kN, &map[Control ('v')]); /* pagedown */
|
||||
|
||||
/* The alternative to this definition of a `main map' key in the
|
||||
`ESC map' section, is something like:
|
||||
keymap_bind_keyseq (map, term_kP, &((KeyMap)map[ESC].function).map['v']);
|
||||
*/
|
||||
keymap_bind_keyseq (info_keymap/*sic*/, term_kP, &map['v']); /* pageup */
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
/* infomap.h -- Description of a keymap in Info and related functions. */
|
||||
|
||||
/* 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). */
|
||||
|
||||
#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 {
|
||||
char type;
|
||||
VFunction *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 */
|
|
@ -1,190 +0,0 @@
|
|||
/* m-x.c -- Meta-X minibuffer reader.
|
||||
$Id: m-x.c,v 1.1.1.2 1998/03/22 20:42:42 law Exp $
|
||||
|
||||
Copyright (C) 1993, 97 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"
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
/* 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);
|
||||
|
||||
if (!fun)
|
||||
return;
|
||||
|
||||
window_message_in_echo_area ("%s: %s.",
|
||||
line, function_documentation (fun));
|
||||
}
|
||||
free (line);
|
||||
}
|
||||
|
||||
DECLARE_INFO_COMMAND (info_execute_command,
|
||||
_("Read a command name in the echo area and execute it"))
|
||||
{
|
||||
char *line;
|
||||
|
||||
/* Ask the completer to read a reference for us. */
|
||||
if (info_explicit_arg || count != 1)
|
||||
{
|
||||
char *prompt;
|
||||
|
||||
prompt = (char *)xmalloc (20);
|
||||
sprintf (prompt, "%d M-x ", count);
|
||||
line = read_function_name (prompt, window);
|
||||
}
|
||||
else
|
||||
line = read_function_name ("M-x ", 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;
|
||||
|
||||
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);
|
||||
free (line);
|
||||
|
||||
if (!function)
|
||||
return;
|
||||
|
||||
(*function) (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;
|
||||
|
||||
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;
|
||||
display_initialize_display (screenwidth, screenheight);
|
||||
window_new_screen_size (screenwidth, screenheight);
|
||||
}
|
|
@ -1,466 +0,0 @@
|
|||
/* makedoc.c -- Make doc.c and funs.h from input files.
|
||||
$Id: makedoc.c,v 1.1.1.2 1998/03/22 20:42:43 law 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.
|
||||
|
||||
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). */
|
||||
|
||||
/* This program grovels the contents of the source files passed as arguments
|
||||
and writes out a file of function pointers and documentation strings, and
|
||||
a header file which describes the contents. This only does the functions
|
||||
declared with DECLARE_INFO_COMMAND. */
|
||||
|
||||
#include "info.h"
|
||||
|
||||
static void fatal_file_error ();
|
||||
|
||||
/* Name of the header file which receives the declarations of functions. */
|
||||
static char *funs_filename = "funs.h";
|
||||
|
||||
/* Name of the documentation to function pointer file. */
|
||||
static char *doc_filename = "doc.c";
|
||||
|
||||
static char *doc_header[] = {
|
||||
"/* doc.c -- Generated structure containing function names and doc strings.",
|
||||
"",
|
||||
" This file was automatically made from various source files with the",
|
||||
" command \"%s\". DO NOT EDIT THIS FILE, only \"%s.c\".",
|
||||
(char *)NULL
|
||||
};
|
||||
|
||||
static char *doc_header_1[] = {
|
||||
" An entry in the array FUNCTION_DOC_ARRAY is made for each command",
|
||||
" found in the above files; each entry consists of a function pointer,",
|
||||
#if defined (NAMED_FUNCTIONS)
|
||||
" a string which is the user-visible name of the function,",
|
||||
#endif /* NAMED_FUNCTIONS */
|
||||
" and a string which documents its purpose. */",
|
||||
"",
|
||||
"#include \"doc.h\"",
|
||||
"#include \"funs.h\"",
|
||||
"",
|
||||
"FUNCTION_DOC function_doc_array[] = {",
|
||||
"",
|
||||
(char *)NULL
|
||||
};
|
||||
|
||||
/* How to remember the locations of the functions found so that Emacs
|
||||
can use the information in a tag table. */
|
||||
typedef struct {
|
||||
char *name; /* Name of the tag. */
|
||||
int line; /* Line number at which it appears. */
|
||||
long char_offset; /* Character offset at which it appears. */
|
||||
} EMACS_TAG;
|
||||
|
||||
typedef struct {
|
||||
char *filename; /* Name of the file containing entries. */
|
||||
long entrylen; /* Total number of characters in tag block. */
|
||||
EMACS_TAG **entries; /* Entries found in FILENAME. */
|
||||
int entries_index;
|
||||
int entries_slots;
|
||||
} EMACS_TAG_BLOCK;
|
||||
|
||||
EMACS_TAG_BLOCK **emacs_tags = (EMACS_TAG_BLOCK **)NULL;
|
||||
int emacs_tags_index = 0;
|
||||
int emacs_tags_slots = 0;
|
||||
|
||||
#define DECLARATION_STRING "\nDECLARE_INFO_COMMAND"
|
||||
|
||||
static void process_one_file ();
|
||||
static void maybe_dump_tags ();
|
||||
static FILE *must_fopen ();
|
||||
|
||||
int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
register int i;
|
||||
int tags_only = 0;
|
||||
FILE *funs_stream, *doc_stream;
|
||||
|
||||
for (i = 1; i < argc; i++)
|
||||
if (strcmp (argv[i], "-tags") == 0)
|
||||
{
|
||||
tags_only++;
|
||||
break;
|
||||
}
|
||||
|
||||
if (tags_only)
|
||||
{
|
||||
funs_filename = "/dev/null";
|
||||
doc_filename = "/dev/null";
|
||||
}
|
||||
|
||||
funs_stream = must_fopen (funs_filename, "w");
|
||||
doc_stream = must_fopen (doc_filename, "w");
|
||||
|
||||
fprintf (funs_stream,
|
||||
"/* %s -- Generated declarations for Info commands. */\n",
|
||||
funs_filename);
|
||||
|
||||
for (i = 0; doc_header[i]; i++)
|
||||
{
|
||||
fprintf (doc_stream, doc_header[i], argv[0], argv[0]);
|
||||
fprintf (doc_stream, "\n");
|
||||
}
|
||||
|
||||
fprintf (doc_stream,
|
||||
_(" Source files groveled to make this file include:\n\n"));
|
||||
|
||||
for (i = 1; i < argc; i++)
|
||||
fprintf (doc_stream, "\t%s\n", argv[i]);
|
||||
|
||||
fprintf (doc_stream, "\n");
|
||||
|
||||
for (i = 0; doc_header_1[i]; i++)
|
||||
fprintf (doc_stream, "%s\n", doc_header_1[i]);
|
||||
|
||||
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
char *curfile;
|
||||
curfile = argv[i];
|
||||
|
||||
if (*curfile == '-')
|
||||
continue;
|
||||
|
||||
fprintf (doc_stream, "/* Commands found in \"%s\". */\n", curfile);
|
||||
fprintf (funs_stream, "\n/* Functions declared in \"%s\". */\n",
|
||||
curfile);
|
||||
|
||||
process_one_file (curfile, doc_stream, funs_stream);
|
||||
}
|
||||
|
||||
fprintf (doc_stream,
|
||||
" { (VFunction *)NULL, (char *)NULL, (char *)NULL }\n};\n");
|
||||
|
||||
fclose (funs_stream);
|
||||
fclose (doc_stream);
|
||||
|
||||
if (tags_only)
|
||||
maybe_dump_tags (stdout);
|
||||
exit (0);
|
||||
}
|
||||
|
||||
/* Dumping out the contents of an Emacs tags table. */
|
||||
static void
|
||||
maybe_dump_tags (stream)
|
||||
FILE *stream;
|
||||
{
|
||||
register int i;
|
||||
|
||||
/* Print out the information for each block. */
|
||||
for (i = 0; i < emacs_tags_index; i++)
|
||||
{
|
||||
register int j;
|
||||
register EMACS_TAG_BLOCK *block;
|
||||
register EMACS_TAG *etag;
|
||||
long block_len;
|
||||
|
||||
block_len = 0;
|
||||
block = emacs_tags[i];
|
||||
|
||||
/* Calculate the length of the dumped block first. */
|
||||
for (j = 0; j < block->entries_index; j++)
|
||||
{
|
||||
char digits[30];
|
||||
etag = block->entries[j];
|
||||
block_len += 3 + strlen (etag->name);
|
||||
sprintf (digits, "%d,%ld", etag->line, etag->char_offset);
|
||||
block_len += strlen (digits);
|
||||
}
|
||||
|
||||
/* Print out the defining line. */
|
||||
fprintf (stream, "\f\n%s,%ld\n", block->filename, block_len);
|
||||
|
||||
/* Print out the individual tags. */
|
||||
for (j = 0; j < block->entries_index; j++)
|
||||
{
|
||||
etag = block->entries[j];
|
||||
|
||||
fprintf (stream, "%s,\177%d,%ld\n",
|
||||
etag->name, etag->line, etag->char_offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Keeping track of names, line numbers and character offsets of functions
|
||||
found in source files. */
|
||||
static EMACS_TAG_BLOCK *
|
||||
make_emacs_tag_block (filename)
|
||||
char *filename;
|
||||
{
|
||||
EMACS_TAG_BLOCK *block;
|
||||
|
||||
block = (EMACS_TAG_BLOCK *)xmalloc (sizeof (EMACS_TAG_BLOCK));
|
||||
block->filename = xstrdup (filename);
|
||||
block->entrylen = 0;
|
||||
block->entries = (EMACS_TAG **)NULL;
|
||||
block->entries_index = 0;
|
||||
block->entries_slots = 0;
|
||||
return (block);
|
||||
}
|
||||
|
||||
static void
|
||||
add_tag_to_block (block, name, line, char_offset)
|
||||
EMACS_TAG_BLOCK *block;
|
||||
char *name;
|
||||
int line;
|
||||
long char_offset;
|
||||
{
|
||||
EMACS_TAG *tag;
|
||||
|
||||
tag = (EMACS_TAG *)xmalloc (sizeof (EMACS_TAG));
|
||||
tag->name = name;
|
||||
tag->line = line;
|
||||
tag->char_offset = char_offset;
|
||||
add_pointer_to_array (tag, block->entries_index, block->entries,
|
||||
block->entries_slots, 50, EMACS_TAG *);
|
||||
}
|
||||
|
||||
/* Read the file represented by FILENAME into core, and search it for Info
|
||||
function declarations. Output the declarations in various forms to the
|
||||
DOC_STREAM and FUNS_STREAM. */
|
||||
static void
|
||||
process_one_file (filename, doc_stream, funs_stream)
|
||||
char *filename;
|
||||
FILE *doc_stream, *funs_stream;
|
||||
{
|
||||
int descriptor, decl_len;
|
||||
char *buffer, *decl_str;
|
||||
struct stat finfo;
|
||||
long offset;
|
||||
long file_size;
|
||||
EMACS_TAG_BLOCK *block;
|
||||
|
||||
if (stat (filename, &finfo) == -1)
|
||||
fatal_file_error (filename);
|
||||
|
||||
descriptor = open (filename, O_RDONLY, 0666);
|
||||
|
||||
if (descriptor == -1)
|
||||
fatal_file_error (filename);
|
||||
|
||||
file_size = (long) finfo.st_size;
|
||||
buffer = (char *)xmalloc (1 + file_size);
|
||||
read (descriptor, buffer, file_size);
|
||||
close (descriptor);
|
||||
|
||||
offset = 0;
|
||||
decl_str = DECLARATION_STRING;
|
||||
decl_len = strlen (decl_str);
|
||||
|
||||
block = make_emacs_tag_block (filename);
|
||||
|
||||
while (1)
|
||||
{
|
||||
long point = 0;
|
||||
long line_start = 0;
|
||||
int line_number = 0;
|
||||
|
||||
char *func, *doc;
|
||||
#if defined (NAMED_FUNCTIONS)
|
||||
char *func_name;
|
||||
#endif /* NAMED_FUNCTIONS */
|
||||
|
||||
for (; offset < (file_size - decl_len); offset++)
|
||||
{
|
||||
if (buffer[offset] == '\n')
|
||||
{
|
||||
line_number++;
|
||||
line_start = offset + 1;
|
||||
}
|
||||
|
||||
if (strncmp (buffer + offset, decl_str, decl_len) == 0)
|
||||
{
|
||||
offset += decl_len;
|
||||
point = offset;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!point)
|
||||
break;
|
||||
|
||||
/* Skip forward until we find the open paren. */
|
||||
while (point < file_size)
|
||||
{
|
||||
if (buffer[point] == '\n')
|
||||
{
|
||||
line_number++;
|
||||
line_start = point + 1;
|
||||
}
|
||||
else if (buffer[point] == '(')
|
||||
break;
|
||||
|
||||
point++;
|
||||
}
|
||||
|
||||
while (point++ < file_size)
|
||||
{
|
||||
if (!whitespace_or_newline (buffer[point]))
|
||||
break;
|
||||
else if (buffer[point] == '\n')
|
||||
{
|
||||
line_number++;
|
||||
line_start = point + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (point >= file_size)
|
||||
break;
|
||||
|
||||
/* Now looking at name of function. Get it. */
|
||||
for (offset = point; buffer[offset] != ','; offset++);
|
||||
func = (char *)xmalloc (1 + (offset - point));
|
||||
strncpy (func, buffer + point, offset - point);
|
||||
func[offset - point] = '\0';
|
||||
|
||||
/* Remember this tag in the current block. */
|
||||
{
|
||||
char *tag_name;
|
||||
|
||||
tag_name = (char *)xmalloc (1 + (offset - line_start));
|
||||
strncpy (tag_name, buffer + line_start, offset - line_start);
|
||||
tag_name[offset - line_start] = '\0';
|
||||
add_tag_to_block (block, tag_name, line_number, point);
|
||||
}
|
||||
|
||||
#if defined (NAMED_FUNCTIONS)
|
||||
/* Generate the user-visible function name from the function's name. */
|
||||
{
|
||||
register int i;
|
||||
char *name_start;
|
||||
|
||||
name_start = func;
|
||||
|
||||
if (strncmp (name_start, "info_", 5) == 0)
|
||||
name_start += 5;
|
||||
|
||||
func_name = xstrdup (name_start);
|
||||
|
||||
/* Fix up "ea" commands. */
|
||||
if (strncmp (func_name, "ea_", 3) == 0)
|
||||
{
|
||||
char *temp_func_name;
|
||||
|
||||
temp_func_name = (char *)xmalloc (10 + strlen (func_name));
|
||||
strcpy (temp_func_name, "echo_area_");
|
||||
strcat (temp_func_name, func_name + 3);
|
||||
free (func_name);
|
||||
func_name = temp_func_name;
|
||||
}
|
||||
|
||||
for (i = 0; func_name[i]; i++)
|
||||
if (func_name[i] == '_')
|
||||
func_name[i] = '-';
|
||||
}
|
||||
#endif /* NAMED_FUNCTIONS */
|
||||
|
||||
/* Find doc string. */
|
||||
point = offset + 1;
|
||||
|
||||
while (point < file_size)
|
||||
{
|
||||
if (buffer[point] == '\n')
|
||||
{
|
||||
line_number++;
|
||||
line_start = point + 1;
|
||||
}
|
||||
|
||||
if (buffer[point] == '"')
|
||||
break;
|
||||
else
|
||||
point++;
|
||||
}
|
||||
|
||||
offset = point + 1;
|
||||
|
||||
while (offset < file_size)
|
||||
{
|
||||
if (buffer[offset] == '\n')
|
||||
{
|
||||
line_number++;
|
||||
line_start = offset + 1;
|
||||
}
|
||||
|
||||
if (buffer[offset] == '\\')
|
||||
offset += 2;
|
||||
else if (buffer[offset] == '"')
|
||||
break;
|
||||
else
|
||||
offset++;
|
||||
}
|
||||
|
||||
offset++;
|
||||
if (offset >= file_size)
|
||||
break;
|
||||
|
||||
doc = (char *)xmalloc (1 + (offset - point));
|
||||
strncpy (doc, buffer + point, offset - point);
|
||||
doc[offset - point] = '\0';
|
||||
|
||||
#if defined (NAMED_FUNCTIONS)
|
||||
fprintf (doc_stream, " { %s, \"%s\", %s },\n", func, func_name, doc);
|
||||
free (func_name);
|
||||
#else /* !NAMED_FUNCTIONS */
|
||||
fprintf (doc_stream, " { %s, %s },\n", func, doc);
|
||||
#endif /* !NAMED_FUNCTIONS */
|
||||
|
||||
fprintf (funs_stream, "extern void %s ();\n", func);
|
||||
free (func);
|
||||
free (doc);
|
||||
}
|
||||
free (buffer);
|
||||
|
||||
/* If we created any tags, remember this file on our global list. Otherwise,
|
||||
free the memory already allocated to it. */
|
||||
if (block->entries)
|
||||
add_pointer_to_array (block, emacs_tags_index, emacs_tags,
|
||||
emacs_tags_slots, 10, EMACS_TAG_BLOCK *);
|
||||
else
|
||||
{
|
||||
free (block->filename);
|
||||
free (block);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
fatal_file_error (filename)
|
||||
char *filename;
|
||||
{
|
||||
fprintf (stderr, _("Couldn't manipulate the file %s.\n"), filename);
|
||||
exit (2);
|
||||
}
|
||||
|
||||
static FILE *
|
||||
must_fopen (filename, mode)
|
||||
char *filename, *mode;
|
||||
{
|
||||
FILE *stream;
|
||||
|
||||
stream = fopen (filename, mode);
|
||||
if (!stream)
|
||||
fatal_file_error (filename);
|
||||
|
||||
return (stream);
|
||||
}
|
||||
|
|
@ -1,634 +0,0 @@
|
|||
/* man.c: How to read and format man files.
|
||||
$Id: man.c,v 1.5 1998/03/22 22:35:19 law Exp $
|
||||
|
||||
Copyright (C) 1995, 97 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 */
|
||||
|
||||
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;
|
||||
|
||||
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);
|
||||
oldsize += hlen;
|
||||
memcpy (file_buffer->contents + oldsize, 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);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
/* 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 (temp[(strlen (temp)) - 1] != '/')
|
||||
strcat (temp, "/");
|
||||
strcat (temp, filename);
|
||||
|
||||
free (temp_dirname);
|
||||
|
||||
statable = (stat (temp, &finfo) == 0);
|
||||
|
||||
/* If we have found a regular executable file, then use it. */
|
||||
if ((statable) && (S_ISREG (finfo.st_mode)) &&
|
||||
(access (temp, X_OK) == 0))
|
||||
return (temp);
|
||||
else
|
||||
free (temp);
|
||||
}
|
||||
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';
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
reap_children (sig)
|
||||
int sig;
|
||||
{
|
||||
int status;
|
||||
wait (&status);
|
||||
}
|
||||
|
||||
static char *
|
||||
get_manpage_contents (pagename)
|
||||
char *pagename;
|
||||
{
|
||||
static char *formatter_args[4] = { (char *)NULL };
|
||||
int pipes[2];
|
||||
pid_t child;
|
||||
char *formatted_page = (char *)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]. */
|
||||
pipe (pipes);
|
||||
|
||||
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]);
|
||||
}
|
||||
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]);
|
||||
close (fileno (stderr));
|
||||
close (fileno (stdin)); /* Don't print errors. */
|
||||
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]);
|
||||
exit (0);
|
||||
}
|
||||
|
||||
/* 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')
|
||||
j -= 2;
|
||||
}
|
||||
|
||||
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 = tag->nodename;
|
||||
node->contents = file_buffer->contents + tag->nodestart;
|
||||
node->nodelen = tag->nodelen;
|
||||
node->flags = 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);
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
/* man.h: Defines and external function declarations for man.c.
|
||||
$Id: man.h,v 1.1.1.2 1998/03/22 20:42:46 law 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.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Author: Brian J. Fox (bfox@ai.mit.edu) Sat May 6 16:19:13 1995. */
|
||||
|
||||
#ifndef INFO_MAN_H
|
||||
#define INFO_MAN_H
|
||||
|
||||
#define MANPAGE_FILE_BUFFER_NAME "*manpages*"
|
||||
|
||||
extern NODE *make_manpage_node (/* char *pagename */);
|
||||
extern NODE *get_manpage_node (/* FILE_BUFFER *file_buffer, char *pagename */);
|
||||
extern FILE_BUFFER *create_manpage_file_buffer (/* void */);
|
||||
extern long locate_manpage_xref (/* NODE *node, long start, int dir */);
|
||||
extern REFERENCE **xrefs_of_manpage (/* NODE *node */);
|
||||
extern REFERENCE **manpage_xrefs_in_binding (/* NODE *node, SEARCH_BINDING *binding */);
|
||||
|
||||
#endif /* INFO_MAN_H */
|
|
@ -1,339 +0,0 @@
|
|||
/* nodemenu.c -- Produce a menu of all visited nodes.
|
||||
$Id: nodemenu.c,v 1.1.1.2 1998/03/22 20:42:47 law Exp $
|
||||
|
||||
Copyright (C) 1993, 97 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"
|
||||
|
||||
/* Return a line describing the format of a node information line. */
|
||||
static char *
|
||||
nodemenu_format_info ()
|
||||
{
|
||||
return (_("\n\
|
||||
* Menu:\n\
|
||||
(File)Node Lines Size Containing File\n\
|
||||
---------- ----- ---- ---------------"));
|
||||
}
|
||||
|
||||
/* Produce a formatted line of information about NODE. Here is what we want
|
||||
the output listing to look like:
|
||||
|
||||
* Menu:
|
||||
(File)Node Lines Size Containing File
|
||||
---------- ----- ---- ---------------
|
||||
* (emacs)Buffers:: 48 2230 /usr/gnu/info/emacs/emacs-1
|
||||
* (autoconf)Writing configure.in:: 123 58789 /usr/gnu/info/autoconf/autoconf-1
|
||||
* (dir)Top:: 40 589 /usr/gnu/info/dir
|
||||
*/
|
||||
static char *
|
||||
format_node_info (node)
|
||||
NODE *node;
|
||||
{
|
||||
register int i, len;
|
||||
char *parent, *containing_file;
|
||||
static char *line_buffer = (char *)NULL;
|
||||
|
||||
if (!line_buffer)
|
||||
line_buffer = (char *)xmalloc (1000);
|
||||
|
||||
if (node->parent)
|
||||
{
|
||||
parent = filename_non_directory (node->parent);
|
||||
if (!parent)
|
||||
parent = node->parent;
|
||||
}
|
||||
else
|
||||
parent = (char *)NULL;
|
||||
|
||||
containing_file = node->filename;
|
||||
|
||||
if (!parent && !*containing_file)
|
||||
sprintf (line_buffer, "* %s::", node->nodename);
|
||||
else
|
||||
{
|
||||
char *file = (char *)NULL;
|
||||
|
||||
if (parent)
|
||||
file = parent;
|
||||
else
|
||||
file = filename_non_directory (containing_file);
|
||||
|
||||
if (!file)
|
||||
file = containing_file;
|
||||
|
||||
if (!*file)
|
||||
file = "dir";
|
||||
|
||||
sprintf (line_buffer, "* (%s)%s::", file, node->nodename);
|
||||
}
|
||||
|
||||
len = pad_to (36, line_buffer);
|
||||
|
||||
{
|
||||
int lines = 1;
|
||||
|
||||
for (i = 0; i < node->nodelen; i++)
|
||||
if (node->contents[i] == '\n')
|
||||
lines++;
|
||||
|
||||
sprintf (line_buffer + len, "%d", lines);
|
||||
}
|
||||
|
||||
len = pad_to (44, line_buffer);
|
||||
sprintf (line_buffer + len, "%ld", node->nodelen);
|
||||
|
||||
if (node->filename && *(node->filename))
|
||||
{
|
||||
len = pad_to (51, line_buffer);
|
||||
sprintf (line_buffer + len, node->filename);
|
||||
}
|
||||
|
||||
return xstrdup (line_buffer);
|
||||
}
|
||||
|
||||
/* Little string comparison routine for qsort (). */
|
||||
static int
|
||||
compare_strings (string1, string2)
|
||||
char **string1, **string2;
|
||||
{
|
||||
return (strcasecmp (*string1, *string2));
|
||||
}
|
||||
|
||||
/* The name of the nodemenu node. */
|
||||
static char *nodemenu_nodename = "*Node Menu*";
|
||||
|
||||
/* Produce an informative listing of all the visited nodes, and return it
|
||||
in a node. If FILTER_FUNC is non-null, it is a function which filters
|
||||
which nodes will appear in the listing. FILTER_FUNC takes an argument
|
||||
of NODE, and returns non-zero if the node should appear in the listing. */
|
||||
NODE *
|
||||
get_visited_nodes (filter_func)
|
||||
Function *filter_func;
|
||||
{
|
||||
register int i, iw_index;
|
||||
INFO_WINDOW *info_win;
|
||||
NODE *node;
|
||||
char **lines = (char **)NULL;
|
||||
int lines_index = 0, lines_slots = 0;
|
||||
|
||||
if (!info_windows)
|
||||
return ((NODE *)NULL);
|
||||
|
||||
for (iw_index = 0; (info_win = info_windows[iw_index]); iw_index++)
|
||||
{
|
||||
for (i = 0; i < info_win->nodes_index; i++)
|
||||
{
|
||||
node = info_win->nodes[i];
|
||||
|
||||
/* We skip mentioning "*Node Menu*" nodes. */
|
||||
if (internal_info_node_p (node) &&
|
||||
(strcmp (node->nodename, nodemenu_nodename) == 0))
|
||||
continue;
|
||||
|
||||
if (node && (!filter_func || (*filter_func) (node)))
|
||||
{
|
||||
char *line;
|
||||
|
||||
line = format_node_info (node);
|
||||
add_pointer_to_array
|
||||
(line, lines_index, lines, lines_slots, 20, char *);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Sort the array of information lines, if there are any. */
|
||||
if (lines)
|
||||
{
|
||||
register int j, newlen;
|
||||
char **temp;
|
||||
|
||||
qsort (lines, lines_index, sizeof (char *), compare_strings);
|
||||
|
||||
/* Delete duplicates. */
|
||||
for (i = 0, newlen = 1; i < lines_index - 1; i++)
|
||||
{
|
||||
if (strcmp (lines[i], lines[i + 1]) == 0)
|
||||
{
|
||||
free (lines[i]);
|
||||
lines[i] = (char *)NULL;
|
||||
}
|
||||
else
|
||||
newlen++;
|
||||
}
|
||||
|
||||
/* We have free ()'d and marked all of the duplicate slots.
|
||||
Copy the live slots rather than pruning the dead slots. */
|
||||
temp = (char **)xmalloc ((1 + newlen) * sizeof (char *));
|
||||
for (i = 0, j = 0; i < lines_index; i++)
|
||||
if (lines[i])
|
||||
temp[j++] = lines[i];
|
||||
|
||||
temp[j] = (char *)NULL;
|
||||
free (lines);
|
||||
lines = temp;
|
||||
lines_index = newlen;
|
||||
}
|
||||
|
||||
initialize_message_buffer ();
|
||||
|
||||
printf_to_message_buffer
|
||||
("%s", replace_in_documentation
|
||||
(_("Here is the menu of nodes you have recently visited.\n\
|
||||
Select one from this menu, or use `\\[history-node]' in another window.\n")));
|
||||
|
||||
printf_to_message_buffer ("%s\n", nodemenu_format_info ());
|
||||
|
||||
for (i = 0; (lines != (char **)NULL) && (i < lines_index); i++)
|
||||
{
|
||||
printf_to_message_buffer ("%s\n", lines[i]);
|
||||
free (lines[i]);
|
||||
}
|
||||
|
||||
if (lines)
|
||||
free (lines);
|
||||
|
||||
node = message_buffer_to_node ();
|
||||
add_gcable_pointer (node->contents);
|
||||
return (node);
|
||||
}
|
||||
|
||||
DECLARE_INFO_COMMAND (list_visited_nodes,
|
||||
_("Make a window containing a menu of all of the currently visited nodes"))
|
||||
{
|
||||
WINDOW *new;
|
||||
NODE *node;
|
||||
|
||||
set_remembered_pagetop_and_point (window);
|
||||
|
||||
/* If a window is visible and showing the buffer list already, re-use it. */
|
||||
for (new = windows; new; new = new->next)
|
||||
{
|
||||
node = new->node;
|
||||
|
||||
if (internal_info_node_p (node) &&
|
||||
(strcmp (node->nodename, nodemenu_nodename) == 0))
|
||||
break;
|
||||
}
|
||||
|
||||
/* If we couldn't find an existing window, try to use the next window
|
||||
in the chain. */
|
||||
if (!new)
|
||||
{
|
||||
if (window->next)
|
||||
new = window->next;
|
||||
/* If there is more than one window, wrap around. */
|
||||
else if (window != windows)
|
||||
new = windows;
|
||||
}
|
||||
|
||||
/* If we still don't have a window, make a new one to contain the list. */
|
||||
if (!new)
|
||||
{
|
||||
WINDOW *old_active;
|
||||
|
||||
old_active = active_window;
|
||||
active_window = window;
|
||||
new = window_make_window ((NODE *)NULL);
|
||||
active_window = old_active;
|
||||
}
|
||||
|
||||
/* If we couldn't make a new window, use this one. */
|
||||
if (!new)
|
||||
new = window;
|
||||
|
||||
/* Lines do not wrap in this window. */
|
||||
new->flags |= W_NoWrap;
|
||||
node = get_visited_nodes ((Function *)NULL);
|
||||
name_internal_node (node, nodemenu_nodename);
|
||||
|
||||
#if 0
|
||||
/* Even if 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. */
|
||||
/* Why? We depend on internal_info_node_p returning true, so we must
|
||||
not remove the flag. Otherwise, the *Node Menu* nodes themselves
|
||||
appear in the node menu. --Andreas Schwab
|
||||
<schwab@issan.informatik.uni-dortmund.de>. */
|
||||
node->flags &= ~N_IsInternal;
|
||||
#endif
|
||||
|
||||
/* If this window is already showing a node menu, reuse the existing node
|
||||
slot. */
|
||||
{
|
||||
int remember_me = 1;
|
||||
|
||||
#if defined (NOTDEF)
|
||||
if (internal_info_node_p (new->node) &&
|
||||
(strcmp (new->node->nodename, nodemenu_nodename) == 0))
|
||||
remember_me = 0;
|
||||
#endif /* NOTDEF */
|
||||
|
||||
window_set_node_of_window (new, node);
|
||||
|
||||
if (remember_me)
|
||||
remember_window_and_node (new, node);
|
||||
}
|
||||
|
||||
active_window = new;
|
||||
}
|
||||
|
||||
DECLARE_INFO_COMMAND (select_visited_node,
|
||||
_("Select a node which has been previously visited in a visible window"))
|
||||
{
|
||||
char *line;
|
||||
NODE *node;
|
||||
REFERENCE **menu;
|
||||
|
||||
node = get_visited_nodes ((Function *)NULL);
|
||||
|
||||
menu = info_menu_of_node (node);
|
||||
free (node);
|
||||
|
||||
line =
|
||||
info_read_completing_in_echo_area (window, _("Select visited node: "), menu);
|
||||
|
||||
window = active_window;
|
||||
|
||||
/* User aborts, just quit. */
|
||||
if (!line)
|
||||
{
|
||||
info_abort_key (window, 0, 0);
|
||||
info_free_references (menu);
|
||||
return;
|
||||
}
|
||||
|
||||
if (*line)
|
||||
{
|
||||
REFERENCE *entry;
|
||||
|
||||
/* Find the selected label in the references. */
|
||||
entry = info_get_labeled_reference (line, menu);
|
||||
|
||||
if (!entry)
|
||||
info_error (_("The reference disappeared! (%s)."), line);
|
||||
else
|
||||
info_select_reference (window, entry);
|
||||
}
|
||||
|
||||
free (line);
|
||||
info_free_references (menu);
|
||||
|
||||
if (!info_error_was_printed)
|
||||
window_clear_echo_area ();
|
||||
}
|
1185
texinfo/info/nodes.c
1185
texinfo/info/nodes.c
File diff suppressed because it is too large
Load diff
|
@ -1,169 +0,0 @@
|
|||
/* nodes.h -- How we represent nodes internally.
|
||||
$Id: nodes.h,v 1.1.1.2 1998/03/22 20:42:49 law 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.
|
||||
|
||||
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 (NODES_H)
|
||||
#define NODES_H
|
||||
|
||||
#include "info.h"
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
/* User Code Interface */
|
||||
/* */
|
||||
/* **************************************************************** */
|
||||
|
||||
/* Callers generally only want the node itself. This structure is used
|
||||
to pass node information around. None of the information in this
|
||||
structure should ever be directly freed. The structure itself can
|
||||
be passed to free (). Note that NODE->parent is non-null if this
|
||||
node's file is a subfile. In that case, NODE->parent is the logical
|
||||
name of the file containing this node. Both names are given as full
|
||||
paths, so you might have: node->filename = "/usr/gnu/info/emacs-1",
|
||||
with node->parent = "/usr/gnu/info/emacs". */
|
||||
typedef struct {
|
||||
char *filename; /* The physical file containing this node. */
|
||||
char *parent; /* Non-null is the logical file name. */
|
||||
char *nodename; /* The name of this node. */
|
||||
char *contents; /* Characters appearing in this node. */
|
||||
long nodelen; /* The length of the CONTENTS member. */
|
||||
int flags; /* See immediately below. */
|
||||
} NODE;
|
||||
|
||||
/* Defines that can appear in NODE->flags. All informative. */
|
||||
#define N_HasTagsTable 0x01 /* This node was found through a tags table. */
|
||||
#define N_TagsIndirect 0x02 /* The tags table was an indirect one. */
|
||||
#define N_UpdateTags 0x04 /* The tags table is out of date. */
|
||||
#define N_IsCompressed 0x08 /* The file is compressed on disk. */
|
||||
#define N_IsInternal 0x10 /* This node was made by Info. */
|
||||
#define N_CannotGC 0x20 /* File buffer cannot be gc'ed. */
|
||||
#define N_IsManPage 0x40 /* This node is a Un*x manpage. */
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
/* Internal Data Structures */
|
||||
/* */
|
||||
/* **************************************************************** */
|
||||
|
||||
/* Some defines describing details about Info file contents. */
|
||||
|
||||
/* String Constants. */
|
||||
#define INFO_FILE_LABEL "File:"
|
||||
#define INFO_NODE_LABEL "Node:"
|
||||
#define INFO_PREV_LABEL "Prev:"
|
||||
#define INFO_ALTPREV_LABEL "Previous:"
|
||||
#define INFO_NEXT_LABEL "Next:"
|
||||
#define INFO_UP_LABEL "Up:"
|
||||
#define INFO_MENU_LABEL "\n* Menu:"
|
||||
#define INFO_MENU_ENTRY_LABEL "\n* "
|
||||
#define INFO_XREF_LABEL "*Note"
|
||||
#define TAGS_TABLE_END_LABEL "\nEnd Tag Table"
|
||||
#define TAGS_TABLE_BEG_LABEL "Tag Table:\n"
|
||||
#define INDIRECT_TAGS_TABLE_LABEL "Indirect:\n"
|
||||
#define TAGS_TABLE_IS_INDIRECT_LABEL "(Indirect)"
|
||||
|
||||
/* Character Constants. */
|
||||
#define INFO_COOKIE '\037'
|
||||
#define INFO_FF '\014'
|
||||
#define INFO_TAGSEP '\177'
|
||||
|
||||
/* For each logical file that we have loaded, we keep a list of the names
|
||||
of the nodes that are found in that file. A pointer to a node in an
|
||||
info file is called a "tag". For split files, the tag pointer is
|
||||
"indirect"; that is, the pointer also contains the name of the split
|
||||
file where the node can be found. For non-split files, the filename
|
||||
member in the structure below simply contains the name of the current
|
||||
file. The following structure describes a single node within a file. */
|
||||
typedef struct {
|
||||
char *filename; /* The file where this node can be found. */
|
||||
char *nodename; /* The node pointed to by this tag. */
|
||||
long nodestart; /* The offset of the start of this node. */
|
||||
long nodelen; /* The length of this node. */
|
||||
} TAG;
|
||||
|
||||
/* The following structure is used to remember information about the contents
|
||||
of Info files that we have loaded at least once before. The FINFO member
|
||||
is present so that we can reload the file if it has been modified since
|
||||
last being loaded. All of the arrays appearing within this structure
|
||||
are NULL terminated, and each array which can change size has a
|
||||
corresponding SLOTS member which says how many slots have been allocated
|
||||
(with malloc ()) for this array. */
|
||||
typedef struct {
|
||||
char *filename; /* The filename used to find this file. */
|
||||
char *fullpath; /* The full pathname of this info file. */
|
||||
struct stat finfo; /* Information about this file. */
|
||||
char *contents; /* The contents of this particular file. */
|
||||
long filesize; /* The number of bytes this file expands to. */
|
||||
char **subfiles; /* If non-null, the list of subfiles. */
|
||||
TAG **tags; /* If non-null, the indirect tags table. */
|
||||
int tags_slots; /* Number of slots allocated for TAGS. */
|
||||
int flags; /* Various flags. Mimics of N_* flags. */
|
||||
} FILE_BUFFER;
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
/* Externally Visible Functions */
|
||||
/* */
|
||||
/* **************************************************************** */
|
||||
|
||||
/* Array of FILE_BUFFER * which represents the currently loaded info files. */
|
||||
extern FILE_BUFFER **info_loaded_files;
|
||||
|
||||
/* The number of slots currently allocated to INFO_LOADED_FILES. */
|
||||
extern int info_loaded_files_slots;
|
||||
|
||||
/* 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 *. */
|
||||
extern FILE_BUFFER *info_find_file ();
|
||||
|
||||
/* Force load the file named FILENAME, and return the information structure
|
||||
describing this file. Even if the file was already loaded, this loads
|
||||
a new buffer, rebuilds tags and nodes, and returns a new FILE_BUFFER *. */
|
||||
extern FILE_BUFFER *info_load_file ();
|
||||
|
||||
/* Return a pointer to a NODE structure for the Info node (FILENAME)NODENAME.
|
||||
FILENAME can be passed as NULL, in which case the filename of "dir" is used.
|
||||
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. */
|
||||
extern NODE *info_get_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. */
|
||||
extern NODE *info_get_node_of_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. */
|
||||
extern void build_tags_and_nodes ();
|
||||
|
||||
/* When non-zero, this is a string describing the most recent file error. */
|
||||
extern char *info_recent_file_error;
|
||||
|
||||
/* Create a new, empty file buffer. */
|
||||
extern FILE_BUFFER *make_file_buffer ();
|
||||
|
||||
#endif /* !NODES_H */
|
|
@ -1,519 +0,0 @@
|
|||
/* search.c -- How to search large bodies of text. */
|
||||
|
||||
/* 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.
|
||||
|
||||
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 "search.h"
|
||||
#include "nodes.h"
|
||||
|
||||
/* The search functions take two arguments:
|
||||
|
||||
1) a string to search for, and
|
||||
|
||||
2) a pointer to a SEARCH_BINDING which contains the buffer, start,
|
||||
and end of the search.
|
||||
|
||||
They return a long, which is the offset from the start of the buffer
|
||||
at which the match was found. An offset of -1 indicates failure. */
|
||||
|
||||
/* A function which makes a binding with buffer and bounds. */
|
||||
SEARCH_BINDING *
|
||||
make_binding (buffer, start, end)
|
||||
char *buffer;
|
||||
long start, end;
|
||||
{
|
||||
SEARCH_BINDING *binding;
|
||||
|
||||
binding = (SEARCH_BINDING *)xmalloc (sizeof (SEARCH_BINDING));
|
||||
binding->buffer = buffer;
|
||||
binding->start = start;
|
||||
binding->end = end;
|
||||
binding->flags = 0;
|
||||
|
||||
return (binding);
|
||||
}
|
||||
|
||||
/* Make a copy of BINDING without duplicating the data. */
|
||||
SEARCH_BINDING *
|
||||
copy_binding (binding)
|
||||
SEARCH_BINDING *binding;
|
||||
{
|
||||
SEARCH_BINDING *copy;
|
||||
|
||||
copy = make_binding (binding->buffer, binding->start, binding->end);
|
||||
copy->flags = binding->flags;
|
||||
return (copy);
|
||||
}
|
||||
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
/* The Actual Searching Functions */
|
||||
/* */
|
||||
/* **************************************************************** */
|
||||
|
||||
/* Search forwards or backwards for the text delimited by BINDING.
|
||||
The search is forwards if BINDING->start is greater than BINDING->end. */
|
||||
long
|
||||
search (string, binding)
|
||||
char *string;
|
||||
SEARCH_BINDING *binding;
|
||||
{
|
||||
long result;
|
||||
|
||||
/* If the search is backwards, then search backwards, otherwise forwards. */
|
||||
if (binding->start > binding->end)
|
||||
result = search_backward (string, binding);
|
||||
else
|
||||
result = search_forward (string, binding);
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
/* Search forwards for STRING through the text delimited in BINDING. */
|
||||
long
|
||||
search_forward (string, binding)
|
||||
char *string;
|
||||
SEARCH_BINDING *binding;
|
||||
{
|
||||
register int c, i, len;
|
||||
register char *buff, *end;
|
||||
char *alternate = (char *)NULL;
|
||||
|
||||
len = strlen (string);
|
||||
|
||||
/* We match characters in the search buffer against STRING and ALTERNATE.
|
||||
ALTERNATE is a case reversed version of STRING; this is cheaper than
|
||||
case folding each character before comparison. Alternate is only
|
||||
used if the case folding bit is turned on in the passed BINDING. */
|
||||
|
||||
if (binding->flags & S_FoldCase)
|
||||
{
|
||||
alternate = xstrdup (string);
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
if (islower (alternate[i]))
|
||||
alternate[i] = toupper (alternate[i]);
|
||||
else if (isupper (alternate[i]))
|
||||
alternate[i] = tolower (alternate[i]);
|
||||
}
|
||||
}
|
||||
|
||||
buff = binding->buffer + binding->start;
|
||||
end = binding->buffer + binding->end + 1;
|
||||
|
||||
while (buff < (end - len))
|
||||
{
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
c = buff[i];
|
||||
|
||||
if ((c != string[i]) && (!alternate || c != alternate[i]))
|
||||
break;
|
||||
}
|
||||
|
||||
if (!string[i])
|
||||
{
|
||||
if (alternate)
|
||||
free (alternate);
|
||||
if (binding->flags & S_SkipDest)
|
||||
buff += len;
|
||||
return ((long) (buff - binding->buffer));
|
||||
}
|
||||
|
||||
buff++;
|
||||
}
|
||||
|
||||
if (alternate)
|
||||
free (alternate);
|
||||
|
||||
return ((long) -1);
|
||||
}
|
||||
|
||||
/* Search for STRING backwards through the text delimited in BINDING. */
|
||||
long
|
||||
search_backward (input_string, binding)
|
||||
char *input_string;
|
||||
SEARCH_BINDING *binding;
|
||||
{
|
||||
register int c, i, len;
|
||||
register char *buff, *end;
|
||||
char *string;
|
||||
char *alternate = (char *)NULL;
|
||||
|
||||
len = strlen (input_string);
|
||||
|
||||
/* Reverse the characters in the search string. */
|
||||
string = (char *)xmalloc (1 + len);
|
||||
for (c = 0, i = len - 1; input_string[c]; c++, i--)
|
||||
string[i] = input_string[c];
|
||||
|
||||
string[c] = '\0';
|
||||
|
||||
/* We match characters in the search buffer against STRING and ALTERNATE.
|
||||
ALTERNATE is a case reversed version of STRING; this is cheaper than
|
||||
case folding each character before comparison. ALTERNATE is only
|
||||
used if the case folding bit is turned on in the passed BINDING. */
|
||||
|
||||
if (binding->flags & S_FoldCase)
|
||||
{
|
||||
alternate = xstrdup (string);
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
if (islower (alternate[i]))
|
||||
alternate[i] = toupper (alternate[i]);
|
||||
else if (isupper (alternate[i]))
|
||||
alternate[i] = tolower (alternate[i]);
|
||||
}
|
||||
}
|
||||
|
||||
buff = binding->buffer + binding->start - 1;
|
||||
end = binding->buffer + binding->end;
|
||||
|
||||
while (buff > (end + len))
|
||||
{
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
c = *(buff - i);
|
||||
|
||||
if (c != string[i] && (alternate && c != alternate[i]))
|
||||
break;
|
||||
}
|
||||
|
||||
if (!string[i])
|
||||
{
|
||||
free (string);
|
||||
if (alternate)
|
||||
free (alternate);
|
||||
|
||||
if (binding->flags & S_SkipDest)
|
||||
buff -= len;
|
||||
return ((long) (1 + (buff - binding->buffer)));
|
||||
}
|
||||
|
||||
buff--;
|
||||
}
|
||||
|
||||
free (string);
|
||||
if (alternate)
|
||||
free (alternate);
|
||||
|
||||
return ((long) -1);
|
||||
}
|
||||
|
||||
/* Find STRING in LINE, returning the offset of the end of the string.
|
||||
Return an offset of -1 if STRING does not appear in LINE. The search
|
||||
is bound by the end of the line (i.e., either NEWLINE or 0). */
|
||||
int
|
||||
string_in_line (string, line)
|
||||
char *string, *line;
|
||||
{
|
||||
register int end;
|
||||
SEARCH_BINDING binding;
|
||||
|
||||
/* Find the end of the line. */
|
||||
for (end = 0; line[end] && line[end] != '\n'; end++);
|
||||
|
||||
/* Search for STRING within these confines. */
|
||||
binding.buffer = line;
|
||||
binding.start = 0;
|
||||
binding.end = end;
|
||||
binding.flags = S_FoldCase | S_SkipDest;
|
||||
|
||||
return (search_forward (string, &binding));
|
||||
}
|
||||
|
||||
/* Return non-zero if STRING is the first text to appear at BINDING. */
|
||||
int
|
||||
looking_at (string, binding)
|
||||
char *string;
|
||||
SEARCH_BINDING *binding;
|
||||
{
|
||||
long search_end;
|
||||
|
||||
search_end = search (string, binding);
|
||||
|
||||
/* If the string was not found, SEARCH_END is -1. If the string was found,
|
||||
but not right away, SEARCH_END is != binding->start. Otherwise, the
|
||||
string was found at binding->start. */
|
||||
return (search_end == binding->start);
|
||||
}
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
/* Small String Searches */
|
||||
/* */
|
||||
/* **************************************************************** */
|
||||
|
||||
/* Function names that start with "skip" are passed a string, and return
|
||||
an offset from the start of that string. Function names that start
|
||||
with "find" are passed a SEARCH_BINDING, and return an absolute position
|
||||
marker of the item being searched for. "Find" functions return a value
|
||||
of -1 if the item being looked for couldn't be found. */
|
||||
|
||||
/* Return the index of the first non-whitespace character in STRING. */
|
||||
int
|
||||
skip_whitespace (string)
|
||||
char *string;
|
||||
{
|
||||
register int i;
|
||||
|
||||
for (i = 0; string && whitespace (string[i]); i++);
|
||||
return (i);
|
||||
}
|
||||
|
||||
/* Return the index of the first non-whitespace or newline character in
|
||||
STRING. */
|
||||
int
|
||||
skip_whitespace_and_newlines (string)
|
||||
char *string;
|
||||
{
|
||||
register int i;
|
||||
|
||||
for (i = 0; string && (whitespace (string[i]) || string[i] == '\n'); i++);
|
||||
return (i);
|
||||
}
|
||||
|
||||
/* Return the index of the first whitespace character in STRING. */
|
||||
int
|
||||
skip_non_whitespace (string)
|
||||
char *string;
|
||||
{
|
||||
register int i;
|
||||
|
||||
for (i = 0; string && !whitespace (string[i]); i++);
|
||||
return (i);
|
||||
}
|
||||
|
||||
/* Return the index of the first non-node character in STRING. Note that
|
||||
this function contains quite a bit of hair to ignore periods in some
|
||||
special cases. This is because we here at GNU ship some info files which
|
||||
contain nodenames that contain periods. No such nodename can start with
|
||||
a period, or continue with whitespace, newline, or ')' immediately following
|
||||
the period. If second argument NEWLINES_OKAY is non-zero, newlines should
|
||||
be skipped while parsing out the nodename specification. */
|
||||
int
|
||||
skip_node_characters (string, newlines_okay)
|
||||
char *string;
|
||||
int newlines_okay;
|
||||
{
|
||||
register int c, i = 0;
|
||||
int paren_seen = 0;
|
||||
int paren = 0;
|
||||
|
||||
/* Handle special case. This is when another function has parsed out the
|
||||
filename component of the node name, and we just want to parse out the
|
||||
nodename proper. In that case, a period at the start of the nodename
|
||||
indicates an empty nodename. */
|
||||
if (string && *string == '.')
|
||||
return (0);
|
||||
|
||||
if (string && *string == '(')
|
||||
{
|
||||
paren++;
|
||||
paren_seen++;
|
||||
i++;
|
||||
}
|
||||
|
||||
for (; string && (c = string[i]); i++)
|
||||
{
|
||||
if (paren)
|
||||
{
|
||||
if (c == '(')
|
||||
paren++;
|
||||
else if (c == ')')
|
||||
paren--;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
/* If the character following the close paren is a space or period,
|
||||
then this node name has no more characters associated with it. */
|
||||
if (c == '\t' ||
|
||||
c == ',' ||
|
||||
c == INFO_TAGSEP ||
|
||||
((!newlines_okay) && (c == '\n')) ||
|
||||
((paren_seen && string[i - 1] == ')') &&
|
||||
(c == ' ' || c == '.')) ||
|
||||
(c == '.' &&
|
||||
(
|
||||
#if 0
|
||||
/* This test causes a node name ending in a period, like `This.', not to
|
||||
be found. The trailing . is stripped. This occurs in the jargon
|
||||
file (`I see no X here.' is a node name). */
|
||||
(!string[i + 1]) ||
|
||||
#endif
|
||||
(whitespace_or_newline (string[i + 1])) ||
|
||||
(string[i + 1] == ')'))))
|
||||
break;
|
||||
}
|
||||
return (i);
|
||||
}
|
||||
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
/* Searching FILE_BUFFER's */
|
||||
/* */
|
||||
/* **************************************************************** */
|
||||
|
||||
/* Return the absolute position of the first occurence of a node separator in
|
||||
BINDING-buffer. The search starts at BINDING->start. Return -1 if no node
|
||||
separator was found. */
|
||||
long
|
||||
find_node_separator (binding)
|
||||
SEARCH_BINDING *binding;
|
||||
{
|
||||
register long i;
|
||||
char *body;
|
||||
|
||||
body = binding->buffer;
|
||||
|
||||
/* A node is started by [^L]^_[^L]\n. That is to say, the C-l's are
|
||||
optional, but the DELETE and NEWLINE are not. This separator holds
|
||||
true for all separated elements in an Info file, including the tags
|
||||
table (if present) and the indirect tags table (if present). */
|
||||
for (i = binding->start; i < binding->end - 1; i++)
|
||||
if (((body[i] == INFO_FF && body[i + 1] == INFO_COOKIE) &&
|
||||
(body[i + 2] == '\n' ||
|
||||
(body[i + 2] == INFO_FF && body[i + 3] == '\n'))) ||
|
||||
((body[i] == INFO_COOKIE) &&
|
||||
(body[i + 1] == '\n' ||
|
||||
(body[i + 1] == INFO_FF && body[i + 2] == '\n'))))
|
||||
return (i);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Return the length of the node separator characters that BODY is
|
||||
currently pointing at. */
|
||||
int
|
||||
skip_node_separator (body)
|
||||
char *body;
|
||||
{
|
||||
register int i;
|
||||
|
||||
i = 0;
|
||||
|
||||
if (body[i] == INFO_FF)
|
||||
i++;
|
||||
|
||||
if (body[i++] != INFO_COOKIE)
|
||||
return (0);
|
||||
|
||||
if (body[i] == INFO_FF)
|
||||
i++;
|
||||
|
||||
if (body[i++] != '\n')
|
||||
return (0);
|
||||
|
||||
return (i);
|
||||
}
|
||||
|
||||
/* Return the number of characters from STRING to the start of
|
||||
the next line. */
|
||||
int
|
||||
skip_line (string)
|
||||
char *string;
|
||||
{
|
||||
register int i;
|
||||
|
||||
for (i = 0; string && string[i] && string[i] != '\n'; i++);
|
||||
|
||||
if (string[i] == '\n')
|
||||
i++;
|
||||
|
||||
return (i);
|
||||
}
|
||||
|
||||
/* Return the absolute position of the beginning of a tags table in this
|
||||
binding starting the search at binding->start. */
|
||||
long
|
||||
find_tags_table (binding)
|
||||
SEARCH_BINDING *binding;
|
||||
{
|
||||
SEARCH_BINDING search;
|
||||
long position;
|
||||
|
||||
search.buffer = binding->buffer;
|
||||
search.start = binding->start;
|
||||
search.end = binding->end;
|
||||
search.flags = S_FoldCase;
|
||||
|
||||
while ((position = find_node_separator (&search)) != -1 )
|
||||
{
|
||||
search.start = position;
|
||||
search.start += skip_node_separator (search.buffer + search.start);
|
||||
|
||||
if (looking_at (TAGS_TABLE_BEG_LABEL, &search))
|
||||
return (position);
|
||||
}
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Return the absolute position of the node named NODENAME in BINDING.
|
||||
This is a brute force search, and we wish to avoid it when possible.
|
||||
This function is called when a tag (indirect or otherwise) doesn't
|
||||
really point to the right node. It returns the absolute position of
|
||||
the separator preceding the node. */
|
||||
long
|
||||
find_node_in_binding (nodename, binding)
|
||||
char *nodename;
|
||||
SEARCH_BINDING *binding;
|
||||
{
|
||||
long position;
|
||||
int offset, namelen;
|
||||
SEARCH_BINDING search;
|
||||
|
||||
namelen = strlen (nodename);
|
||||
|
||||
search.buffer = binding->buffer;
|
||||
search.start = binding->start;
|
||||
search.end = binding->end;
|
||||
search.flags = 0;
|
||||
|
||||
while ((position = find_node_separator (&search)) != -1)
|
||||
{
|
||||
search.start = position;
|
||||
search.start += skip_node_separator (search.buffer + search.start);
|
||||
|
||||
offset = string_in_line (INFO_NODE_LABEL, search.buffer + search.start);
|
||||
|
||||
if (offset == -1)
|
||||
continue;
|
||||
|
||||
search.start += offset;
|
||||
search.start += skip_whitespace (search.buffer + search.start);
|
||||
offset = skip_node_characters
|
||||
(search.buffer + search.start, DONT_SKIP_NEWLINES);
|
||||
|
||||
/* Notice that this is an exact match. You cannot grovel through
|
||||
the buffer with this function looking for random nodes. */
|
||||
if ((offset == namelen) &&
|
||||
(search.buffer[search.start] == nodename[0]) &&
|
||||
(strncmp (search.buffer + search.start, nodename, offset) == 0))
|
||||
return (position);
|
||||
}
|
||||
return (-1);
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue