home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-08-26 | 44.1 KB | 1,157 lines |
- Newsgroups: comp.sources.misc
- Path: sparky!kent
- From: kendall@centerline.com (Sam Kendall)
- Subject: v31i124: tags++ - etags/ctags for C and C++, version 1.1, Part01/03
- Message-ID: <csm-v31i124=tags++.094745@sparky.IMD.Sterling.COM>
- Followup-To: comp.sources.d
- X-Md4-Signature: 709bfaf56c2320e324fa71f271773fe4
- Sender: kent@sparky.imd.sterling.com (Kent Landfield)
- Organization: CenterLine Software, Inc.
- Date: Wed, 26 Aug 1992 14:48:58 GMT
- Approved: kent@sparky.imd.sterling.com
- Lines: 1143
-
- Submitted-by: kendall@centerline.com (Sam Kendall)
- Posting-number: Volume 31, Issue 124
- Archive-name: tags++/part01
- Environment: UNIX, GNU Emacs, vi
-
- >From the README:
-
- Tags++: etags/ctags for C and C++
- Version 1.1
-
-
- This package is tags++, an enhanced version of etags and tags.el (for
- use with GNU Emacs Version 18) and ctags (for use with vi). The
- enhancements support C++, and they support C better than the standard
- etags, tags.el, and ctags.
-
- This should work on all Unix(tm of AT&T) systems. It may work on VMS
- (with VMS GNU Emacs), but that has not been tested; please let me know
- if you have tried it on VMS, successfully or unsuccessfully.
-
- Tags++ has not changed significantly in several years and is robust.
-
-
- Advantages of Tags++
- --------------------
-
- The major advantage of tags++ over the standard version in Emacs
- Version 18 is support for C++. For example, given this program:
-
- class A {
- int i;
- public:
- A() { i = 5; }
- int get_i();
- };
-
- int A::get_i() { return i; }
-
- you can find the tags "A", "A::A", or "A::get_i". Caveat: if you are
- using ctags and vi, you must supply the "-T" switch when you run ctags
- to get this to happen.
-
- Even for C, tags++ finds more stuff (such as macro constants and
- structure tags) than other versions.
-
- In Emacs, you get name completion in the minibuffer (on all
- identifiers in the program). See the man page for an example of why
- this is useful. Note that the visit-tags-table operation is slow
- because it is building an alist for name completion.
-
- Also in Emacs, M-. finds exact matches first; then M-, (or C-U M-.)
- finds other exact matches, followed by successively less exact matches.
- For example, suppose you type M-. f RET, and your sources contain
- functions "efface", "f_internal", "foo", and "f" in that order. The
- standard tags facility will find these in that order -- frustrating if
- you just wanted "f". Tags++ will find "f" first (exact match), then
- "f_internal" (word match), then "efface" and "foo" (inexact matches).
-
-
- Compatibility
- -------------
-
- Tags++ is forward- and backward-compatible with the standard versions
- of etags and tags.el (for Emacs Version 18) and ctags. In other words,
- if some people at a site are using the standard tags facility and others
- are using tags++, no one will notice -- except that tags++ users will be
- unhappy with the sparse tags files produced by the standard etags or
- ctags.
-
- Tags++ almost certainly works with Epoch, although we haven't tried.
- Tags++ -- along with all other Emacs Version 18 tags programs -- is
- probably incompatible with the upcoming Emacs Version 19.
-
-
- *** For more info see the 'README' file ***
-
- Sam Kendall kendall@CenterLine.COM
- CenterLine Software Inc. (formerly Saber Software) uunet!saber!kendall
- -----
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 1 (of 3)."
- # Contents: COPYING Makefile README README.2 etags.1
- # Wrapped by kendall@pen on Tue Aug 25 13:34:19 1992
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'COPYING' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'COPYING'\"
- else
- echo shar: Extracting \"'COPYING'\" \(17982 characters\)
- sed "s/^X//" >'COPYING' <<'END_OF_FILE'
- X GNU GENERAL PUBLIC LICENSE
- X Version 2, June 1991
- X
- X Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- X 675 Mass Ave, Cambridge, MA 02139, USA
- X Everyone is permitted to copy and distribute verbatim copies
- X of this license document, but changing it is not allowed.
- X
- X Preamble
- X
- X The licenses for most software are designed to take away your
- Xfreedom to share and change it. By contrast, the GNU General Public
- XLicense is intended to guarantee your freedom to share and change free
- Xsoftware--to make sure the software is free for all its users. This
- XGeneral Public License applies to most of the Free Software
- XFoundation's software and to any other program whose authors commit to
- Xusing it. (Some other Free Software Foundation software is covered by
- Xthe GNU Library General Public License instead.) You can apply it to
- Xyour programs, too.
- X
- X When we speak of free software, we are referring to freedom, not
- Xprice. Our General Public Licenses are designed to make sure that you
- Xhave the freedom to distribute copies of free software (and charge for
- Xthis service if you wish), that you receive source code or can get it
- Xif you want it, that you can change the software or use pieces of it
- Xin new free programs; and that you know you can do these things.
- X
- X To protect your rights, we need to make restrictions that forbid
- Xanyone to deny you these rights or to ask you to surrender the rights.
- XThese restrictions translate to certain responsibilities for you if you
- Xdistribute copies of the software, or if you modify it.
- X
- X For example, if you distribute copies of such a program, whether
- Xgratis or for a fee, you must give the recipients all the rights that
- Xyou have. You must make sure that they, too, receive or can get the
- Xsource code. And you must show them these terms so they know their
- Xrights.
- X
- X We protect your rights with two steps: (1) copyright the software, and
- X(2) offer you this license which gives you legal permission to copy,
- Xdistribute and/or modify the software.
- X
- X Also, for each author's protection and ours, we want to make certain
- Xthat everyone understands that there is no warranty for this free
- Xsoftware. If the software is modified by someone else and passed on, we
- Xwant its recipients to know that what they have is not the original, so
- Xthat any problems introduced by others will not reflect on the original
- Xauthors' reputations.
- X
- X Finally, any free program is threatened constantly by software
- Xpatents. We wish to avoid the danger that redistributors of a free
- Xprogram will individually obtain patent licenses, in effect making the
- Xprogram proprietary. To prevent this, we have made it clear that any
- Xpatent must be licensed for everyone's free use or not licensed at all.
- X
- X The precise terms and conditions for copying, distribution and
- Xmodification follow.
- X
- X GNU GENERAL PUBLIC LICENSE
- X TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- X
- X 0. This License applies to any program or other work which contains
- Xa notice placed by the copyright holder saying it may be distributed
- Xunder the terms of this General Public License. The "Program", below,
- Xrefers to any such program or work, and a "work based on the Program"
- Xmeans either the Program or any derivative work under copyright law:
- Xthat is to say, a work containing the Program or a portion of it,
- Xeither verbatim or with modifications and/or translated into another
- Xlanguage. (Hereinafter, translation is included without limitation in
- Xthe term "modification".) Each licensee is addressed as "you".
- X
- XActivities other than copying, distribution and modification are not
- Xcovered by this License; they are outside its scope. The act of
- Xrunning the Program is not restricted, and the output from the Program
- Xis covered only if its contents constitute a work based on the
- XProgram (independent of having been made by running the Program).
- XWhether that is true depends on what the Program does.
- X
- X 1. You may copy and distribute verbatim copies of the Program's
- Xsource code as you receive it, in any medium, provided that you
- Xconspicuously and appropriately publish on each copy an appropriate
- Xcopyright notice and disclaimer of warranty; keep intact all the
- Xnotices that refer to this License and to the absence of any warranty;
- Xand give any other recipients of the Program a copy of this License
- Xalong with the Program.
- X
- XYou may charge a fee for the physical act of transferring a copy, and
- Xyou may at your option offer warranty protection in exchange for a fee.
- X
- X 2. You may modify your copy or copies of the Program or any portion
- Xof it, thus forming a work based on the Program, and copy and
- Xdistribute such modifications or work under the terms of Section 1
- Xabove, provided that you also meet all of these conditions:
- X
- X a) You must cause the modified files to carry prominent notices
- X stating that you changed the files and the date of any change.
- X
- X b) You must cause any work that you distribute or publish, that in
- X whole or in part contains or is derived from the Program or any
- X part thereof, to be licensed as a whole at no charge to all third
- X parties under the terms of this License.
- X
- X c) If the modified program normally reads commands interactively
- X when run, you must cause it, when started running for such
- X interactive use in the most ordinary way, to print or display an
- X announcement including an appropriate copyright notice and a
- X notice that there is no warranty (or else, saying that you provide
- X a warranty) and that users may redistribute the program under
- X these conditions, and telling the user how to view a copy of this
- X License. (Exception: if the Program itself is interactive but
- X does not normally print such an announcement, your work based on
- X the Program is not required to print an announcement.)
- X
- XThese requirements apply to the modified work as a whole. If
- Xidentifiable sections of that work are not derived from the Program,
- Xand can be reasonably considered independent and separate works in
- Xthemselves, then this License, and its terms, do not apply to those
- Xsections when you distribute them as separate works. But when you
- Xdistribute the same sections as part of a whole which is a work based
- Xon the Program, the distribution of the whole must be on the terms of
- Xthis License, whose permissions for other licensees extend to the
- Xentire whole, and thus to each and every part regardless of who wrote it.
- X
- XThus, it is not the intent of this section to claim rights or contest
- Xyour rights to work written entirely by you; rather, the intent is to
- Xexercise the right to control the distribution of derivative or
- Xcollective works based on the Program.
- X
- XIn addition, mere aggregation of another work not based on the Program
- Xwith the Program (or with a work based on the Program) on a volume of
- Xa storage or distribution medium does not bring the other work under
- Xthe scope of this License.
- X
- X 3. You may copy and distribute the Program (or a work based on it,
- Xunder Section 2) in object code or executable form under the terms of
- XSections 1 and 2 above provided that you also do one of the following:
- X
- X a) Accompany it with the complete corresponding machine-readable
- X source code, which must be distributed under the terms of Sections
- X 1 and 2 above on a medium customarily used for software interchange; or,
- X
- X b) Accompany it with a written offer, valid for at least three
- X years, to give any third party, for a charge no more than your
- X cost of physically performing source distribution, a complete
- X machine-readable copy of the corresponding source code, to be
- X distributed under the terms of Sections 1 and 2 above on a medium
- X customarily used for software interchange; or,
- X
- X c) Accompany it with the information you received as to the offer
- X to distribute corresponding source code. (This alternative is
- X allowed only for noncommercial distribution and only if you
- X received the program in object code or executable form with such
- X an offer, in accord with Subsection b above.)
- X
- XThe source code for a work means the preferred form of the work for
- Xmaking modifications to it. For an executable work, complete source
- Xcode means all the source code for all modules it contains, plus any
- Xassociated interface definition files, plus the scripts used to
- Xcontrol compilation and installation of the executable. However, as a
- Xspecial exception, the source code distributed need not include
- Xanything that is normally distributed (in either source or binary
- Xform) with the major components (compiler, kernel, and so on) of the
- Xoperating system on which the executable runs, unless that component
- Xitself accompanies the executable.
- X
- XIf distribution of executable or object code is made by offering
- Xaccess to copy from a designated place, then offering equivalent
- Xaccess to copy the source code from the same place counts as
- Xdistribution of the source code, even though third parties are not
- Xcompelled to copy the source along with the object code.
- X
- X 4. You may not copy, modify, sublicense, or distribute the Program
- Xexcept as expressly provided under this License. Any attempt
- Xotherwise to copy, modify, sublicense or distribute the Program is
- Xvoid, and will automatically terminate your rights under this License.
- XHowever, parties who have received copies, or rights, from you under
- Xthis License will not have their licenses terminated so long as such
- Xparties remain in full compliance.
- X
- X 5. You are not required to accept this License, since you have not
- Xsigned it. However, nothing else grants you permission to modify or
- Xdistribute the Program or its derivative works. These actions are
- Xprohibited by law if you do not accept this License. Therefore, by
- Xmodifying or distributing the Program (or any work based on the
- XProgram), you indicate your acceptance of this License to do so, and
- Xall its terms and conditions for copying, distributing or modifying
- Xthe Program or works based on it.
- X
- X 6. Each time you redistribute the Program (or any work based on the
- XProgram), the recipient automatically receives a license from the
- Xoriginal licensor to copy, distribute or modify the Program subject to
- Xthese terms and conditions. You may not impose any further
- Xrestrictions on the recipients' exercise of the rights granted herein.
- XYou are not responsible for enforcing compliance by third parties to
- Xthis License.
- X
- X 7. If, as a consequence of a court judgment or allegation of patent
- Xinfringement or for any other reason (not limited to patent issues),
- Xconditions are imposed on you (whether by court order, agreement or
- Xotherwise) that contradict the conditions of this License, they do not
- Xexcuse you from the conditions of this License. If you cannot
- Xdistribute so as to satisfy simultaneously your obligations under this
- XLicense and any other pertinent obligations, then as a consequence you
- Xmay not distribute the Program at all. For example, if a patent
- Xlicense would not permit royalty-free redistribution of the Program by
- Xall those who receive copies directly or indirectly through you, then
- Xthe only way you could satisfy both it and this License would be to
- Xrefrain entirely from distribution of the Program.
- X
- XIf any portion of this section is held invalid or unenforceable under
- Xany particular circumstance, the balance of the section is intended to
- Xapply and the section as a whole is intended to apply in other
- Xcircumstances.
- X
- XIt is not the purpose of this section to induce you to infringe any
- Xpatents or other property right claims or to contest validity of any
- Xsuch claims; this section has the sole purpose of protecting the
- Xintegrity of the free software distribution system, which is
- Ximplemented by public license practices. Many people have made
- Xgenerous contributions to the wide range of software distributed
- Xthrough that system in reliance on consistent application of that
- Xsystem; it is up to the author/donor to decide if he or she is willing
- Xto distribute software through any other system and a licensee cannot
- Ximpose that choice.
- X
- XThis section is intended to make thoroughly clear what is believed to
- Xbe a consequence of the rest of this License.
- X
- X 8. If the distribution and/or use of the Program is restricted in
- Xcertain countries either by patents or by copyrighted interfaces, the
- Xoriginal copyright holder who places the Program under this License
- Xmay add an explicit geographical distribution limitation excluding
- Xthose countries, so that distribution is permitted only in or among
- Xcountries not thus excluded. In such case, this License incorporates
- Xthe limitation as if written in the body of this License.
- X
- X 9. The Free Software Foundation may publish revised and/or new versions
- Xof the General Public License from time to time. Such new versions will
- Xbe similar in spirit to the present version, but may differ in detail to
- Xaddress new problems or concerns.
- X
- XEach version is given a distinguishing version number. If the Program
- Xspecifies a version number of this License which applies to it and "any
- Xlater version", you have the option of following the terms and conditions
- Xeither of that version or of any later version published by the Free
- XSoftware Foundation. If the Program does not specify a version number of
- Xthis License, you may choose any version ever published by the Free Software
- XFoundation.
- X
- X 10. If you wish to incorporate parts of the Program into other free
- Xprograms whose distribution conditions are different, write to the author
- Xto ask for permission. For software which is copyrighted by the Free
- XSoftware Foundation, write to the Free Software Foundation; we sometimes
- Xmake exceptions for this. Our decision will be guided by the two goals
- Xof preserving the free status of all derivatives of our free software and
- Xof promoting the sharing and reuse of software generally.
- X
- X NO WARRANTY
- X
- X 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
- XFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
- XOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
- XPROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
- XOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- XMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
- XTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
- XPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
- XREPAIR OR CORRECTION.
- X
- X 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
- XWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
- XREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
- XINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
- XOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
- XTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
- XYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
- XPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
- XPOSSIBILITY OF SUCH DAMAGES.
- X
- X END OF TERMS AND CONDITIONS
- X
- X Appendix: How to Apply These Terms to Your New Programs
- X
- X If you develop a new program, and you want it to be of the greatest
- Xpossible use to the public, the best way to achieve this is to make it
- Xfree software which everyone can redistribute and change under these terms.
- X
- X To do so, attach the following notices to the program. It is safest
- Xto attach them to the start of each source file to most effectively
- Xconvey the exclusion of warranty; and each file should have at least
- Xthe "copyright" line and a pointer to where the full notice is found.
- X
- X <one line to give the program's name and a brief idea of what it does.>
- X Copyright (C) 19yy <name of author>
- X
- X This program is free software; you can redistribute it and/or modify
- X it under the terms of the GNU General Public License as published by
- X the Free Software Foundation; either version 2 of the License, or
- X (at your option) any later version.
- X
- X This program is distributed in the hope that it will be useful,
- X but WITHOUT ANY WARRANTY; without even the implied warranty of
- X MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X GNU General Public License for more details.
- X
- X You should have received a copy of the GNU General Public License
- X along with this program; if not, write to the Free Software
- X Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- X
- XAlso add information on how to contact you by electronic and paper mail.
- X
- XIf the program is interactive, make it output a short notice like this
- Xwhen it starts in an interactive mode:
- X
- X Gnomovision version 69, Copyright (C) 19yy name of author
- X Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- X This is free software, and you are welcome to redistribute it
- X under certain conditions; type `show c' for details.
- X
- XThe hypothetical commands `show w' and `show c' should show the appropriate
- Xparts of the General Public License. Of course, the commands you use may
- Xbe called something other than `show w' and `show c'; they could even be
- Xmouse-clicks or menu items--whatever suits your program.
- X
- XYou should also get your employer (if you work as a programmer) or your
- Xschool, if any, to sign a "copyright disclaimer" for the program, if
- Xnecessary. Here is a sample; alter the names:
- X
- X Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- X `Gnomovision' (which makes passes at compilers) written by James Hacker.
- X
- X <signature of Ty Coon>, 1 April 1989
- X Ty Coon, President of Vice
- X
- XThis General Public License does not permit incorporating your program into
- Xproprietary programs. If your program is a subroutine library, you may
- Xconsider it more useful to permit linking proprietary applications with the
- Xlibrary. If this is what you want to do, use the GNU Library General
- XPublic License instead of this License.
- END_OF_FILE
- if test 17982 -ne `wc -c <'COPYING'`; then
- echo shar: \"'COPYING'\" unpacked with wrong size!
- fi
- # end of 'COPYING'
- fi
- if test -f 'Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Makefile'\"
- else
- echo shar: Extracting \"'Makefile'\" \(1277 characters\)
- sed "s/^X//" >'Makefile' <<'END_OF_FILE'
- X# GFLAG = -g
- XOFLAG = -O
- XCFLAGS = $(OFLAG) $(GFLAG)
- XSRCFILES = COPYING Makefile README README.2 etags.c etags.1 tags.el
- XVERSION=1.0
- X
- X# Install binaries 'etags' and 'ctags' (a symlink) here.
- XBIN_DIR = /usr/local/bin
- X# Install man pages here.
- XMAN_DIR = /usr/local/man/man1
- X# Man page source filenames get this extension.
- XMAN_EXT = .1
- X
- Xetags: etags.o
- X $(CC) $(CFLAGS) -o etags etags.o
- X
- Xctags: etags
- X rm -f ctags
- X cp etags ctags
- X
- X# Install etags and ctags in $(BIN_DIR). Don't use a symlink;
- X# it messes up rdist.
- X# Note: this does not install tags.el in your local Emacs area;
- X# you must do that manually.
- Xinstall: etags
- X cp etags $(BIN_DIR)/etags
- X chmod 775 $(BIN_DIR)/etags
- X cp etags $(BIN_DIR)/ctags
- X chmod 775 $(BIN_DIR)/ctags
- X
- X# Install etags and ctags man pages (copies of the same page).
- Xinstall_man: etags.1
- X cp etags.1 $(MAN_DIR)/etags$(MAN_EXT)
- X cp etags.1 $(MAN_DIR)/ctags$(MAN_EXT)
- X
- Xcl_etags:
- X ##load -DDEBUG etags.c
- X
- Xclean:
- X rm -f etags ctags *.o
- X
- X# -s is needed because etags.c is so big.
- Xkit:
- X makekit -s60000 $(SRCFILES)
- X
- X# Make a tar file with fictional directory 'tags-VERSION'.
- Xtar tags-$(VERSION).tar.Z: $(SRCFILES)
- X rm -f tags-$(VERSION)
- X ln -s . tags-$(VERSION)
- X tar cf - `ls $(SRCFILES) | sed 's|^|tags-$(VERSION)/|'` | \
- X compress > tags-$(VERSION).tar.Z
- END_OF_FILE
- if test 1277 -ne `wc -c <'Makefile'`; then
- echo shar: \"'Makefile'\" unpacked with wrong size!
- fi
- # end of 'Makefile'
- fi
- if test -f 'README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README'\"
- else
- echo shar: Extracting \"'README'\" \(4255 characters\)
- sed "s/^X//" >'README' <<'END_OF_FILE'
- X$Id: README,v 1.4 1992/08/25 17:27:30 kendall Exp $
- X
- X Tags++: etags/ctags for C and C++
- X Version 1.1
- X
- X
- X This package is tags++, an enhanced version of etags and tags.el (for
- Xuse with GNU Emacs Version 18) and ctags (for use with vi). The
- Xenhancements support C++, and they support C better than the standard
- Xetags, tags.el, and ctags.
- X
- X This should work on all Unix(tm of AT&T) systems. It may work on VMS
- X(with VMS GNU Emacs), but that has not been tested; please let me know
- Xif you have tried it on VMS, successfully or unsuccessfully.
- X
- X Tags++ has not changed significantly in several years and is robust.
- X
- X
- XAdvantages of Tags++
- X--------------------
- X
- X The major advantage of tags++ over the standard version in Emacs
- XVersion 18 is support for C++. For example, given this program:
- X
- X class A {
- X int i;
- X public:
- X A() { i = 5; }
- X int get_i();
- X };
- X
- X int A::get_i() { return i; }
- X
- Xyou can find the tags "A", "A::A", or "A::get_i". Caveat: if you are
- Xusing ctags and vi, you must supply the "-T" switch when you run ctags
- Xto get this to happen.
- X
- X Even for C, tags++ finds more stuff (such as macro constants and
- Xstructure tags) than other versions.
- X
- X In Emacs, you get name completion in the minibuffer (on all
- Xidentifiers in the program). See the man page for an example of why
- Xthis is useful. Note that the visit-tags-table operation is slow
- Xbecause it is building an alist for name completion.
- X
- X Also in Emacs, M-. finds exact matches first; then M-, (or C-U M-.)
- Xfinds other exact matches, followed by successively less exact matches.
- XFor example, suppose you type M-. f RET, and your sources contain
- Xfunctions "efface", "f_internal", "foo", and "f" in that order. The
- Xstandard tags facility will find these in that order -- frustrating if
- Xyou just wanted "f". Tags++ will find "f" first (exact match), then
- X"f_internal" (word match), then "efface" and "foo" (inexact matches).
- X
- X
- XCompatibility
- X-------------
- X
- X Tags++ is forward- and backward-compatible with the standard versions
- Xof etags and tags.el (for Emacs Version 18) and ctags. In other words,
- Xif some people at a site are using the standard tags facility and others
- Xare using tags++, no one will notice -- except that tags++ users will be
- Xunhappy with the sparse tags files produced by the standard etags or
- Xctags.
- X
- X Tags++ almost certainly works with Epoch, although we haven't tried.
- XTags++ -- along with all other Emacs Version 18 tags programs -- is
- Xprobably incompatible with the upcoming Emacs Version 19.
- X
- X
- XWhat is Included
- X----------------
- X
- XCOPYING GNU general public license
- XMakefile
- XREADME this file
- XREADME.2 more detailed notes and bugs
- Xetags.c source for etags and ctags
- Xetags.1 etags and ctags man page
- Xtags.el tags facility for Emacs, elisp code
- X
- X
- XHow to Build and Install
- X------------------------
- X
- X To build etags, inspect the Makefile, change GFLAG and OFLAG if
- Xnecessary, and type "make". Type "make ctags" to make ctags (it's just
- Xa symlink to etags). etags.c is written in old-style (non-ANSI) C.
- X
- X To install etags and ctags, change BIN_DIR in the Makefile as
- Xappropriate and type "make install".
- X
- X To install the man page, change MAN_DIR and MAN_EXT in the Makefile
- Xas appropriate and type "make install_man".
- X
- X Install tags.el by copying it to an appropriate directory and
- Xbyte-compiling it (using Emacs M-x byte-compile-file). Users can get
- Xthis version of tags.el by:
- X
- X - Loading it explicitly from their .emacs files, OR
- X - Making sure that the directory in which this tags.el{,c} is
- X installed is in their load-path before the standard lisp
- X directory. This works because Emacs autoloads tags.
- X
- X
- XNotes
- X-----
- X
- X Emacs users may also be interested in c++-mode.el, which is available
- Xfor anonymous ftp on archive.cis.ohio-state.edu.
- X
- X Send comments, bugs, and enhancements to me.
- X
- X
- XVersions
- X--------
- X
- X8/25/92 1.1 Renamed the package "tags++" for easy archie-ability.
- X Updated the man page to reflect the fact that templates
- X work (serendipity!). Member functions of nested classes
- X should work a little better.
- X
- X6/4/92 1.0 FCS.
- X
- X
- X----
- XSam Kendall kendall@CenterLine.COM
- XCenterLine Software Inc. (formerly Saber Software) uunet!saber!kendall
- X10 Fawcett Street
- XCambridge, MA 02138 USA
- END_OF_FILE
- if test 4255 -ne `wc -c <'README'`; then
- echo shar: \"'README'\" unpacked with wrong size!
- fi
- # end of 'README'
- fi
- if test -f 'README.2' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README.2'\"
- else
- echo shar: Extracting \"'README.2'\" \(7209 characters\)
- sed "s/^X//" >'README.2' <<'END_OF_FILE'
- X Changes and suggested enhancements to etags.c and tags.el
- X Sam Kendall
- X
- X$Id: README.2,v 1.2 1992/04/28 13:26:59 kendall Exp $
- X
- XEtags options added include -D, -S, and others.
- X
- XI've made it illegal to pass most ctags options to etags. (To use the
- Xprogram as ctags, it must be compiled with -DCTAGS, or with neither
- X-DETAGS nor -DCTAGS.)
- X
- XI haven't documented the ctags-only options here.
- X
- Xtags.el modified as follows:
- X
- X 1. When finding multiple matches for the same tag (via a prefix arg
- X to find-tag, usually invoked with "ESC ,"), exact matches
- X are found first; then word matches; then other matches. In other
- X words, if I "ESC ." on "foo", the first match found will be "foo"
- X itself (exact match); then perhaps "bar_foo_baz" (word match); then
- X finally "foobar" (inexact match).
- X
- X 2. find-tag modified to handle the new "tag" field in a tag
- X line. A tag line can either be in the old format:
- X
- X definition\177lineno,charno
- X
- X or can have the additional "tag" field:
- X
- X definition\177lineno,charno,\001tag
- X
- X This "tag" field is necessary for C++, where the entire tag is NOT
- X necessarily found on the definition line. The "tag" field also
- X helps with exact tag matching. There may be more than one tag,
- X separated by \001 characters.
- X
- X The theory here is that you provide the tag field when the
- X definition field does not contain the correct tag. This theory could
- X be made more rigorous, to help with, for instance, exact tag matching
- X in mixed Lisp/C programs.
- X
- X The old tags.el will fail with new-format lines in TAGS files, but
- X there are many new-format lines only in C++ programs.
- X
- X This tags.el will work fine with old-format TAGS files.
- X
- X 3. All tags functions modified to ignore the character count that
- X follows each filename in the TAGS file. Behavior is not changed,
- X but this makes it much easier to write a program that edits the
- X TAGS file.
- X
- Xtags.el enhancements needed:
- X
- X doesn't know how to handle included TAGS files yet
- X per-mode and/or local versions of find-tag-default,
- X for easy customization
- X eliminate duplicates in alist when prompting
- X
- XEnhancements to make:
- X
- X * Is it possible to match C/C++ global variables? It would be really
- X nice.
- X * Generalize file suffix stuff -- clumsy and verbose now. Should
- X be config-file- or environment variable- or option-driven.
- X * Treat C++ "operator token" as a single identifier -- canonicalicalize
- X to leave one space between "operator" and token when token is
- X an identifier, no space when token is an operator.
- X * Make a tag for a struct tag in plain C as `struct name' (likewise
- X for union etc.). In canonical form, exactly one space in between.
- X Currently we make `name' into a tag in etags only; we don't by
- X default in ctags because `name' may not be unique, which breaks
- X ctags.
- X * Symbol table should be implemented as a hash table instead of as a
- X linked list.
- X * The TeX stuff should use the Stab abstraction.
- X * Needs profiling and performance enhancements.
- X * The C line "struct foo { ... };" will create a tag line that
- X searches for "struct foo ". If the search included the "{" it
- X would be more specific. This point is even more true if "foo" and
- X "{" are separated by a newline rather than a space, but having the
- X search pattern include a newline would require changes in the TAGS
- X file format.
- X * C programs that employ heavy macrification need a config file to
- X specify the conventions to etags. Config file must allow the
- X definition of macros that expand to types (e.g. `Seq(T)' expands
- X to `Seq_T'), symbol-defining macros (e.g. `DefineSeq(T)' should be
- X interpreted as a definition of `Seq_T'), macros that expand to
- X symbols (e.g. `M(Foo,Bar)' expands to `Type_Foo_Bar'), and macros
- X that cause unbalanced braces or parens (e.g. `LOOP', whose C
- X definition is "while(1){", leaves one left brace). Probably
- X others. This is much less important for C++ now that templates are
- X in the language.
- X * Config file should also handle definition of the "DEF" convention
- X of the Gnu Emacs source, and definition of the C* language
- X ("domain" keyword), so these can be taken out of the etags source.
- X * For C++, "::" is only understood if it occurs between identifiers with no
- X intervening whitespace. This style of C++ function definition:
- X returnntpype classname::
- X functionname(formals) {
- X ...
- X }
- X is not understood.
- X * Is there "::" handling needed for Common Lisp?
- X * Nroff/troff handling would be easy to write and useful. It could
- X be one of the default file modes, along with Pascal, Fortran and C
- X -- if a source file starts with "'" or ".", it's nroff/troff
- X source.
- X * There should be a defined interface between the
- X language-independent part of etags and the language modules. This
- X would make it easier to add a module.
- X * Macros defined inside braces aren't found, e.g.,
- X struct foo {
- X #define FOO() BAR
- X ... };
- X * '#' is only recognized to start a preprocessor line if it is in
- X column 0. According to ANSI it can be preceded by whitespace.
- X * A constant macro with no definition, e.g. `#define FOO', will not
- X be tagged, because `definedef' is prematurely reset by CNL.
- X * `typedef unsigned char TOK;' will get `char' defined as well as `TOK'.
- X * An extra ' or " wipes out the rest of the file; etags should take a
- X newline (not preceded by a \) as ending a string or char constant.
- X * C++ destructors are not understood correctly.
- X * In this program, we incorrectly think this is a def'n of
- X char_mask::sizeof:
- X union char_mask {
- X unsigned in[sizeof(int)];
- X };
- X * Needs to handle C++ nested classes, templates.
- X
- XItems about the format of the TAGS file:
- X
- X * Should make some special indication in a tags line that means both
- X (1) the pattern is an exact match for the definition line, and (2)
- X the ^? immediately follows the tag. In absence of this indication,
- X the pattern is only the beginning of the definition line, and the
- X last character before the ^? is not part of the tag. Helps in the
- X following situation:
- X struct foo *p;
- X struct foo
- X {
- X ...
- X };
- X Currently find-tag finds the first line instead of the correct
- X second one.
- X * Some way to tell whether the line `char *foo^?5,200' is the tag
- X `foo' or `*foo'. Since there are no modes in the TAGS file, we
- X can't (easily) say that since this is C, it can't be `*foo'. So
- X this line should be `char *foo^?5,200,^Afoo'. We need to decide on
- X the characters that are not in identifiers for any language. How
- X about space, TAB, FF, `(', `)', and `;'?
- X * Along the same lines, both etags and tags.el should canonicalize
- X tags to lowercase for case-independent languages. So `(defun
- X Foo^?5,200' in Lisp (but not Elisp) should be `(defun
- X Foo^?5,200,^Afoo'.
- X
- XFor Emacs Version 19:
- X
- X * This etags.c and tags.el (in a slightly earlier version) was fed
- X back to FSF several years ago, so I hope something like it will
- X come out with Emacs Version 19.
- END_OF_FILE
- if test 7209 -ne `wc -c <'README.2'`; then
- echo shar: \"'README.2'\" unpacked with wrong size!
- fi
- # end of 'README.2'
- fi
- if test -f 'etags.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'etags.1'\"
- else
- echo shar: Extracting \"'etags.1'\" \(7488 characters\)
- sed "s/^X//" >'etags.1' <<'END_OF_FILE'
- X.TH ETAGS 1 "4 June 1992"
- X.\"
- X.\" This text is in the public domain. You are welcome to use it for
- X.\" any purpose. It is not warranted to accurately describe anything.
- X.\" It was derived by Sam Kendall from the original ctags man page.
- X.\"
- X.UC 4
- X.SH NAME
- Xetags, ctags \- create tags files for GNU Emacs and ex/vi
- X.SH SYNOPSIS
- X.B etags
- X[
- X.B \-aDS
- X] [
- X.B \-o
- Xtagsfile ] file ...
- X.br
- X.B ctags
- X[
- X.B \-aBdFStTuwvx
- X] [
- X.B \-o
- Xtagsfile ] file ...
- X.SH DESCRIPTION
- X.I Etags
- Xmakes a tags file for GNU Emacs Version 18, and
- X.I ctags
- Xmakes a tags file for
- X.IR ex (1)/ vi (1),
- Xfrom the specified source files.
- XA tags file gives the locations of the definitions of named objects
- X(functions, variables, macros, types) in a group of source files.
- XEach name recorded is called a `tag'.
- XGiven a tag by the user, the editor uses a tags file to map
- Xthe name into a location in a source file, and takes the user there.
- X.PP
- XThe following filename extensions are understood:
- X.TP 10
- X.B "\.c \.h \.y \.C \.H \.cxx \.hxx \.ixx \.hc \.cc \.hpp \.cpp"
- XC or C++ source files.
- X.IR Etags :
- Xby default,
- Xfiles are searched for function, member function, macro function,
- Xmacro constant, and type definitions.
- X.IR Ctags :
- Xby default, files are searched for function and macro function definitions;
- Xuse the
- X.B \-Tdw
- Xoptions to also search for the rest and to suppress annoying warnings.
- X.\" .TP 10
- X.\" .B "\.cs \.hs"
- X.\" Dataparallel C source files.
- X.\" (Dataparallel C, formerly known as C*, is a parallel cousin of C++.)
- X.\" NOTE: Dataparallel C support is still in the source; I'll document
- X.\" it if someone tells me they are actually using it.
- X.\" -kendall@centerline.com 6/4/92
- X.TP 10
- X.B "\.tex \.aux \.bbl"
- XLaTex source files.
- X.TP 10
- X.B "\.s \.a"
- XAssembly language source files.
- X.TP 10
- X.B "\.l \.el \.lisp \.cl \.clisp"
- XEmacs Lisp or Common Lisp source files.
- X.TP 10
- X.B "\.scm \.sm \.scheme \.SM \.SCM \.scm\.\fIn\fP \.SCM\.\fIn\fP"
- XScheme source files.
- X.PP
- XOther files are first examined to see if they contain any
- XPascal or Fortran routine definitions; if not, they are processed again
- Xlooking for C or C++ definitions.
- X.SH "OPTIONS"
- X.TP 5
- X.B \-a
- Xappend to tags file.
- X.TP 5
- X.BR \-o " tagsfile"
- Xspecify tags file to output.
- XDefault is
- X.B TAGS
- Xfor
- X.I etags
- Xand
- X.B tags
- Xfor
- X.IR ctags .
- XA tagsfile of
- X.B \-
- Xmeans standard output.
- X.SH "OPTIONS FOR C AND C++"
- X.TP 5
- X.B \-d
- Xcreate tags for macro constant definitions
- X(default for
- X.BR etags ).
- X.TP 5
- X.B \-D
- Xdo not create tags for macro constant definitions (default for
- X.BR ctags ).
- XThis can halve the size of the TAGS file.
- X.TP 5
- X.B \-S
- Xdo
- X.I not
- Xassume that a `}' in column 0 indicates the end of a function body;
- Xthe default is to make this assumption.
- XUse this option with code that is poorly indented.
- XDo not use this option with code containing unbalanced curly braces,
- Xas can happen with sloppy conditional compilation.
- X.TP 5
- X.B \-t
- Xcreate tags for typedefs.
- X.TP 5
- X.B \-T
- Xcreate tags for type definitions (including typedefs)
- Xand member function definitions (default for
- X.BR etags ).
- X.SH "CTAGS ONLY"
- X.TP 5
- X.B \-F
- Xuse forward searching patterns (/.../) (default).
- X.TP 5
- X.B \-B
- Xuse backward searching patterns (?...?).
- X.TP 5
- X.B \-w
- Xsuppress warning diagnostics.
- X.TP 5
- X.B \-u
- Xcausing the specified files to be
- X.I updated
- Xin tags, that is, all references to them are deleted,
- Xand the new values are appended to the file.
- X(Beware: this option is implemented in a way which is rather slow;
- Xit is usually faster to simply rebuild the
- X.I tags
- Xfile.)
- X.TP 5
- X.B \-x
- Xproduce a list of object names, the line number and file
- Xname on which each is defined, as well as the text of that line,
- Xand print it on the standard output. This is a simple index
- Xwhich can be printed out as an off-line readable function index.
- X.TP 5
- X.B \-v
- Xproduce an index of the form expected by
- X.IR vgrind (1)
- Xand print it on the standard output.
- XThis listing contains the function name,
- Xfile name, and page number
- X(assuming 64 line pages).
- XSince the output will be sorted into lexicographic order,
- Xit may be desired to run the output through
- X.BR "sort \-f" .
- XSample use:
- X.nf
- X ctags \-v files | sort \-f > index
- X vgrind \-x index
- X.fi
- X.PP
- X.I Ctags
- Xtreats the tag
- X.I main
- Xspecially in C programs.
- XThe tag formed is created by prepending
- X.I M
- Xto the name of the file, with a trailing .c removed, if
- Xany, and leading pathname components also removed.
- XThis makes use of
- X.I ctags
- Xpractical in directories with more than one program.
- X.SH "HOW TO USE WITH GNU EMACS"
- XFirst, be sure
- X.B "tags.el"
- Xfrom this distribution is loaded, or is in a directory in your
- Xload-path.
- XThen you can use these commands:
- X.TP 12
- X.B "Meta-x visit-tags-table"
- XVisit a TAGS file.
- X.TP 12
- X.B "Meta-."
- XFind a definition for a tag.
- XThe default tag is the identifier under the cursor.
- XThere is name completion in the minibuffer;
- Xtyping
- X.B "foo TAB"
- Xcompletes the identifier starting with `foo' (`foobar',
- Xfor example) or lists the alternatives.
- XTyping
- X.B "Classname::?"
- Xlists all member functions of `Classname'.
- X.TP 12
- X.B "Meta-,"
- XFind the next definition for the tag.
- XExact matches are found first, followed
- Xby fuzzier matches.
- X.PP
- XFor more commands, see the
- X.I Tags
- Xtopic in the Emacs info tree.
- X.SH "HOW TO USE WITH VI"
- XOnce you have created a tags file, any use of
- X.I vi
- Xin the same directory will use that tags file.
- XHere are commands that you can use:
- X.TP 12
- X.B "vi -t \fItag\fR"
- XStarts up vi at the definition of tag.
- X.TP 12
- X.B "Control-]"
- XFind the tag under the cursor.
- X.TP 12
- X.B ":ta \fItag\fR"
- XFind a tag.
- X.PP
- XThese commands will find the first definition of tag.
- XUnfortunately, there is no way to find other definitions;
- Xthis is a limitation of
- X.IR vi .
- XFor more information, see the
- X.I vi
- Xdocumentation.
- X.SH "ENVIRONMENT VARIABLES"
- X.DT
- XTEXTAGS additional control sequences for LaTex
- X.SH FILES
- XTAGS default \fIetags\fP output tags file
- X.br
- Xtags default \fIctags\fP output tags file
- X.SH SEE ALSO
- Xemacs(1) (GNU Emacs), ex(1), vi(1)
- X.br
- X.IR Tags ,
- Xa topic under
- X.I Emacs
- Xin the GNU Emacs info tree; type
- X.B "C-H i"
- Xto read info.
- X.br
- X.IR Completion ,
- Xa topic under
- X.I Emacs
- Xin the GNU Emacs info tree.
- X.SH AUTHOR
- XKen Arnold wrote ctags.
- XContributors include Jim Kleckner, Bill Joy, Ed Pelegri-Llopart, and
- XRichard Stallman.
- XSam Kendall (kendall@centerline.com) added C++ support and maintains
- Xthis version.
- X.SH BUGS
- X.IR Ex (1)/ vi (1),
- Xand thus
- X.IR ctags ,
- Xcannot handle more than one tag with the same name;
- Xall but the first are discarded (and a warning is generated).
- XThis is a problem for many languages, but particularly for C++,
- Xwhich has overloaded functions,
- Xand for Pascal, which can have procedures in
- Xdifferent blocks with the same name.
- XThis is why the
- X.B \-T
- Xand
- X.B \-d
- Xoptions are not the default for
- X.IR ctags .
- X.I Emacs
- Xand
- X.I etags
- Xdo not share this limitation.
- X.PP
- XTricky macros in C and C++ (for example, macros that implement
- Xparameterized types) can lead to spurious or missing tag entries.
- X.PP
- XDoes not record C/C++ macros defined to nothing.
- X.PP
- XDoes not understand C++ nested classes.
- X.PP
- XRecognition of functions, subroutines and procedures
- Xfor Fortran and Pascal
- Xis done is a very simpleminded way.
- X.PP
- XThe method of deciding whether to look for C or Pascal
- Xand FORTRAN functions is a hack.
- X.PP
- XShould know about Pascal types.
- X.PP
- X.B \-x
- Xseems broken.
- XOn platforms that have it, use
- X.B "/usr/ucb/ctags \-x"
- Xinstead.
- X.PP
- XUse of
- X.B \-tx
- Xshows only the last line of each typedef.
- X.PP
- XSee the source code and
- X.B README.2
- Xfor additional bugs and suggestions for further work.
- END_OF_FILE
- if test 7488 -ne `wc -c <'etags.1'`; then
- echo shar: \"'etags.1'\" unpacked with wrong size!
- fi
- # end of 'etags.1'
- fi
- echo shar: End of archive 1 \(of 3\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 2 3 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 3 archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-
- exit 0 # Just in case...
-