all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
Cc: bug-gnu-emacs@gnu.org, Francesco Potorti` <pot@gnu.org>
Subject: Re: etags: function not indexed after macro
Date: Sat, 13 May 2006 11:00:34 +0300	[thread overview]
Message-ID: <u7j4q73rx.fsf@gnu.org> (raw)
In-Reply-To: <44644D18.3060604@zurich.ibm.com> (message from Roman Pletka on Fri, 12 May 2006 10:53:44 +0200)

> Date: Fri, 12 May 2006 10:53:44 +0200
> From: Roman Pletka <rap@zurich.ibm.com>
> 
> I tried to index the following code with etags:
> 
> #define DECLARE_TEST(name)      \
>         static int test_##name;
> 
> DECLARE_TEST(var)
> 
> 
> 
> void my_func(int i) {
>         test_var = i;
> }
> 
> void my_func2(int j) {
>         test_var = j;
> }
> 
> 
> It looks like etags does not create an entry for the my_func function because
> the closing semicolon is in the definition of the macro.

I think it's not because of the semicolon in the macro definition,
it's because the macro _invocation_ looks like a beginning of a
function (whose name is DECLARE_TEST), and thus etags regards the
definition of my_func as part of that function's body.

You can work around this by moving the semicolon from the macro
definition to its invocation:

    #define DECLARE_TEST(name)      \
	    static int test_##name

    DECLARE_TEST(var);

Which IMO is better C style anyway, and will probably help you
elsewhere, like with Emacs syntax highlighting and indentation.

> I am using etags that comes with GNU Emacs 21.4 (Debian emacs21
> 21.4a-3).

The same problem exists in the current development sources.  I don't
know if this can be easily fixed, but I cc Francesco who is the etags
maintainer.

Thanks for reporting this.

  reply	other threads:[~2006-05-13  8:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-12  8:53 etags: function not indexed after macro Roman Pletka
2006-05-13  8:00 ` Eli Zaretskii [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-05-23 11:11 Francesco Potorti`

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=u7j4q73rx.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=pot@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.