From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Antti P Miettinen Newsgroups: gmane.emacs.bugs Subject: Re: Java indentation Date: Thu, 10 Apr 2003 08:37:42 +0300 (EEST) Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <20030410.083742.68558436.apm@brigitte.dna.fi> References: <20030404.161038.125125346.apm@brigitte.dna.fi> Reply-To: apm@dna.fi NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1049953085 31321 80.91.224.249 (10 Apr 2003 05:38:05 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 10 Apr 2003 05:38:05 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 10 07:38:01 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 193Ul7-00088L-00 for ; Thu, 10 Apr 2003 07:38:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 193Ul7-0001au-00 for gnu-bug-gnu-emacs@m.gmane.org; Thu, 10 Apr 2003 01:38:01 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 193Ul0-0001Zt-00 for bug-gnu-emacs@gnu.org; Thu, 10 Apr 2003 01:37:54 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 193Uky-0001Zg-00 for bug-gnu-emacs@gnu.org; Thu, 10 Apr 2003 01:37:53 -0400 Original-Received: from brigitte.dna.fi ([62.236.152.115]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 193Ukx-0001XM-00; Thu, 10 Apr 2003 01:37:51 -0400 Original-Received: from localhost (localhost [::1]) by brigitte.dna.fi (8.11.6p2/8.11.3) with ESMTP id h3A5bgP17637; Thu, 10 Apr 2003 08:37:42 +0300 (EEST) Original-To: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org In-Reply-To: <20030404.161038.125125346.apm@brigitte.dna.fi> X-Mailer: Mew version 3.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:4755 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:4755 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)