emacs-devel
[Top][All Lists]
Advanced

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

Re: which-function deficiency in C mode caused by imenu


From: Sam Steingold
Subject: Re: which-function deficiency in C mode caused by imenu
Date: Sun, 25 Jun 2006 22:08:07 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> * Richard Stallman <address@hidden> [2006-06-24 04:31:26 -0400]:
>
>     which-function (and thus which-function-mode) does not determine the
>     "function name" correctly in the following common cases:
>
>     typedef struct foo {
>       int bar;
>
> Since which-function-mode uses the results of imenu, I think the first
> step is to see whether imenu parses that wrong.  Could you do that?

imenu produces largely garbage:

(("*Rescan*" . -99) ("strerror" . #<marker at 1229 in util.h>)
("DEBUG_WARN" . #<marker at 1307 in util.h>) ("int" . #<marker at 5029
in util.h>) ("int" . #<marker at 5071 in util.h>) ("int" . #<marker at
5113 in util.h>) ("int" . #<marker at 5155 in util.h>) ("void"
. #<marker at 5197 in util.h>) ("member" . #<marker at 5235 in util.h>)
("merge_sort" . #<marker at 5462 in util.h>) ("heap_sort" . #<marker at
5532 in util.h>) ("mapl" . #<marker at 6121 in util.h>))

for the file <http://www.podval.org/~sds/data/util.h>

specifically,

typedef struct list_t {
  struct list_t *next;
  void *data;
} List_t;

is not represented.

>     typedef struct {
>       int bar;
>       char* baz;
>     } foo_t;
>
> That is surely hopeless.

trivially handled:
no id after struct => forward-sexp to skip over {} and get the next id.

-- 
Sam Steingold (http://www.podval.org/~sds) on Fedora Core release 5 (Bordeaux)
http://thereligionofpeace.com http://honestreporting.com http://memri.org
http://truepeace.org http://pmw.org.il http://jihadwatch.org
(lisp programmers do it better)




reply via email to

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