From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Minor bug in cc-menus.el: cc-imenu-java-generic-expression does not match all Java 1.5+ function definitions. Date: Tue, 28 Jul 2009 10:19:59 +0000 Message-ID: <20090728101959.GA2295@muc.de> References: <5e3a506e0907180827k148fe0d1x34b89f1fedf6c79d@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1248776294 7331 80.91.229.12 (28 Jul 2009 10:18:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Jul 2009 10:18:14 +0000 (UTC) Cc: emacs-devel@gnu.org To: Nathaniel Flath Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 28 12:18:07 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MVjky-0005sa-PM for ged-emacs-devel@m.gmane.org; Tue, 28 Jul 2009 12:18:05 +0200 Original-Received: from localhost ([127.0.0.1]:50270 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MVjkx-0001ui-US for ged-emacs-devel@m.gmane.org; Tue, 28 Jul 2009 06:18:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MVjkf-0001Zd-Dz for emacs-devel@gnu.org; Tue, 28 Jul 2009 06:17:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MVjkd-0001Vn-1v for emacs-devel@gnu.org; Tue, 28 Jul 2009 06:17:43 -0400 Original-Received: from [199.232.76.173] (port=34719 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MVjkc-0001V9-B2 for emacs-devel@gnu.org; Tue, 28 Jul 2009 06:17:42 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:2026 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MVjkb-0005K1-Kc for emacs-devel@gnu.org; Tue, 28 Jul 2009 06:17:42 -0400 Original-Received: (qmail 72985 invoked by uid 3782); 28 Jul 2009 10:17:38 -0000 Original-Received: from acm.muc.de (pD9E52286.dip.t-dialin.net [217.229.34.134]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Tue, 28 Jul 2009 12:17:37 +0200 Original-Received: (qmail 4544 invoked by uid 1000); 28 Jul 2009 10:19:59 -0000 Content-Disposition: inline In-Reply-To: <5e3a506e0907180827k148fe0d1x34b89f1fedf6c79d@mail.gmail.com> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 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:113281 Archived-At: Hi, Nathaniel, sorry about the delay replying - I'm the guy who does the CC Mode things, and sadly there's only one of me at the moment. On Sat, Jul 18, 2009 at 08:27:10AM -0700, Nathaniel Flath wrote: > I was using Imenu, and noticed that it currently doesn't recognize Java > functions with either: > Generics e.g : public List foo() { ... > or annotated arguments, e.g : public void foo( @NonNull bar ) { CC Mode has got a bit behind in handline C++ templates and Java generics (which are essentially the same thing from Emacs's point of view). There's quite a bit of work to be done on updating Java Mode's support for recent enhancements to the language. Misusing "<" and ">" as template/generic delimiters was an egregious "design" decision by the C++ people, and even worse by the Java team who ought to have learned from C++'s mistake - other tokens could have been built which would have been both easy on the eye and unambiguous enough to parse syntactically. There are pieces of C++ code which need a compiler (or some equivalent tool) to distinguish "less than" from "template start". There might also be similar Java code, I'm not sure. As a result, syntactic analysis of C++ (and maybe Java) code which contains "<" and ">" is either difficult or impossible in the general case. > The issue was the variable cc-imenu-java-generic-expression. > Attached is my patch which modifies this variables to accept all > function definitions and should fix this issue. OK. I've not looked at it in all that great detail, and haven't tried it out yet. I'm not actually a Java hacker. How confident are you that your proposed regexp won't spuriously match things with "less than" or "greater than" tokens? Or, if it will, would these matches be rare enough that we needn't worry too much? Is there any chance you could send me a test file showing a typical generic construct that the new regexp would match, and possibly constructs with "less/greater than" which it "doesn't quite" match? Thanks! > Nathaniel Flath -- Alan Mackenzie (Nuremberg, Germany).