From: Antti P Miettinen <apm@brigitte.dna.fi>
Subject: Re: Java indentation
Date: Thu, 10 Apr 2003 08:37:42 +0300 (EEST) [thread overview]
Message-ID: <20030410.083742.68558436.apm@brigitte.dna.fi> (raw)
In-Reply-To: <20030404.161038.125125346.apm@brigitte.dna.fi>
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)
prev parent reply other threads:[~2003-04-10 5:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-04 13:10 Java indentation Antti P Miettinen
2003-04-10 5:37 ` Antti P Miettinen [this message]
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=20030410.083742.68558436.apm@brigitte.dna.fi \
--to=apm@brigitte.dna.fi \
--cc=apm@dna.fi \
/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).