GNU bug report logs - #5600
23.1; etags don't tag (defvar foo) declaration

Previous Next

Package: emacs;

Reported by: Kevin Ryde <user42 <at> zip.com.au>

Date: Fri, 19 Feb 2010 00:03:01 UTC

Severity: normal

Tags: patch

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Francesco Potortì <pot <at> gnu.org>
To: Kevin Ryde <user42 <at> zip.com.au>
Cc: bug-gnu-emacs <at> gnu.org, owner <at> debbugs.gnu.org, 5600 <at> debbugs.gnu.org
Subject: Re: bug#5600: 23.1; etags don't tag (defvar foo) declaration
Date: Fri, 19 Feb 2010 10:32:05 +0100
>I found the tripe-negative of while(!noninname) hard to follow and
>thought a skip_name() could be clearer.  It might be shared by
>Perl_functions, PHP_functions and Makefile_functions.

Yes, but the helper should go together with the other helper funciotns
(right after skip_non_spaces) and be declared at the beginning after
skip_non_spaces.

>
>2010-02-18  Kevin Ryde  <user42 <at> zip.com.au>
>
>	* etags.c (Lisp_functions): Don't tag "(defvar foo)" declarations.
>	(skip_name): New helper.
>
>--- 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);
>
>
>
>In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5)
> of 2009-09-14 on raven, modified by Debian
>configured using `configure  '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''





This bug report was last modified 12 years and 174 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.