emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

etags format question


From: vr . sundar
Subject: etags format question
Date: Fri, 2 Jan 2009 09:09:13 -0800

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^?::ModA::ClassA^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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]