From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#15465: CC-mode misaligns enums that implement an interface in Java Date: Sat, 28 Sep 2013 21:33:12 +0000 Message-ID: <20130928213311.GE11317@acm.acm> References: <20130928173323.GA11317@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1380404118 14172 80.91.229.3 (28 Sep 2013 21:35:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Sep 2013 21:35:18 +0000 (UTC) Cc: 15465@debbugs.gnu.org To: Paul Pogonyshev Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 28 23:35:21 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VQ2Aa-0003Ye-Cu for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Sep 2013 23:35:20 +0200 Original-Received: from localhost ([::1]:42679 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQ2AZ-00023b-Nb for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Sep 2013 17:35:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQ2AQ-00022i-Ac for bug-gnu-emacs@gnu.org; Sat, 28 Sep 2013 17:35:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQ2AJ-0004Fc-01 for bug-gnu-emacs@gnu.org; Sat, 28 Sep 2013 17:35:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35461) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQ2AI-0004F7-Sc for bug-gnu-emacs@gnu.org; Sat, 28 Sep 2013 17:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VQ2AH-0007Bi-Ul for bug-gnu-emacs@gnu.org; Sat, 28 Sep 2013 17:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Sep 2013 21:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15465 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15465-submit@debbugs.gnu.org id=B15465.138040409927620 (code B ref 15465); Sat, 28 Sep 2013 21:35:01 +0000 Original-Received: (at 15465) by debbugs.gnu.org; 28 Sep 2013 21:34:59 +0000 Original-Received: from localhost ([127.0.0.1]:43754 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VQ2AE-0007BP-UN for submit@debbugs.gnu.org; Sat, 28 Sep 2013 17:34:59 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:58355 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VQ2AB-0007BE-SW for 15465@debbugs.gnu.org; Sat, 28 Sep 2013 17:34:56 -0400 Original-Received: (qmail 62158 invoked by uid 3782); 28 Sep 2013 21:34:54 -0000 Original-Received: from acm.muc.de (pD951A22A.dip0.t-ipconnect.de [217.81.162.42]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 28 Sep 2013 23:34:53 +0200 Original-Received: (qmail 13327 invoked by uid 1000); 28 Sep 2013 21:33:12 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:78786 Archived-At: Hi, Paul. On Sat, Sep 28, 2013 at 09:15:52PM +0200, Paul Pogonyshev wrote: > > I've committed a fix, revision #114474, to the bzr trunk. Could you try > > out the change, please, and either confirm it fixes the bug properly, or > > tell me what hasn't yet been fixed. > Thank you. The case I initially mentioned works properly now, also with > multiple implemented interfaces. However, it seems to not know about > interfaces with generics: > public enum X implements Y > { > A, > B; > } OK! I think the following enhancement should help out here: diff -r d51d11733869 cc-engine.el --- a/cc-engine.el Sat Sep 28 16:39:26 2013 +0000 +++ b/cc-engine.el Sat Sep 28 21:27:53 2013 +0000 @@ -8534,6 +8534,10 @@ (setq before-identifier nil) t) ((looking-at c-brace-list-key) nil) + ((and c-recognize-<>-arglists + (eq (char-after) ?<) + (looking-at "\\s(")) + t) (t nil)))) (looking-at c-brace-list-key)))) ;; this will pick up array/aggregate init lists, even if they are nested. diff -r d51d11733869 cc-fonts.el --- a/cc-fonts.el Sat Sep 28 16:39:26 2013 +0000 +++ b/cc-fonts.el Sat Sep 28 21:27:53 2013 +0000 @@ -1452,6 +1452,10 @@ (setq before-identifier nil) t) ((looking-at c-brace-list-key) nil) ; "enum" + ((and c-recognize-<>-arglists + (eq (char-after) ?<) + (looking-at "\\s(")) + t) (t nil)))) (looking-at c-brace-list-key))))))) (c-forward-token-2) @@ -1556,6 +1560,10 @@ (setq before-identifier nil) t) ((looking-at c-brace-list-key) nil) ; "enum" + ((and c-recognize-<>-arglists + (eq (char-after) ?<) + (looking-at "\\s(")) + t) (t nil)))) (looking-at c-brace-list-key))))) (c-syntactic-skip-backward "^{," nil t) > Paul -- Alan Mackenzie (Nuremberg, Germany).