GNU bug report logs -
#5600
23.1; etags don't tag (defvar foo) declaration
Previous Next
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.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 5600 in the body.
You can then email your comments to 5600 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#5600
; Package
emacs
.
(Fri, 19 Feb 2010 00:03:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Kevin Ryde <user42 <at> zip.com.au>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Fri, 19 Feb 2010 00:03:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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 <user42 <at> zip.com.au>
* etags.c (Lisp_functions): Don't tag "(defvar foo)" declarations.
(skip_name): New helper.
[etags.c.defvar.diff (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]
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=''
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#5600
; Package
emacs
.
(Fri, 19 Feb 2010 11:11:02 GMT)
Full text and
rfc822 format available.
Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):
>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.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#5600
; Package
emacs
.
(Fri, 19 Feb 2010 11:11:02 GMT)
Full text and
rfc822 format available.
Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):
>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=''
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#5600
; Package
emacs
.
(Fri, 19 Feb 2010 11:11:03 GMT)
Full text and
rfc822 format available.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#5600
; Package
emacs
.
(Fri, 19 Feb 2010 11:11:03 GMT)
Full text and
rfc822 format available.
Information forwarded
to
owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#5600
; Package
emacs
.
(Sat, 20 Feb 2010 00:07:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 5600 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Francesco Potortì <pot <at> gnu.org> 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 <user42 <at> zip.com.au>
* etags.c (skip_name): New helper.
(Lisp_functions): Tag "(defvar foo)" only under --declarations.
(Lisp_help): Describe this --declarations.
2010-02-19 Kevin Ryde <user42 <at> zip.com.au>
* maintaining.texi (Tag Syntax): Add Lisp --declarations for
(defvar foo).
2010-02-19 Kevin Ryde <user42 <at> zip.com.au>
* doc/man/etags.1 (--declarations): Add Lisp (defvar foo).
[etags.c.defvar-2.diff (text/x-diff, attachment)]
[maintaining.texi.defvar-2.diff (text/x-diff, attachment)]
[etags.1.defvar-2.diff (text/x-diff, attachment)]
bug reassigned from package 'emacs' to 'emacs,etags'.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Sun, 21 Feb 2010 01:51:02 GMT)
Full text and
rfc822 format available.
Added tag(s) patch.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Mon, 22 Feb 2010 18:02:01 GMT)
Full text and
rfc822 format available.
Reply sent
to
Chong Yidong <cyd <at> gnu.org>
:
You have taken responsibility.
(Sun, 02 Dec 2012 01:52:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Kevin Ryde <user42 <at> zip.com.au>
:
bug acknowledged by developer.
(Sun, 02 Dec 2012 01:52:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 5600-done <at> debbugs.gnu.org (full text, mbox):
Kevin Ryde <user42 <at> zip.com.au> 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.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 30 Dec 2012 12:24:03 GMT)
Full text and
rfc822 format available.
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.