unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: martin rudalics <rudalics@gmx.at>, emacs-devel@gnu.org
Subject: Re: etags failing with structure members
Date: Sun, 12 Mar 2017 14:27:34 +0000	[thread overview]
Message-ID: <20170312142733.GB16532@acm> (raw)
In-Reply-To: <834lz0dpjp.fsf@gnu.org>

Hello, Eli.

On Sat, Mar 11, 2017 at 13:24:26 +0200, Eli Zaretskii wrote:
> > Date: Sat, 11 Mar 2017 11:27:48 +0100
> > From: martin rudalics <rudalics@gmx.at>
> > CC: emacs-devel@gnu.org

> >  > the tricky macro syntax used by some of the
> >  > header files run afoul of the etags parsing.  I tried once to find a
> >  > solution for that, I might look into this again.

> > Can you explain with a few words why the macro syntax interferes?

> They look like a beginning of a K&R style function definition:

>   foo (bar, baz)
>     type1 bar;
>     type2 baz;

> This tricks etags into the state where it looks for the end of the
> function, and ignores everything until that point.

> One possible remedy would be to teach etags about the special macro
> ENUM_BF; I will look into that when I have time.  But there's trickier
> stuff in lisp.h that won't be helped even by that.

For what it's worth, CC Mode also suffers from K&R declarations.  It's a
shame that K and R didn't get this right in the initial version of C,
but considering everything, they did a splendid job.

CC Mode's current heuristic (see c-in-knr-argdecl in cc-engine.el) is to
check rigorously things like the absence of a ';' after the arglist, and
that the contents of the arglist is a simple comma separated list of
identifiers.  To solve a bug a year or two ago, it now also checks that
each identifier declared in the "k&r region" appears in the arglist.

I don't know how practical it would be to do all this in etags.

-- 
Alan Mackenzie (Nuremberg, Germany).



  parent reply	other threads:[~2017-03-12 14:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10  7:54 etags failing with structure members martin rudalics
2017-03-10  9:21 ` Eli Zaretskii
2017-03-11 10:27   ` martin rudalics
2017-03-11 11:24     ` Eli Zaretskii
2017-03-11 15:42       ` John Yates
2017-03-11 16:37         ` Eli Zaretskii
2017-03-12 14:27       ` Alan Mackenzie [this message]
2017-03-12 15:39       ` Eli Zaretskii
2017-03-12 18:03         ` martin rudalics
2017-03-12 18:09           ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=20170312142733.GB16532@acm \
    --to=acm@muc.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=rudalics@gmx.at \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).