unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Minor bug in cc-menus.el: cc-imenu-java-generic-expression does not match all Java 1.5+ function definitions.
@ 2009-07-18 15:27 Nathaniel Flath
  2009-07-21 20:18 ` Nathaniel Flath
  2009-07-28 10:19 ` Alan Mackenzie
  0 siblings, 2 replies; 13+ messages in thread
From: Nathaniel Flath @ 2009-07-18 15:27 UTC (permalink / raw)
  To: emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 409 bytes --]

I was using Imenu, and noticed that it currently doesn't recognize Java
functions with either:
Generics e.g : public List<String> foo() { ...
or annotated arguments, e.g : public void foo( @NonNull bar ) {


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.


Thanks!
Nathaniel Flath

[-- Attachment #1.2: Type: text/html, Size: 458 bytes --]

[-- Attachment #2: cc-menus.patch --]
[-- Type: text/x-patch, Size: 1079 bytes --]

index b151bd0..8a87448 100644
--- a/lisp/progmodes/cc-menus.el
+++ b/lisp/progmodes/cc-menus.el
@@ -149,17 +149,18 @@ A sample value might look like: `\\(_P\\|_PROTO\\)'.")
 (defvar cc-imenu-java-generic-expression
   `((nil
      ,(concat
-       "[" c-alpha "_][\]\[." c-alnum "_]+[ \t\n\r]+" ; type spec
+       "[" c-alpha "_][\]\[." c-alnum "_<> ]+[ \t\n\r]+" ; type spec
        "\\([" c-alpha "_][" c-alnum "_]+\\)" ; method name
        "[ \t\n\r]*"
        ;; An argument list that is either empty or contains at least
-       ;; two identifiers with only space between them.  This avoids
+       ;; two words with whitespace in between them.  Words are
+       ;; identifiers and <>@ characers.  This prevents us from
        ;; matching e.g. "else if (foo)".
        (concat "([ \t\n\r]*"
-	       "\\([\]\[.," c-alnum "_]+"
+	       "\\([\]\[.," c-alnum "_@<> ]+"
 	       "[ \t\n\r]+"
 	       "[\]\[.," c-alnum "_]"
-	       "[\]\[.," c-alnum "_ \t\n\r]*"
+	       "[\]\[.," c-alnum "_ \t\n\r@<> ]*"
 	       "\\)?)")
        "[.," c-alnum "_ \t\n\r]*"
        "{"

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2009-10-17 23:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-18 15:27 Minor bug in cc-menus.el: cc-imenu-java-generic-expression does not match all Java 1.5+ function definitions Nathaniel Flath
2009-07-21 20:18 ` Nathaniel Flath
2009-07-24  3:58   ` Glenn Morris
2009-07-28 10:19 ` Alan Mackenzie
2009-07-28 11:42   ` David Kastrup
2009-07-29  3:28   ` Chong Yidong
2009-07-29  4:46     ` Nathaniel Flath
2009-08-07 14:32       ` Nathaniel Flath
     [not found]         ` <5e3a506e0908162232h192a3c28o42e1745f4444b911@mail.gmail.com>
2009-08-17  5:33           ` Fwd: " Nathaniel Flath
2009-08-22 14:17             ` Alan Mackenzie
2009-08-22 16:48               ` Nathaniel Flath
     [not found]                 ` <jwvr5v3b9ke.fsf-monnier+emacs@gnu.org>
     [not found]                   ` <5e3a506e0909291146w607168e7l578858a741cfa19a@mail.gmail.com>
2009-10-17 16:59                     ` Nathaniel Flath
2009-10-17 23:43                       ` Chong Yidong

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).