* etags format question
@ 2009-01-02 17:09 vr.sundar
2009-01-04 21:44 ` Francesco Potortì
0 siblings, 1 reply; 2+ messages in thread
From: vr.sundar @ 2009-01-02 17:09 UTC (permalink / raw
To: emacs-devel
Hi,
I have a question regarding etags format and tags processing in
etags.el. The etags format per the wikipedia entry
http://en.wikipedia.org/wiki/Ctags is:
{tag_definition_text}<\x7f>{tagname}<\x01>{line_number},{byte_offset}
Should the current tag text being looked for be a substring of the
tag_definition_text or is it enough if it is a substring of tagname?
I'm trying to set things up for ruby code to be able to jump to the
right class taking module namespace into account. I used rtags to
generate the tags (etags doesn't list ruby in the list of supported
languages, ctags generates tags but doesn't qualify them with the
module name.) The problem is when I hit M-. and type in ModA::ClassA I
get back a no tag found, even though if I open up the tag file, I can
see multiple instances of ModA::ClassA. And the tag is found if I just
type ClassA though in this case it finds all the matches in other
modules too. rtags generates tags like this:
class A^?\x7f::ModA::ClassA\x01^A13,317
(where ^? == \x7f and ^A ==\x01, tag_definition_text == class A and
tagname == ModA::ClassA)
It looks the search_forward finds the tag but the qualification using
the 8 order functions fails. (This is in find-tag-in-order in
etags.el). Of the 8 order functions, I expected the last one -
tag-any-match-p - to match. But it expects \177 (== \x7f) to be after
the point where the tag matched.
;; t if point is in a tag line with a tag containing TAG as a substring.
(defun tag-any-match-p (tag)
"Return non-nil if current tag line contains TAG as a substring."
(looking-at ".*\177"))
In my case, the text being searched for is ModA::ClassA and matches
not the tag_definition_text (which has a \x7f after it) but the
tagname and I think it fails because of this. Is my understanding
right or am I missing something? Does the tag being searched for have
to be part of the actual text and not just the generated tagname? If
so why? Shouldn't match-any-p match it if it is part of the text or
the tagname? How is this handled for example with c++ where you could
qualify a method with the class name and jump to the right method
using tags?
This is my first foray into looking at (e)lisp code though I've been
using emacs for a few months now. Any comments or pointers on this is
much appreciated.
thanks
sundar
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: etags format question
2009-01-02 17:09 etags format question vr.sundar
@ 2009-01-04 21:44 ` Francesco Potortì
0 siblings, 0 replies; 2+ messages in thread
From: Francesco Potortì @ 2009-01-04 21:44 UTC (permalink / raw
To: vr.sundar; +Cc: emacs-devel
>I have a question regarding etags format and tags processing in
>etags.el. The etags format per the wikipedia entry
>http://en.wikipedia.org/wiki/Ctags is:
>
> {tag_definition_text}<\x7f>{tagname}<\x01>{line_number},{byte_offset}
>
>Should the current tag text being looked for be a substring of the
>tag_definition_text or is it enough if it is a substring of tagname?
There is a series of matches tried. Look at the find-tag-tag-order in
etags.el. The tagname is the exact symbol one is looking for. Have a
look at etc/ETAGS.EBNF too, and feel free to ask for more clarifications.
>I'm trying to set things up for ruby code to be able to jump to the
>right class taking module namespace into account. I used rtags to
>generate the tags (etags doesn't list ruby in the list of supported
>languages, ctags generates tags but doesn't qualify them with the
>module name.) The problem is when I hit M-. and type in ModA::ClassA I
>get back a no tag found, even though if I open up the tag file, I can
>see multiple instances of ModA::ClassA. And the tag is found if I just
>type ClassA though in this case it finds all the matches in other
>modules too. rtags generates tags like this:
>
>class A^?\x7f::ModA::ClassA\x01^A13,317
No, you should have something like
class A (^?ModA::ClassA^A13,317
try to use etags on a C++ file and look at what it produces.
By the way, maybe Ruby code could be tagged by etags as a special case
of C++ handling? Java is managed this way, but I do not know how near
Ruby is to C++/Java.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-01-04 21:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-02 17:09 etags format question vr.sundar
2009-01-04 21:44 ` Francesco Potortì
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.