From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sam Steingold Newsgroups: gmane.emacs.devel Subject: Re: which-function deficiency in C mode caused by imenu Date: Sun, 25 Jun 2006 22:08:07 -0400 Message-ID: References: Reply-To: sds@podval.org NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7BIT X-Trace: sea.gmane.org 1151287723 2437 80.91.229.2 (26 Jun 2006 02:08:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 26 Jun 2006 02:08:43 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 26 04:08:37 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FugWb-0007PJ-46 for ged-emacs-devel@m.gmane.org; Mon, 26 Jun 2006 04:08:29 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FugWa-0002A2-Lw for ged-emacs-devel@m.gmane.org; Sun, 25 Jun 2006 22:08:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FugWL-00029f-6E for emacs-devel@gnu.org; Sun, 25 Jun 2006 22:08:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FugWJ-00029T-Np for emacs-devel@gnu.org; Sun, 25 Jun 2006 22:08:11 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FugWJ-00029Q-HC for emacs-devel@gnu.org; Sun, 25 Jun 2006 22:08:11 -0400 Original-Received: from [167.206.4.198] (helo=mta3.srv.hcvlny.cv.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fugi3-0005cV-BD; Sun, 25 Jun 2006 22:20:19 -0400 Original-Received: from loiso.podval.org (ool-182f780f.dyn.optonline.net [24.47.120.15]) by mta3.srv.hcvlny.cv.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTP id <0J1G0049X39JLS21@mta3.srv.hcvlny.cv.net>; Sun, 25 Jun 2006 22:08:08 -0400 (EDT) Original-Received: by loiso.podval.org (Postfix, from userid 500) id A773821E087; Sun, 25 Jun 2006 22:08:07 -0400 (EDT) In-reply-to: Original-To: rms@gnu.org, lli@sypro.cap.se, etxaksf@aom.ericsson.se Mail-Copies-To: never X-Attribution: Sam X-Disclaimer: You should not expect anyone to agree with me. User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:56179 Archived-At: > * Richard Stallman [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" . #) ("DEBUG_WARN" . #) ("int" . #) ("int" . #) ("int" . #) ("int" . #) ("void" . #) ("member" . #) ("merge_sort" . #) ("heap_sort" . #) ("mapl" . #)) for the file 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)