From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 18 19:02:06 2010 Received: (at submit) by debbugs.gnu.org; 19 Feb 2010 00:02:06 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NiGJq-0000pz-43 for submit@debbugs.gnu.org; Thu, 18 Feb 2010 19:02:06 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NiGJo-0000pZ-DF for submit@debbugs.gnu.org; Thu, 18 Feb 2010 19:02:05 -0500 Received: from mail.gnu.org ([199.232.76.166]:36223 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NiGJk-0000RC-In for submit@debbugs.gnu.org; Thu, 18 Feb 2010 19:02:00 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NiGIz-0004Wf-1b for submit@debbugs.gnu.org; Thu, 18 Feb 2010 19:01:14 -0500 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on monty-python X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO,UNPARSEABLE_RELAY autolearn=ham version=3.1.0 Received: from lists.gnu.org ([199.232.76.165]:57689) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NiGIy-0004WZ-SQ for submit@debbugs.gnu.org; Thu, 18 Feb 2010 19:01:12 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NiGIy-0005q3-FV for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2010 19:01:12 -0500 Received: from [140.186.70.92] (port=51836 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NiGIs-0005pj-Qq for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2010 19:01:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NiGIn-0001ul-L1 for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2010 19:01:06 -0500 Received: from mailout1-14.pacific.net.au ([125.255.80.133]:42456 helo=mailout1.pacific.net.au) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NiGIn-0001uX-2g for bug-gnu-emacs@gnu.org; Thu, 18 Feb 2010 19:01:01 -0500 Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout1.pacific.net.au (Postfix) with ESMTP id 0D71152DD1E for ; Fri, 19 Feb 2010 11:00:57 +1100 (EST) Received: from blah.blah (ppp24EF.dyn.pacific.net.au [61.8.36.239]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 0EF4027420 for ; Fri, 19 Feb 2010 11:00:56 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.71) (envelope-from ) id 1NiGIS-0000hZ-NF for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2010 11:00:40 +1100 From: Kevin Ryde To: bug-gnu-emacs@gnu.org Subject: 23.1; etags don't tag (defvar foo) declaration Date: Fri, 19 Feb 2010 11:00:40 +1100 Message-ID: <87mxz6ayc7.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.4 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.5 (-----) --=-=-= It'd be good if etags didn't tag defvar declaration forms, only actual variable definitions. For example it picks up (defvar message-indent-citation-function) in longlines.el ahead of that variable's actual definition in message.el, so M-. of that var goes to longlines.el first. Perhaps something along the lines below. 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. 2010-02-18 Kevin Ryde * etags.c (Lisp_functions): Don't tag "(defvar foo)" declarations. (skip_name): New helper. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=etags.c.defvar.diff --- 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='' --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 19 06:10:44 2010 Received: (at submit) by debbugs.gnu.org; 19 Feb 2010 11:10:47 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NiQku-0000PI-80 for submit@debbugs.gnu.org; Fri, 19 Feb 2010 06:10:44 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NiP7G-0007h5-AL for submit@debbugs.gnu.org; Fri, 19 Feb 2010 04:25:42 -0500 Received: from mx10.gnu.org ([199.232.76.166]:58158) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NiP7D-0007kV-Js for submit@debbugs.gnu.org; Fri, 19 Feb 2010 04:25:39 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NiP7A-00026O-8J for submit@debbugs.gnu.org; Fri, 19 Feb 2010 04:25:38 -0500 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on monty-python X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.1.0 Received: from lists.gnu.org ([199.232.76.165]:59825) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NiP79-00026B-DT for submit@debbugs.gnu.org; Fri, 19 Feb 2010 04:25:35 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NiP78-00032Z-FP for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2010 04:25:34 -0500 Received: from [140.186.70.92] (port=36220 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NiP77-00031u-8D for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2010 04:25:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NiP73-0001Ej-Sg for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2010 04:25:32 -0500 Received: from mx2.isti.cnr.it ([194.119.192.4]:2545) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NiP73-0001ER-Nj for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2010 04:25:29 -0500 Received: from conversionlocal.isti.cnr.it by mx.isti.cnr.it (PMDF V6.5-b2 #31825) id <01NJUDJL50LSBF2BYI@mx.isti.cnr.it> for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2010 10:25:02 +0100 Received: from tucano.isti.cnr.it (tucano.isti.cnr.it [146.48.81.102]) by mx.isti.cnr.it (PMDF V6.5-b2 #31826) with ESMTPSA id <01NJUDJIZ20YBJSE3W@mx.isti.cnr.it>; Fri, 19 Feb 2010 10:25:00 +0100 (MET) Received: from pot by tucano.isti.cnr.it with local (Exim 4.71) (envelope-from ) id 1NiP6b-0000lu-2U; Fri, 19 Feb 2010 10:25:01 +0100 Date: Fri, 19 Feb 2010 10:25:01 +0100 From: Francesco =?utf-8?Q?Potort=C3=AC?= Subject: Re: bug#5600: 23.1; etags don't tag (defvar foo) declaration In-reply-to: <87mxz6ayc7.fsf@blah.blah> To: Kevin Ryde Message-id: Organization: X-INSM-ip-source: 146.48.81.102 Auth Done X-fingerprint: 4B02 6187 5C03 D6B1 2E31 7666 09DF 2DC9 BE21 6115 References: <87mxz6ayc7.fsf@blah.blah> X-detected-operating-system: by eggs.gnu.org: OpenVMS 7.2 (Multinet 4.3-4.4 stack) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 19 Feb 2010 06:10:41 -0500 Cc: bug-gnu-emacs@gnu.org, owner@debbugs.gnu.org, 5600@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.3 (-----) >It'd be good if etags didn't tag defvar declaration forms, only actual >variable definitions. Lisp_functions should distinguish between defvar and other (def* constructs, and tag the former only if --declarations. Would you consider a different patch that looks at the declarations global variable and distinguishes among "(defvar" and other "(def" contructs? Such a change would reuire to be reflected in the help strings, the man page and the info docs. I can do that myself, but I cannot guarantee a deadline earlier than some weeks from now. >I found the tripe-negative of while(!noninname) hard to follow and >thought a skip_name() could be clearer. I agree. From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 19 06:10:45 2010 Received: (at submit) by debbugs.gnu.org; 19 Feb 2010 11:10:47 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NiQkv-0000PQ-2H for submit@debbugs.gnu.org; Fri, 19 Feb 2010 06:10:45 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NiPDz-0007nX-9N for submit@debbugs.gnu.org; Fri, 19 Feb 2010 04:32:39 -0500 Received: from mail.gnu.org ([199.232.76.166]:58482 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NiPDw-00084v-Ht for submit@debbugs.gnu.org; Fri, 19 Feb 2010 04:32:36 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NiPDu-0002jo-Ov for submit@debbugs.gnu.org; Fri, 19 Feb 2010 04:32:36 -0500 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on monty-python X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00, UNPARSEABLE_RELAY autolearn=ham version=3.1.0 Received: from lists.gnu.org ([199.232.76.165]:54750) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NiPDu-0002jP-Ie for submit@debbugs.gnu.org; Fri, 19 Feb 2010 04:32:34 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NiPDu-0005si-1e for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2010 04:32:34 -0500 Received: from [140.186.70.92] (port=34684 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NiPDt-0005rx-6X for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2010 04:32:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NiPDr-0002Ax-8A for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2010 04:32:32 -0500 Received: from blade3.isti.cnr.it ([194.119.192.19]:56294) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NiPDr-0002Al-1P for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2010 04:32:31 -0500 Received: from conversionlocal.isti.cnr.it by mx.isti.cnr.it (PMDF V6.5-b2 #31825) id <01NJUDSC8XGGBG35B8@mx.isti.cnr.it> for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2010 10:32:06 +0100 Received: from tucano.isti.cnr.it (tucano.isti.cnr.it [146.48.81.102]) by mx.isti.cnr.it (PMDF V6.5-b2 #31826) with ESMTPSA id <01NJUDSAP4A0BJSE3W@mx.isti.cnr.it>; Fri, 19 Feb 2010 10:32:04 +0100 (MET) Received: from pot by tucano.isti.cnr.it with local (Exim 4.71) (envelope-from ) id 1NiPDR-0000nM-BZ; Fri, 19 Feb 2010 10:32:05 +0100 Date: Fri, 19 Feb 2010 10:32:05 +0100 From: Francesco =?utf-8?Q?Potort=C3=AC?= Subject: Re: bug#5600: 23.1; etags don't tag (defvar foo) declaration In-reply-to: <87mxz6ayc7.fsf@blah.blah> To: Kevin Ryde Message-id: Organization: X-INSM-ip-source: 146.48.81.102 Auth Done X-fingerprint: 4B02 6187 5C03 D6B1 2E31 7666 09DF 2DC9 BE21 6115 References: <87mxz6ayc7.fsf@blah.blah> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 19 Feb 2010 06:10:41 -0500 Cc: bug-gnu-emacs@gnu.org, owner@debbugs.gnu.org, 5600@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.3 (-----) >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 > > * 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='' From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 19 19:06:35 2010 Received: (at 5600) by debbugs.gnu.org; 20 Feb 2010 00:06:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nicrj-0001Cn-C7 for submit@debbugs.gnu.org; Fri, 19 Feb 2010 19:06:35 -0500 Received: from mailout2-2.pacific.net.au ([61.8.2.225] helo=mailout2.pacific.net.au) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nicrg-0001Ce-Ni for 5600@debbugs.gnu.org; Fri, 19 Feb 2010 19:06:34 -0500 Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout2.pacific.net.au (Postfix) with ESMTP id 245191F3CC7; Sat, 20 Feb 2010 11:06:28 +1100 (EST) Received: from blah.blah (ppp2048.dyn.pacific.net.au [61.8.32.72]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id 321B78C05; Sat, 20 Feb 2010 11:06:25 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.71) (envelope-from ) id 1NicrS-0001Ea-0D; Sat, 20 Feb 2010 11:06:18 +1100 From: Kevin Ryde To: Francesco =?iso-8859-1?Q?Potort=EC?= Subject: Re: bug#5600: 23.1; etags don't tag (defvar foo) declaration References: <87mxz6ayc7.fsf@blah.blah> Date: Sat, 20 Feb 2010 11:06:17 +1100 Message-ID: <87d400rcsm.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: 5600 Cc: 5600@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---) --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Francesco Potort=EC writes: > > Lisp_functions should distinguish between defvar and other (def* > constructs, and tag the former only if --declarations. Sounds likely. I didn't know about that option, new diff below. I suppose it could tag `declare-function' and the like too, but start with untagging the defvar ones. (The bloat of bizaar has made the tree inaccessible for me, so excuse three separate diff files.) 2010-02-19 Kevin Ryde * etags.c (skip_name): New helper. (Lisp_functions): Tag "(defvar foo)" only under --declarations. (Lisp_help): Describe this --declarations. 2010-02-19 Kevin Ryde * maintaining.texi (Tag Syntax): Add Lisp --declarations for (defvar foo). 2010-02-19 Kevin Ryde * doc/man/etags.1 (--declarations): Add Lisp (defvar foo). --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=etags.c.defvar-2.diff --- etags.c.~3.93.~ 2009-11-29 08:42:32.000000000 +1100 +++ etags.c 2010-02-20 10:14:45.000000000 +1100 @@ -433,6 +433,7 @@ static char *concat __P((char *, char *, char *)); static char *skip_spaces __P((char *)); static char *skip_non_spaces __P((char *)); +static char *skip_name __P((char *)); static char *savenstr __P((char *, int)); static char *savestr __P((char *)); static char *etags_strchr __P((const char *, int)); @@ -699,7 +700,9 @@ "In Lisp code, any function defined with `defun', any variable\n\ defined with `defvar' or `defconst', and in general the first\n\ argument of any expression that starts with `(def' in column zero\n\ -is a tag."; +is a tag.\n\ +`--declarations' tags declarations \"(defvar foo)\" as well as\n\ +definitions."; static char *Lua_suffixes [] = { "lua", "LUA", NULL }; @@ -4858,6 +4861,19 @@ if (dbp[0] != '(') continue; + /* "(defvar foo)" is a declaration rather than a definition. + ENHANCE-ME: Maybe also Elisp (declare-function funcname ...), + and/or CL and Elisp (declare (special varname)), or (proclaim). */ + if (! declarations) { + 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); @@ -6510,6 +6526,16 @@ cp++; return cp; } + +/* Skip past any chars at cp which are "name" class, meaning not notinname().*/ +static char * +skip_name (char *cp) +{ + /* '\0' is a notinname() so loop stops there too */ + while (! notinname (*cp)) + cp++; + return cp; +} /* Print error message and exit. */ void --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=maintaining.texi.defvar-2.diff --- maintaining.texi.~1.22.~ 2009-11-29 08:42:21.000000000 +1100 +++ maintaining.texi 2010-02-20 10:32:11.000000000 +1100 @@ -1593,7 +1593,8 @@ In Lisp code, any function defined with @code{defun}, any variable defined with @code{defvar} or @code{defconst}, and in general the first argument of any expression that starts with @samp{(def} in column zero is -a tag. +a tag. The @option{--declarations} option tags declarations +@code{(defvar foo)} as well as definitions. @item In Scheme code, tags include anything defined with @code{def} or with a --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=etags.1.defvar-2.diff --- etags.1.~1.8.~ 2009-01-12 11:01:43.000000000 +1100 +++ etags.1 2010-02-20 10:28:25.000000000 +1100 @@ -88,6 +88,8 @@ .B \-\-declarations In C and derived languages, create tags for function declarations, and create tags for extern variables unless \-\-no\-globals is used. + +In Lisp, create tags for declarations (defvar foo). .TP .B \-D, \-\-no\-defines Do not create tag entries for C preprocessor constant definitions --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 20 20:50:42 2010 Received: (at control) by debbugs.gnu.org; 21 Feb 2010 01:50:42 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nj0y1-0004Dc-PX for submit@debbugs.gnu.org; Sat, 20 Feb 2010 20:50:41 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nj0y0-0004DS-2p for control@debbugs.gnu.org; Sat, 20 Feb 2010 20:50:40 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1Nj0xw-0003op-D3; Sat, 20 Feb 2010 20:50:36 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19328.37228.29058.714767@fencepost.gnu.org> Date: Sat, 20 Feb 2010 20:50:36 -0500 From: Glenn Morris To: control Subject: control X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: yellow X-Ran: cQqW3\v.J&L List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) merge 5613 5614 merge 5611 5612 close 5514 tags 5594 moreinfo reassign 5594 emacs,rmail close 5569 tags 5567 patch tags 5604 moreinfo retitle 5604 highlight completion problem reassign 5605 emacs,etags reassign 5600 emacs,etags From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 22 13:01:36 2010 Received: (at control) by debbugs.gnu.org; 22 Feb 2010 18:01:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NjcbA-0003MI-0y for submit@debbugs.gnu.org; Mon, 22 Feb 2010 13:01:36 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Njcb8-0003M8-7s for control@debbugs.gnu.org; Mon, 22 Feb 2010 13:01:34 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1Njcb3-0002D2-QL; Mon, 22 Feb 2010 13:01:29 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19330.50809.741451.244204@fencepost.gnu.org> Date: Mon, 22 Feb 2010 13:01:29 -0500 From: Glenn Morris To: control Subject: control X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: black X-Ran: )wwTLG?}&#+)F@V/%`]L^X?-8Q,9@$"V:#L$C*4&Fm1&_G-ny&c[4&!(Wt+MW\ X-Debbugs-No-Ack: yes X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) close 5594 tags 5619 moreinfo reassign 5619 emacs,calendar unmerge 5614 tags 5600 patch tags 5607 patch reassign 5617 emacs,calc severity 5618 minor From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 01 20:51:35 2012 Received: (at 5600-done) by debbugs.gnu.org; 2 Dec 2012 01:51:35 +0000 Received: from localhost ([127.0.0.1]:48962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TeyiU-000459-9R for submit@debbugs.gnu.org; Sat, 01 Dec 2012 20:51:34 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:33086) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TeyiS-000452-8q for 5600-done@debbugs.gnu.org; Sat, 01 Dec 2012 20:51:33 -0500 Received: by mail-pa0-f44.google.com with SMTP id hz11so1078224pad.3 for <5600-done@debbugs.gnu.org>; Sat, 01 Dec 2012 17:49:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=ZuTQ8Z/eN7WKtLobpCNo33a8gA23vd6+8cuoWu1UkDQ=; b=lg7bP/RmUNiO0zYaZtvI5pHkepJ8tdy5oAaFwURmt5wH0cT/Ix1X0LxlSWSs5YIf0g hrB6lmDnI74/zuWDMvK5YDKUoSVqnU2eJ191k+u2k/L13ZKB42LFJ5VXYk/wo72XXZ7O f6p7MXzgN29DKYr2CbikdpTt8SmUo38dCqEkMtoCJo/wTXlIrOW8njpBDixfrz4VAY2Q o6Mg5OOo+hO/2fsEuUrnuvJOf8xzArqU+3D4t2WpfS6fEbm56FUlTflA09yUMKGWrEQc wiKT+P/0NC7HELU5z0MnvSVHHXZh1jB2YOB8Fos5zPOXMKkI2cUNq3tKRhZ5jTLiMdkX I7rw== Received: by 10.68.191.200 with SMTP id ha8mr17788263pbc.51.1354412956523; Sat, 01 Dec 2012 17:49:16 -0800 (PST) Received: from ulysses (cm198.gamma83.maxonline.com.sg. [202.156.83.198]) by mx.google.com with ESMTPS id o10sm5474816paz.37.2012.12.01.17.49.12 (version=SSLv3 cipher=OTHER); Sat, 01 Dec 2012 17:49:15 -0800 (PST) From: Chong Yidong To: Kevin Ryde Subject: Re: bug#5600: 23.1; etags don't tag (defvar foo) declaration References: <87mxz6ayc7.fsf@blah.blah> <87d400rcsm.fsf@blah.blah> Date: Sun, 02 Dec 2012 09:49:10 +0800 In-Reply-To: <87d400rcsm.fsf@blah.blah> (Kevin Ryde's message of "Sat, 20 Feb 2010 11:06:17 +1100") Message-ID: <8738zp4415.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 5600-done Cc: Francesco =?utf-8?Q?Potort=C3=AC?= , 5600-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Kevin Ryde writes: > Sounds likely. I didn't know about that option, new diff below. > I suppose it could tag `declare-function' and the like too, but start > with untagging the defvar ones. I've now committed this patch to trunk. Thanks. From unknown Sat Jun 21 10:35:54 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 30 Dec 2012 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator