--- etags.c.~3.93.~ 2009-11-29 08:42:32.000000000 +1100 +++ etags.c 2010-02-19 10:53:57.000000000 +1100 @@ -4849,6 +4849,16 @@ get_tag (dbp, NULL); } +/* skip past any chars at cp which are "name" class */ +static char * +skip_name (char *cp) +{ + /* '\0' is a notinname() so loop stops there too */ + while (! notinname (*cp)) + cp++; + return cp; +} + static void Lisp_functions (inf) FILE *inf; @@ -4858,6 +4868,17 @@ if (dbp[0] != '(') continue; + /* ignore declaration "(defvar foo)", it's not a definition */ + { + char *p = dbp+1; + if (LOOKING_AT (p, "defvar")) { + p = skip_name (p); /* past var name */ + p = skip_spaces (p); + if (*p == ')') + continue; + } + } + if (strneq (dbp+1, "def", 3) || strneq (dbp+1, "DEF", 3)) { dbp = skip_non_spaces (dbp);