# HG changeset patch # User Francesco Potort # Date 979505285 0 # Node ID e268b7b500f0a712f032e646e843755ddbb34941 # Parent 13441490c2f351e008d2fb1e59d35c367e5af124 Changes for makefile support in etags. diff -r 13441490c2f3 -r e268b7b500f0 etc/ChangeLog --- a/etc/ChangeLog Sun Jan 14 19:26:14 2001 +0000 +++ b/etc/ChangeLog Sun Jan 14 20:48:05 2001 +0000 @@ -1,3 +1,19 @@ +2001-01-14 Francesco Potorti` + + * etags.c (get_language_from_langname): Renamed from + get_language_from_name. + (get_language_from_filename): Renamed from + get_language_from_suffix. Now first looks for the complete file + name. + (language): New member char **filenames. + (Makefile_filenames): List of possible filenames for makefiles. + (lang_names): Added a NULL member for every entry, added an entry + for makefiles. + (Makefile_targets): New function, inspired by Assar Westerlund + . + (Texinfo_nodes): Renamed from Texinfo_fuctions and made + it conformant to the style of the rest of the code. + 2001-01-08 Gerd Moellmann * TUTORIAL.es: New file. @@ -6,7 +22,7 @@ * edt-user.doc: Updated to reflect EDT Emulation version 4.0 enhancements. - + 2000-12-29 Gerd Moellmann * fr-refcard.tex, fr-refcard.ps, fr-drdref.tex, fr-drdref.ps: New @@ -17,7 +33,7 @@ * ps-prin1.ps: Handle form feed better when ps-zebra-stripe-follow is non-nil. (printZebra, BeginPage): Code fix. - + 2000-12-15 Miles Bader * DEBUG: Add note aboute using `inverse-video' to detect excessive @@ -62,7 +78,7 @@ * splash.xbm: File removed. * splash.pbm: New file. - + 2000-09-20 Gerd Moellmann * splash.xbm: New file. @@ -85,7 +101,7 @@ * ps-prin1.ps: Changed comment version (6.0). * ps-prin0.ps: Changed comment version (6.0). - + 2000-08-24 Wlodzimierz Bzyl * survival.tex: New file. @@ -93,7 +109,7 @@ 2000-08-21 Gerd Moellmann * de-refcard.ps, de-refcard.tex: Renamed from refcard-de.*. - + * pl-refcard.ps, pl-refcard.tex: Renamed from refcard-pl.*. 2000-08-17 Gerd Moellmann @@ -174,7 +190,7 @@ * ps-prin1.ps: Replace gs_languagelevel by languagelevel. (printBackground, SetColor): New procs. (ZebraColor): Renaming old ZebraGray var. - + 2000-03-23 Vinicius Jose Latorre * ps-prin1.ps: Eliminate SkipFirstPage. @@ -184,14 +200,14 @@ * ps-prin0.ps: Define command only for language level 1. 2000-03-16 Vinicius Jose Latorre - + * ps-prin0.ps: Define packedarray operator for language level 1, adjust setduplexmode and settumble definitions. - + 2000-03-15 Vinicius Jose Latorre * ps-print0.ps: New file. - + * ps-prin1.ps, ps-prin3.ps: Eliminate CheckConfig. 2000-01-05 Vinicius Jose Latorre @@ -230,15 +246,15 @@ 2000-06-13 Gerd Moellmann * Version 20.7 released. - + 2000-02-26 Gerd Moellmann * Version 20.6 released. - + 1999-12-04 Gerd Moellmann * Version 20.5 released. - + 1999-11-30 Paul Eggert * PROBLEMS: Update Solaris 2.6 and 7 problems. diff -r 13441490c2f3 -r e268b7b500f0 etc/NEWS --- a/etc/NEWS Sun Jan 14 19:26:14 2001 +0000 +++ b/etc/NEWS Sun Jan 14 20:48:05 2001 +0000 @@ -230,7 +230,7 @@ ** Variable `load-path' is no longer customizable because it contains a version-dependent component. -** The new user-option `delete-key-deletes-forward' can be set to +** The new user-option `delete-key-deletes-forward' can be set to let the Delete function key delete forward instead of backward. On window systems, the default value of this option is chosen @@ -1448,6 +1448,8 @@ *** In Lisp, "(defstruct (foo", "(defun (operator" and similar constructs are now tagged. +*** In makefiles, tags the targets. + *** In Perl, the --globals option tags global variables. my and local variables are tagged. @@ -1510,7 +1512,7 @@ +++ ** New language environments `Dutch' and `Spanish'. -These new environments mainly select appropriate translations +These new environments mainly select appropriate translations of the tutorial. +++ @@ -2075,7 +2077,7 @@ There are a few Lisp changes which are not backwards-compatible and may require changes to existing code. Here is a list for reference. -** Since `format' preserves text properties, the idiom +** Since `format' preserves text properties, the idiom `(format %s foo)' no longer works to remove properties. ** Since the `keymap' text property now has significance, some code @@ -3231,7 +3233,7 @@ Setting `face-font-family-alternatives' allows the user to specify alternative font families to try if a family specified by a face -doesn't exist. +doesn't exist. Setting `face-font-registry-alternatives' allows the user to specify all alternative font registry names to try for a face speciying a diff -r 13441490c2f3 -r e268b7b500f0 lib-src/etags.1 --- a/lib-src/etags.1 Sun Jan 14 19:26:14 2001 +0000 +++ b/lib-src/etags.1 Sun Jan 14 20:48:05 2001 +0000 @@ -1,6 +1,6 @@ .\" Copyright (c) 1992 Free Software Foundation .\" See section COPYING for conditions for redistribution -.TH etags 1 "19apr1994" "GNU Tools" "GNU Tools" +.TH etags 1 "14gen2001" "GNU Tools" "GNU Tools" .de BP .sp .ti -.2i @@ -12,24 +12,33 @@ .SH SYNOPSIS .hy 0 .na -.B etags [\|\-aCDRSVh\|] [\|\-i \fIfile\fP\|] [\|\-l \fIlanguage\fP\|] [\|\-i \fIregexp\fP\|] [\|\-o \fItagfile\fP\|] +.B etags [\|\-aCDGImRVh\|] [\|\-i \fIfile\fP\|] [\|\-l \fIlanguage\fP\|] +.if n .br +.B [\|\-o \fItagfile\fP\|] [\|\-r \fIregexp\fP\|] .br -[\|\-\-c++\|] [\|\-\-no\-defines\|] [\|\-\-ignore\-indentation\|] -[\|\-\-language=\fIlanguage\fP\|] [\|\-\-regex=\fIregexp\fP\|] -[\|\-\-no\-regexp\|] [\|\-\-help\|] [\|\-\-version\|] -[\|\-\-include=\fIfile\fP\|] [\|\-\-output=\fItagfile\fP\|] -[\|\-\-append\|] \fIfile\fP .\|.\|. +[\|\-\-append\|] [\|\-\-c++\|] [\|\-\-no\-defines\|] +[\|\-\-no\-globals\|] [\|\-\-include=\fIfile\fP\|] +[\|\-\-ignore\-indentation\|] [\|\-\-language=\fIlanguage\fP\|] +[\|\-\-members\|] [\|\-\-output=\fItagfile\fP\|] +[\|\-\-regex=\fIregexp\fP\|] [\|\-\-no\-regex\|] +[\|\-\-ignore\-case\-regex=\fIregexp\fP\|] +[\|\-\-help\|] [\|\-\-version\|] +\fIfile\fP .\|.\|. -.B ctags [\|\-aCdRSVh\|] [\|\-BtTuvwx\|] [\|\-l \fIlanguage\fP\|] +.B ctags [\|\-aCdgImRVh\|] [\|\-BtTuvwx\|] [\|\-l \fIlanguage\fP\|] +.if n .br +.B [\|\-o \fItagfile\fP\|] [\|\-r \fIregexp\fP\|] .br -[\|\-i \fIregexp\fP\|] [\|\-o \fItagfile\fP\|] -[\|\-\-c++\|] [\|\-\-defines\|] [\|\-\-ignore\-indentation\|] -[\|\-\-no\-warn\|] [\|\-\-cxref\|] [\|\-\-backward\-search\|] -[\|\-\-forward\-search\|] [\|\-\-typedefs\|] [\|\-\-typedefs\-and\-c++\|] -[\|\-\-language=\fIlanguage\fP\|] [\|\-\-regex=\fIregexp\fP\|] +[\|\-\-append\|] [\|\-\-backward\-search\|] [\|\-\-c++\|] +[\|\-\-cxref\|] [\|\-\-defines\|] [\|\-\-forward\-search\|] +[\|\-\-globals\|] [\|\-\-ignore\-indentation\|] +[\|\-\-language=\fIlanguage\fP\|] [\|\-\-members\|] +[\|\-\-output=\fItagfile\fP\|] [\|\-\-regex=\fIregexp\fP\|] +[\|\-\-ignore\-case\-regex=\fIregexp\fP\|] +[\|\-\-typedefs\|] [\|\-\-typedefs\-and\-c++\|] +[\|\-\-update\|] [\|\-\-no\-warn\|] [\|\-\-help\|] [\|\-\-version\|] -.br -[\|\-\-output=\fItagfile\fP\|] [\|\-\-append\|] [\|\-\-update\|] \fIfile\fP .\|.\|. +\fIfile\fP .\|.\|. .ad b .hy 1 .SH DESCRIPTION @@ -40,8 +49,8 @@ format understood by .BR vi ( 1 )\c \&. Both forms of the program understand -the syntax of C, Objective C, C++, Java, Fortran, Pascal, Cobol, -LaTeX, Scheme, Emacs Lisp/Common Lisp, Postscript, Erlang, Prolog and +the syntax of C, Objective C, C++, Java, Fortran, Pascal, Cobol, Ada, Perl, +LaTeX, Scheme, Emacs Lisp/Common Lisp, Postscript, Erlang, Python, Prolog and most assembler\-like syntaxes. Both forms read the files specified on the command line, and write a tag table (defaults: `\|TAGS\|' for \fBetags\fP, `\|tags\|' for @@ -77,49 +86,73 @@ code. Files with `\|.C\|', `\|.H\|', `\|.cxx\|', `\|.hxx\|', or `\|.cc\|' extensions are always assumed to be C++ code. .TP +.B \-\-declarations +In C and derived languages, create tags for function declarations, +and create tags for extern variables unless \-\-no\-globals is used. +.TP .B \-d, \-\-defines -Create tag entries for C preprocessor constant definitions +Create tag entries for C preprocessor constant definitions and enum constants, too. This is the -default behavior for \fBetags\fP, so this option is only accepted -by \fBctags\fP. +default behavior for \fBetags\fP. .TP .B \-D, \-\-no\-defines Do not create tag entries for C preprocessor constant definitions and enum constants. This may make the tags file much smaller if many header files are tagged. -This is the default behavior for \fBctags\fP, so this option is only -accepted by \fBetags\fP. +This is the default behavior for \fBctags\fP. +.TP +.B \-g, \-\-globals +Create tag entries for global variables in C, C++, Objective C, Java, +and Perl. +This is the default behavior for \fBetags\fP. +.TP +.B \-G, \-\-no\-globals +Do not tag global variables. Typically this reduces the file size by +one fourth. This is the default behavior for \fBctags\fP. +.TP +\fB\-i\fP \fIfile\fP, \fB\-\-include=\fIfile\fP +Include a note in the tag file indicating that, when searching for a +tag, one should also consult the tags file \fIfile\fP after checking the +current file. This options is only accepted by \fBetags\fP. +.TP +.B \-I, \-\-ignore\-indentation +Don't rely on indentation as much as we normally do. Currently, this +means not to assume that a closing brace in the first column is the +final brace of a function or structure definition in C and C++. .TP \fB\-l\fP \fIlanguage\fP, \fB\-\-language=\fIlanguage\fP Parse the following files according to the given language. More than one such options may be intermixed with filenames. Use \fB\-\-help\fP to get a list of the available languages and their default filename extensions. The `auto' language can be used to restore automatic -detection of language based on filename extension. The `none' +detection of language based on the file name. The `none' language may be used to disable language parsing altogether; only regexp matching is done in this case (see the \fB\-\-regex\fP option). .TP -\fB\-\-no_globals\fP -Do not tag global variables in C, C++, Objective C, Java. Typically -this reduces the file size by one fourth. +.B \-m, \-\-members +Create tag entries for variables that are members of structure-like +constructs in C++, Objective C, Java. .TP -\fB\-\-members\fP -Tag variables that are members of strucure-like constructs in C++, -Objective C, Java. +.B \-M, \-\-no\-members +Do not tag member variables. This is the default behavior. +.TP +.B \-\-packages\-only +Only tag packages in Ada files. .TP \fB\-o\fP \fItagfile\fP, \fB\-\-output=\fItagfile\fP Explicit name of file for tag table; overrides default `\|TAGS\|' or `\|tags\|'. (But ignored with \fB\-v\fP or \fB\-x\fP.) .TP \fB\-r\fP \fIregexp\fP, \fB\-\-regex=\fIregexp\fP -Make tags based on regexp matching for each line of the files -following this option, in addition to the tags made with the standard -parsing based on language. May be freely intermixed with filenames -and the \fB\-R\fP option. The regexps are cumulative, i.e. each -option will add to the previous ones. The regexps are of the form: +\fB\-\-ignore\-case\-regex=\fIregexp\fP\ +Make tags based on regexp matching for each line of the files following +this option, in addition to the tags made with the standard parsing based +on language. When using \-\-regex, case is significant, while it is not +with \-\-ignore\-case\-regex. May be freely intermixed with filenames and +the \fB\-R\fP option. The regexps are cumulative, i.e. each option will +add to the previous ones. The regexps are of the form: .br - - \fB/\fP\fItagregexp\fP[\fB/\fP\fInameregexp\fP]\fB/\fP + \fB/\fP\fItagregexp\fP[\fB/\fP\fInameregexp\fP]\fB/\fP .br where \fItagregexp\fP is used to match the lines that must be tagged. @@ -127,8 +160,8 @@ such that more characters than needed are unavoidably matched by \fItagregexp\fP, it may be useful to add a \fInameregexp\fP, to narrow down the tag scope. \fBctags\fP ignores regexps without a -\fInameregexp\fP. The syntax of regexps is the same as in emacs, -augmented with intervals of the form \\{m,n\\}, as id ed or grep. +\fInameregexp\fP. The syntax of regexps is the same as in emacs, +augmented with intervals of the form \\{m,n\\}, as in ed or grep. .br Here are some examples. All the regexps are quoted to protect them from shell interpretation. @@ -152,16 +185,25 @@ .br \fI\-\-lang\=none \-\-regex\='/proc[\ \\t]+\\([^\ \\t]+\\)/\\1/'\fP +.br +A regexp can be preceded by {lang}, thus restriciting it to match lines of +files of the specified language. Use \fBetags --help\bP to obtain a list +of the recognised languages. This feature is particularly useful inside +\fBregex files\fB. A regex file contains one regex per line. Empty lines, +and those lines beginning with space or tab are ignored. Lines beginning +with @ are references to regex files whose name follows the @ sign. Other +lines are considered regular expressions like those following \-\-regex. +.br +For example, the command +.br +etags \-\-regex=@regex.file *.c +.br +reads the regexes contained in the file regex.file. .TP .B \-R, \-\-no\-regex Don't do any more regexp matching on the following files. May be freely intermixed with filenames and the \fB\-\-regex\fP option. .TP -.B \-S, \-\-ignore\-indentation -Don't rely on indentation as much as we normally do. Currently, this -means not to assume that a closing brace in the first column is the -final brace of a function or structure definition in C and C++. -.TP .B \-t, \-\-typedefs Record typedefs in C code as tags. Since this is the default behaviour of \fBetags\fP, only \fBctags\fP accepts this option. @@ -192,7 +234,7 @@ Instead of generating a tag file, write a cross reference (in \fBcxref\fP format) to standard output. Only \fBctags\fP accepts this option. .TP -.B \-H, \-\-help +.B \-h, \-H, \-\-help Print usage information. .TP .B \-V, \-\-version @@ -209,7 +251,7 @@ .BR vi ( 1 ). .SH COPYING -Copyright (c) 1992 Free Software Foundation, Inc. +Copyright (c) 1999 Free Software Foundation, Inc. .PP Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice diff -r 13441490c2f3 -r e268b7b500f0 lib-src/etags.c --- a/lib-src/etags.c Sun Jan 14 19:26:14 2001 +0000 +++ b/lib-src/etags.c Sun Jan 14 20:48:05 2001 +0000 @@ -31,7 +31,7 @@ * Francesco Potorti` (pot@gnu.org) is the current maintainer. */ -char pot_etags_version[] = "@(#) pot revision number is 13.44"; +char pot_etags_version[] = "@(#) pot revision number is 13.47"; #define TRUE 1 #define FALSE 0 @@ -160,21 +160,21 @@ #define strneq(s,t,n) ((DEBUG && (s) == NULL && (t) == NULL \ && (abort (), 1)) || !strncmp (s, t, n)) -#define lowcase(c) tolower ((unsigned char)(c)) -#define UPCASE(c) toupper ((unsigned char)(c)) - #define CHARS 256 /* 2^sizeof(char) */ -#define CHAR(x) ((unsigned int)x & (CHARS - 1)) +#define CHAR(x) ((unsigned int)(x) & (CHARS - 1)) #define iswhite(c) (_wht[CHAR(c)]) /* c is white */ #define notinname(c) (_nin[CHAR(c)]) /* c is not in a name */ #define begtoken(c) (_btk[CHAR(c)]) /* c can start token */ #define intoken(c) (_itk[CHAR(c)]) /* c can be in token */ #define endtoken(c) (_etk[CHAR(c)]) /* c ends tokens */ -#define ISALNUM(c) isalnum ((unsigned char) (c)) -#define ISALPHA(c) isalpha ((unsigned char) (c)) -#define ISDIGIT(c) isdigit ((unsigned char) (c)) -#define ISLOWER(c) islower ((unsigned char) (c)) +#define ISALNUM(c) isalnum (CHAR(c)) +#define ISALPHA(c) isalpha (CHAR(c)) +#define ISDIGIT(c) isdigit (CHAR(c)) +#define ISLOWER(c) islower (CHAR(c)) + +#define lowcase(c) tolower (CHAR(c)) +#define upcase(c) toupper (CHAR(c)) /* @@ -208,6 +208,7 @@ { char *name; Lang_function *function; + char **filenames; char **suffixes; char **interpreters; } language; @@ -254,14 +255,15 @@ static void Fortran_functions P_((FILE *)); static void Yacc_entries P_((FILE *)); static void Lisp_functions P_((FILE *)); +static void Makefile_targets P_((FILE *)); static void Pascal_functions P_((FILE *)); static void Perl_functions P_((FILE *)); static void Postscript_functions P_((FILE *)); static void Prolog_functions P_((FILE *)); static void Python_functions P_((FILE *)); static void Scheme_functions P_((FILE *)); -static void TeX_functions P_((FILE *)); -static void Texinfo_functions P_ ((FILE *)); +static void TeX_commands P_((FILE *)); +static void Texinfo_nodes P_((FILE *)); static void just_read_file P_((FILE *)); static void print_language_names P_((void)); @@ -271,9 +273,9 @@ static int number_len P_((long)); static compressor *get_compressor_from_suffix P_((char *, char **)); -static language *get_language_from_name P_((char *)); +static language *get_language_from_langname P_((char *)); static language *get_language_from_interpreter P_((char *)); -static language *get_language_from_suffix P_((char *)); +static language *get_language_from_filename P_((char *)); static int total_size_of_entries P_((node *)); static long readline P_((linebuffer *, FILE *)); static long readline_internal P_((linebuffer *, FILE *)); @@ -476,7 +478,7 @@ { "c", "h", NULL }; char *Cplusplus_suffixes [] = - { "C", "H", "c++", "cc", "cpp", "cxx", "h++", "hh", "hpp", "hxx", + { "C", "c++", "cc", "cpp", "cxx", "H", "h++", "hh", "hpp", "hxx", "M", /* Objective C++ */ "pdb", /* Postscript with C syntax */ NULL }; @@ -497,7 +499,10 @@ { "F", "f", "f90", "for", NULL }; char *Lisp_suffixes [] = - { "cl", "clisp", "el", "l", "lisp", "lsp", "ml", "LSP", NULL }; + { "cl", "clisp", "el", "l", "lisp", "LSP", "lsp", "ml", NULL }; + +char *Makefile_filenames [] = + { "Makefile", "makefile", "GNUMakefile", "Makefile.in", "Makefile.am", NULL}; char *Pascal_suffixes [] = { "p", "pas", NULL }; @@ -508,9 +513,9 @@ { "perl", "@PERL@", NULL }; char *plain_C_suffixes [] = - { "pc", /* Pro*C file */ + { "lm", /* Objective lex file */ "m", /* Objective C file */ - "lm", /* Objective lex file */ + "pc", /* Pro*C file */ NULL }; char *Postscript_suffixes [] = @@ -524,16 +529,16 @@ /* Can't do the `SCM' or `scm' prefix with a version number. */ char *Scheme_suffixes [] = - { "SCM", "SM", "oak", "sch", "scheme", "scm", "sm", "ss", "t", NULL }; + { "oak", "sch", "scheme", "SCM", "scm", "SM", "sm", "ss", "t", NULL }; char *TeX_suffixes [] = - { "TeX", "bib", "clo", "cls", "ltx", "sty", "tex", NULL }; + { "bib", "clo", "cls", "ltx", "sty", "TeX", "tex", NULL }; char *Texinfo_suffixes [] = - { "texi", "txi", "texinfo", NULL }; + { "texi", "texinfo", "txi", NULL }; char *Yacc_suffixes [] = - { "y", "ym", "yy", "yxx", "y++", NULL }; /* .ym is Objective yacc file */ + { "y", "y++", "ym", "yxx", "yy", NULL }; /* .ym is Objective yacc file */ /* * Table of languages. @@ -544,26 +549,27 @@ language lang_names [] = { - { "ada", Ada_funcs, Ada_suffixes, NULL }, - { "asm", Asm_labels, Asm_suffixes, NULL }, - { "c", default_C_entries, default_C_suffixes, NULL }, - { "c++", Cplusplus_entries, Cplusplus_suffixes, NULL }, - { "c*", Cstar_entries, Cstar_suffixes, NULL }, - { "cobol", Cobol_paragraphs, Cobol_suffixes, NULL }, - { "erlang", Erlang_functions, Erlang_suffixes, NULL }, - { "fortran", Fortran_functions, Fortran_suffixes, NULL }, - { "java", Cjava_entries, Cjava_suffixes, NULL }, - { "lisp", Lisp_functions, Lisp_suffixes, NULL }, - { "pascal", Pascal_functions, Pascal_suffixes, NULL }, - { "perl", Perl_functions, Perl_suffixes, Perl_interpreters }, - { "postscript", Postscript_functions, Postscript_suffixes, NULL }, - { "proc", plain_C_entries, plain_C_suffixes, NULL }, - { "prolog", Prolog_functions, Prolog_suffixes, NULL }, - { "python", Python_functions, Python_suffixes, NULL }, - { "scheme", Scheme_functions, Scheme_suffixes, NULL }, - { "tex", TeX_functions, TeX_suffixes, NULL }, - { "texinfo", Texinfo_functions, Texinfo_suffixes, NULL }, - { "yacc", Yacc_entries, Yacc_suffixes, NULL }, + { "ada", Ada_funcs, NULL, Ada_suffixes, NULL }, + { "asm", Asm_labels, NULL, Asm_suffixes, NULL }, + { "c", default_C_entries, NULL, default_C_suffixes, NULL }, + { "c++", Cplusplus_entries, NULL, Cplusplus_suffixes, NULL }, + { "c*", Cstar_entries, NULL, Cstar_suffixes, NULL }, + { "cobol", Cobol_paragraphs, NULL, Cobol_suffixes, NULL }, + { "erlang", Erlang_functions, NULL, Erlang_suffixes, NULL }, + { "fortran", Fortran_functions, NULL, Fortran_suffixes, NULL }, + { "java", Cjava_entries, NULL, Cjava_suffixes, NULL }, + { "lisp", Lisp_functions, NULL, Lisp_suffixes, NULL }, + { "makefile", Makefile_targets, Makefile_filenames, NULL, NULL }, + { "pascal", Pascal_functions, NULL, Pascal_suffixes, NULL }, + { "perl", Perl_functions, NULL, Perl_suffixes, Perl_interpreters }, + { "postscript", Postscript_functions, NULL, Postscript_suffixes, NULL }, + { "proc", plain_C_entries, NULL, plain_C_suffixes, NULL }, + { "prolog", Prolog_functions, NULL, Prolog_suffixes, NULL }, + { "python", Python_functions, NULL, Python_suffixes, NULL }, + { "scheme", Scheme_functions, NULL, Scheme_suffixes, NULL }, + { "tex", TeX_commands, NULL, TeX_suffixes, NULL }, + { "texinfo", Texinfo_nodes, NULL, Texinfo_suffixes, NULL }, + { "yacc", Yacc_entries, NULL, Yacc_suffixes, NULL }, { "auto", NULL }, /* default guessing scheme */ { "none", just_read_file }, /* regexp matching only */ { NULL, NULL } /* end of list */ @@ -988,7 +994,7 @@ break; case 'l': { - language *lang = get_language_from_name (optarg); + language *lang = get_language_from_langname (optarg); if (lang != NULL) { argbuffer[current_arg].lang = lang; @@ -1251,7 +1257,7 @@ * Return a language given the name. */ static language * -get_language_from_name (name) +get_language_from_langname (name) char *name; { language *lang; @@ -1297,12 +1303,20 @@ * Return a language given the file name. */ static language * -get_language_from_suffix (file) +get_language_from_filename (file) char *file; { language *lang; - char **ext, *suffix; - + char **name, **ext, *suffix; + + /* Try whole file name first. */ + for (lang = lang_names; lang->name != NULL; lang++) + if (lang->filenames != NULL) + for (name = lang->filenames; *name != NULL; name++) + if (streq (*name, file)) + return lang; + + /* If not found, try suffix after last dot. */ suffix = etags_strrchr (file, '.'); if (suffix == NULL) return NULL; @@ -1530,7 +1544,7 @@ } /* Try to guess the language given the file name. */ - lang = get_language_from_suffix (file); + lang = get_language_from_filename (file); if (lang != NULL && lang->function != NULL) { curlang = lang; @@ -1575,7 +1589,7 @@ /* Try Fortran. */ old_last_node = last_node; - curlang = get_language_from_name ("fortran"); + curlang = get_language_from_langname ("fortran"); Fortran_functions (inf); /* No Fortran entries found. Try C. */ @@ -1584,7 +1598,7 @@ /* We do not tag if rewind fails. Only the file name will be recorded in the tags file. */ rewind (inf); - curlang = get_language_from_name (cplusplus ? "c++" : "c"); + curlang = get_language_from_langname (cplusplus ? "c++" : "c"); default_C_entries (inf); } return; @@ -3854,6 +3868,27 @@ } } +/* + * Makefile support + */ +static void +Makefile_targets (inf) + FILE *inf; +{ + register char *bp; + + LOOP_ON_INPUT_LINES (inf, lb, bp) + { + if (*bp == '\t' || *bp == '#') + continue; + while (*bp != '\0' && *bp != '=' && *bp != ':') + bp++; + if (*bp == ':') + pfnote (savenstr (lb.buffer, bp - lb.buffer), TRUE, + lb.buffer, bp - lb.buffer + 1, lineno, linecharno); + } +} + /* Added by Mosur Mohan, 4/22/88 */ /* Pascal parsing */ @@ -4239,7 +4274,7 @@ * TeX/LaTeX scanning loop. */ static void -TeX_functions (inf) +TeX_commands (inf) FILE *inf; { char *cp, *lasthit; @@ -4391,23 +4426,24 @@ /* Texinfo support. Dave Love, Mar. 2000. */ static void -Texinfo_functions (inf) +Texinfo_nodes (inf) FILE * inf; { char *cp, *start; LOOP_ON_INPUT_LINES (inf, lb, cp) { - if ((*cp++ == '@' && *cp++ == 'n' && *cp++ == 'o' && *cp++ == 'd' - && *cp++ == 'e' && iswhite (*cp++))) + if ((*cp++ == '@' + && *cp++ == 'n' + && *cp++ == 'o' + && *cp++ == 'd' + && *cp++ == 'e' && iswhite (*cp++))) { - while (iswhite (*cp)) - cp++; - start = cp; - while (*cp != '\0' && *cp != ',') - cp++; - pfnote (savenstr (start, cp - start), TRUE, - lb.buffer, cp - lb.buffer + 1, lineno, linecharno); - } + start = cp = skip_spaces(cp); + while (*cp != '\0' && *cp != ',') + cp++; + pfnote (savenstr (start, cp - start), TRUE, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + } } } @@ -4859,7 +4895,7 @@ return; } *cp = '\0'; - lang = get_language_from_name (lang_name); + lang = get_language_from_langname (lang_name); if (lang == NULL) return; add_regex (cp + 1, ignore_case, lang); @@ -5490,8 +5526,8 @@ { #ifdef DOS_NT /* Canonicalize drive letter case. */ - if (fn[0] && fn[1] == ':' && ISLOWER (fn[0])) - fn[0] = UPCASE (fn[0]); + if (fn[0] != '\0' && fn[1] == ':' && ISLOWER (fn[0])) + fn[0] = upcase (fn[0]); /* Convert backslashes to slashes. */ for (; *fn != '\0'; fn++) if (*fn == '\\') diff -r 13441490c2f3 -r e268b7b500f0 man/programs.texi --- a/man/programs.texi Sun Jan 14 19:26:14 2001 +0000 +++ b/man/programs.texi Sun Jan 14 20:48:05 2001 +0000 @@ -1989,6 +1989,9 @@ In Fortran code, functions, subroutines and blockdata are tags. @item +In makefiles, targets are tags. + +@item In Objective C code, tags include Objective C definitions for classes, class categories, methods, and protocols.