all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: vr.sundar <vr.sundar@gmail.com>
To: emacs-devel@gnu.org
Subject: etags format question
Date: Fri, 2 Jan 2009 09:09:13 -0800	[thread overview]
Message-ID: <63acfd6c0901020909j75a05bb8j2b3d6b19ab8e64ab@mail.gmail.com> (raw)

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




             reply	other threads:[~2009-01-02 17:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-02 17:09 vr.sundar [this message]
2009-01-04 21:44 ` etags format question Francesco Potortì

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=63acfd6c0901020909j75a05bb8j2b3d6b19ab8e64ab@mail.gmail.com \
    --to=vr.sundar@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.