bug-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Java indentation


From: Antti P Miettinen
Subject: Re: Java indentation
Date: Thu, 10 Apr 2003 08:37:42 +0300 (EEST)

Replying to myself..
> Does the below patch make sense? [..]

Unfortunately the c-Java-method-key I hastily constructed does not
match all possible method definitions and matches things that are not
method definitions (e.g. for (..) constructs). The below diff against
cc-langs.el should do better. Should I resend the complete diff?
Should I use savannah instead of mail? To bug-gnu-emacs or to
bug-cc-mode?

--- /usr/share/emacs/21.2/lisp/progmodes/cc-langs.el    2001-10-22 
04:26:15.000000000 +0300
+++ /home/apm/elisp/cc-langs.el 2003-04-09 19:12:03.000000000 +0300
@@ -335,6 +335,24 @@
    ;; since it is considered the end of //-comments.
    "[ \t\n]*" c-symbol-key))
 
+(defconst c-Java-argdef-key
+  (concat c-symbol-key "\\s +" c-symbol-key))
+
+;; This does not match empty|onearg arglist cause indentation is not
+;; an issue then
+(defconst c-Java-arglistdef-key
+  (concat "(\\(\\s *" c-Java-argdef-key "\\s *,\\s *\\)+"
+          "\\(\\s *" c-Java-argdef-key "\\s *)\\)?"))
+
+(defconst c-Java-method-key
+  (concat
+   "\\s *"
+   "\\(\\<\\(" c-Java-specifier-kwds "\\)\\>\\s +\\)*"
+   "\\(" c-symbol-key "\\s +\\)?"   ;return type
+   c-symbol-key                            ;name of method
+   "\\s *"
+   c-Java-arglistdef-key))          ;arglist
+
 ;; comment starter definitions for various languages.  language specific
 (defconst c-C++-comment-start-regexp "/[/*]")
 (defconst c-C-comment-start-regexp c-C++-comment-start-regexp)




reply via email to

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