unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* I have a dream... about tags
@ 2007-09-04 10:57 Nordlöw
  2007-09-04 13:39 ` Scott Frazer
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nordlöw @ 2007-09-04 10:57 UTC (permalink / raw)
  To: help-gnu-emacs

I have a dream...

I have been using gtags (GNU GLOBAL) for some time now. The problem
with gtags is that is does not handle C++ namespaces, that is you
can't lookup ClassName::member just by entering this language
construct from the minibuffer. etags can however do this. It also has
a rather annoying bug that makes the indexer skip inline functions in
files containing the standard construct
#ifdef __cplusplus
extern "C" {
#endif
I have already contacted the maintainer of GNU GLOBAL about this
problem, but it seems like other todos are more imporant.

etags can however lookup such ClassName::member C++ constructs, which
is great. But, for what I have seen, etags has other deficiencies. It
doesn't handle lookups of symbols that have multiple definitions
(occur multiple times and/or in different files/functions). Nor does
it index static variables. I also haven't found a way to lookup all
uses (calls) of a structure, variable or function, which gtags can do.

Has anyone else also found these problems annoying, and perhaps found
some solutions to them? Are there alternatives to etags or gtags that
solves these problems?

Personally, what I really think Emacs needs is a unified way to reach
*all* parts of your content in your project, regardless of whether
they occur multiple times, are static in C, private in C++, etc. Al
this should be reachable from a single interaction in the minibuffer,
of course with completion. These are the main categories of patterns
that I thinks should be possible to enter in my unified version of
find-tag that I am day-dreaming about:

C_Struct::struct_member_x
C_Union::union_member_x
C_Enum::enum_member_x

Cpp_class::member_function()

<some-file.h>::function_declaration()
<some-file.h>::inline_function_definition()
<some-file.c>::function_definition()
<some-file.c>::function_definition()::local_variable
<first-file.c>::commonly_named_global_variable
<second-file.c>::commonly_named_global_variable

As you can see the scope operator :: is thereby also used to reach
file- and/or function- local content.

I have a dream...

Thanks,
Nordlöw

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: I have a dream... about tags
  2007-09-04 10:57 I have a dream... about tags Nordlöw
@ 2007-09-04 13:39 ` Scott Frazer
  2007-09-04 15:49 ` Tom Tromey
  2007-09-04 20:17 ` Eli Zaretskii
  2 siblings, 0 replies; 4+ messages in thread
From: Scott Frazer @ 2007-09-04 13:39 UTC (permalink / raw)
  To: help-gnu-emacs

Nordlöw wrote:
> I have a dream...
> 
> I have been using gtags (GNU GLOBAL) for some time now. The problem
> with gtags is that is does not handle C++ namespaces, that is you
> can't lookup ClassName::member just by entering this language
> construct from the minibuffer.

[snip]

> etags can however lookup such ClassName::member C++ constructs, which
> is great. But, for what I have seen, etags has other deficiencies. It
> doesn't handle lookups of symbols that have multiple definitions
> (occur multiple times and/or in different files/functions).

Sure it does.  Besides tags-loop-continue, see:

http://www.emacswiki.org/cgi-bin/wiki/EtagsSelect

> Nor does it index static variables.

Try using this, it's much more thorough:

http://ctags.sourceforge.net/

> I also haven't found a way to lookup all
> uses (calls) of a structure, variable or function, which gtags can do.

I find recursive grep good enough for that.

> Has anyone else also found these problems annoying, and perhaps found
> some solutions to them? Are there alternatives to etags or gtags that
> solves these problems?
> 
> Personally, what I really think Emacs needs is a unified way to reach
> *all* parts of your content in your project, regardless of whether
> they occur multiple times, are static in C, private in C++, etc. Al
> this should be reachable from a single interaction in the minibuffer,
> of course with completion. These are the main categories of patterns
> that I thinks should be possible to enter in my unified version of
> find-tag that I am day-dreaming about:
> 
> C_Struct::struct_member_x
> C_Union::union_member_x
> C_Enum::enum_member_x
> 
> Cpp_class::member_function()
> 
> <some-file.h>::function_declaration()
> <some-file.h>::inline_function_definition()
> <some-file.c>::function_definition()
> <some-file.c>::function_definition()::local_variable
> <first-file.c>::commonly_named_global_variable
> <second-file.c>::commonly_named_global_variable
> 
> As you can see the scope operator :: is thereby also used to reach
> file- and/or function- local content.
> 
> I have a dream...

Try the above suggestions, maybe you can get close enough :)

Scott

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: I have a dream... about tags
  2007-09-04 10:57 I have a dream... about tags Nordlöw
  2007-09-04 13:39 ` Scott Frazer
@ 2007-09-04 15:49 ` Tom Tromey
  2007-09-04 20:17 ` Eli Zaretskii
  2 siblings, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2007-09-04 15:49 UTC (permalink / raw)
  To: help-gnu-emacs

>>>>> "Nordlöw" == Nordlöw  <per.nordlow@gmail.com> writes:

Nordlöw> Has anyone else also found these problems annoying, and
Nordlöw> perhaps found some solutions to them? Are there alternatives
Nordlöw> to etags or gtags that solves these problems?

Lately I've been using GNU idutils for some of my needs in this area.
idutils is not really tagging, it is more like full-text indexing for
programs.  idutils doesn't do incremental updates of the ID file
(bad), but it is smart about only searching for full identifiers, and
it is much, much faster than a grep.

You might also be interested in CEDET.

Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: I have a dream... about tags
  2007-09-04 10:57 I have a dream... about tags Nordlöw
  2007-09-04 13:39 ` Scott Frazer
  2007-09-04 15:49 ` Tom Tromey
@ 2007-09-04 20:17 ` Eli Zaretskii
  2 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2007-09-04 20:17 UTC (permalink / raw)
  To: help-gnu-emacs

> From: =?iso-8859-1?B?Tm9yZGz2dw==?= <per.nordlow@gmail.com>
> Date: Tue, 04 Sep 2007 10:57:24 -0000
> 
> etags can however lookup such ClassName::member C++ constructs, which
> is great. But, for what I have seen, etags has other deficiencies. It
> doesn't handle lookups of symbols that have multiple definitions
> (occur multiple times and/or in different files/functions). Nor does
> it index static variables. I also haven't found a way to lookup all
> uses (calls) of a structure, variable or function, which gtags can do.
> 
> Has anyone else also found these problems annoying, and perhaps found
> some solutions to them? Are there alternatives to etags or gtags that
> solves these problems?

One alternative, specifically designed for C++, is ebrowse, which
comes with Emacs.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-09-04 20:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-04 10:57 I have a dream... about tags Nordlöw
2007-09-04 13:39 ` Scott Frazer
2007-09-04 15:49 ` Tom Tromey
2007-09-04 20:17 ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).