unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Sam Steingold <sds@podval.org>
Cc: emacs-devel@gnu.org
Subject: Re: which-function deficiency in C mode caused by imenu
Date: Sun, 25 Jun 2006 22:08:07 -0400	[thread overview]
Message-ID: <m3psgwk6t4.fsf_-_@loiso.podval.org> (raw)
In-Reply-To: <E1Fu3Y6-0005aU-7D@fencepost.gnu.org>

> * Richard Stallman <ezf@tah.bet> [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	other threads:[~2006-06-26  2:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-21 18:32 which-function deficiency in C mode Sam Steingold
2006-06-24  8:31 ` Richard Stallman
2006-06-26  2:08   ` Sam Steingold [this message]
2006-06-27 10:34     ` which-function deficiency in C mode caused by imenu Richard Stallman

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=m3psgwk6t4.fsf_-_@loiso.podval.org \
    --to=sds@podval.org \
    --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 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).