emacs-devel
[Top][All Lists]
Advanced

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

Re: patch: add-log.el: changelog find file under point


From: martin rudalics
Subject: Re: patch: add-log.el: changelog find file under point
Date: Fri, 22 Feb 2008 20:26:06 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

>     That was my idea when I wrote local-tags.el - presently imenu is useless
>     for C.
>
> That is surprising, because it worked in the past.
> Can you describe the problem more specifically?
> Post a test case?

Consider the Emacs src directory.  data.c gets me some 100 entries
called "DEFUN", nine called "usage:" and things like "GLOBAL" "in" "nil"
"therefore" "or" (from the ...or (at your option)... header)) "pair"
"zero" in addition to say 20 "useful" entries.  buffer.c gets me some 30
"as" three "element" seven "entry", ...  For these files one out of
three entries created by `imenu-create-index-function' makes sense.
Moreover, I don't know how to make imenu list global variables in a
consistent way or macro definitions but maybe I'm missing something
here.

>       It seems, however, that hardly anyone uses imenu (which-func,
>     speedbar tags, ...) together with C mode - at least on this list.  Hence
>     we can probably leave things as they are ;-)
>
> We don't abandon a combination of features just because it has
> a bug.  We fix it!

We'd have to make imenu aware of Emacs' special "DEFUN" semantics -
probably simple.  We'd have to parse the buffer's syntax in order to
skip matches in comments and strings.  Simple as well, but will slow
down menu generation and additionally hardened by the fact that
`imenu--generic-function' scans the buffer backwards.  Finally, we
should fix variable, macro, enum, union definitions ...

Since no one complained until now I'm not sure whether this should be
done the hard way - `cc-imenu-c++-generic-expression' seems a quite
fragile regexp - so we'll hardly get much feedback when we change this.
It would be far simpler to get tags frome etags and have imenu use them.





reply via email to

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