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 17:33:23 +0000 Message-ID: <20130928173323.GA11317@acm.acm> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1380389782 23009 80.91.229.3 (28 Sep 2013 17:36:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Sep 2013 17:36:22 +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 19:36:25 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 1VPyRL-000613-Iq for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Sep 2013 19:36:23 +0200 Original-Received: from localhost ([::1]:42143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPyRL-0004as-2O for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Sep 2013 13:36:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPyR9-0004ab-WD for bug-gnu-emacs@gnu.org; Sat, 28 Sep 2013 13:36:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VPyR1-0007yV-KR for bug-gnu-emacs@gnu.org; Sat, 28 Sep 2013 13:36:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPyR1-0007yR-Gk for bug-gnu-emacs@gnu.org; Sat, 28 Sep 2013 13:36:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VPyR0-0000Uc-St for bug-gnu-emacs@gnu.org; Sat, 28 Sep 2013 13:36:03 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Sep 2013 17:36:02 +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.13803897241849 (code B ref 15465); Sat, 28 Sep 2013 17:36:02 +0000 Original-Received: (at 15465) by debbugs.gnu.org; 28 Sep 2013 17:35:24 +0000 Original-Received: from localhost ([127.0.0.1]:43323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VPyQJ-0000Tf-QO for submit@debbugs.gnu.org; Sat, 28 Sep 2013 13:35:24 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:13327 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VPyQC-0000TJ-Eo for 15465@debbugs.gnu.org; Sat, 28 Sep 2013 13:35:17 -0400 Original-Received: (qmail 47671 invoked by uid 3782); 28 Sep 2013 17:35:11 -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 19:35:10 +0200 Original-Received: (qmail 11369 invoked by uid 1000); 28 Sep 2013 17:33:23 -0000 Content-Disposition: inline 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:78776 Archived-At: Hi, Paul. Paul Pogonyshev , wrote: > Since Java mode finally got some improvements recently, maybe someone > can solve this too. In Java, enumerations can implement interfaces. > However, CC-mode doesn't handle that well. Compare this indentation, > for example: > public enum X > { > A, > B; > } > vs. > public enum X implements Y > { > A, > B; > } Yes, that is a bug. It happens because the code that checks for being inside an "enum" body only searches a maximum of two tokens backwards from the "{" for the "enum" keyword. > Fontification of 'A' and 'B' also changes when I add 'implements' > keyword. This was happening on any buffer change near the "{" for basically the same reason. 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. Thanks for taking the trouble to report this, and thanks even more that the report was so crisp, concise and to the point. Paul -- Alan Mackenzie (Nuremberg, Germany).