From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#22270: Indentation following a multi-line Java annotation not correct Date: Mon, 1 Feb 2021 20:48:55 +0000 Message-ID: References: <87ft4nuqas.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="641"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 22270@debbugs.gnu.org, Lanning To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 01 21:50:46 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6g9l-000AXF-2X for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Feb 2021 21:50:45 +0100 Original-Received: from localhost ([::1]:38818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6g9k-0005s2-4M for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Feb 2021 15:50:44 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6g95-0005oQ-Bp for bug-gnu-emacs@gnu.org; Mon, 01 Feb 2021 15:50:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50055) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l6g94-00045m-5m; Mon, 01 Feb 2021 15:50:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l6g94-0002kS-3w; Mon, 01 Feb 2021 15:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 01 Feb 2021 20:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22270 X-GNU-PR-Package: emacs,cc-mode Original-Received: via spool by 22270-submit@debbugs.gnu.org id=B22270.161221255010458 (code B ref 22270); Mon, 01 Feb 2021 20:50:02 +0000 Original-Received: (at 22270) by debbugs.gnu.org; 1 Feb 2021 20:49:10 +0000 Original-Received: from localhost ([127.0.0.1]:33359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l6g8C-0002ib-Pp for submit@debbugs.gnu.org; Mon, 01 Feb 2021 15:49:10 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:16057 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1l6g87-0002hq-Dv for 22270@debbugs.gnu.org; Mon, 01 Feb 2021 15:49:06 -0500 Original-Received: (qmail 18513 invoked by uid 3782); 1 Feb 2021 20:48:56 -0000 Original-Received: from acm.muc.de (p4fe15ba1.dip0.t-ipconnect.de [79.225.91.161]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 01 Feb 2021 21:48:56 +0100 Original-Received: (qmail 9136 invoked by uid 1000); 1 Feb 2021 20:48:55 -0000 Content-Disposition: inline In-Reply-To: <87ft4nuqas.fsf@gnus.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:199111 Archived-At: Hello, Lars. On Thu, Dec 03, 2020 at 11:39:23 +0100, Lars Ingebrigtsen wrote: > Lanning writes: > > In the file cc-engine the function c-guess-basic-syntax doesn't > > always properly handle indentation after a Java annotation. > > In the case where the annotation spans multiple lines, the > > following code in indented to be in-line with the last line > > of the annotation: > > @AnAnnotation(param1=1, > > param2=2) > > public void run() { > > } > > The problem is in the CASE 5N clause, where the code calls > > (c-add-syntax 'annotation-top-cont (c-point 'boi)) > > Instead of moving to the previous line, it should move to the > > beginning of the annotation > > (prog1 > > (c-add-syntax 'annotation-top-cont (progn (c-beginning-of-statement-1) > > (point))) > > (goto-char placeholder)) > Emacs 28 behaves the same way, and that does seem to be the wrong > indentation. > Alan? I think this has already been fixed, quite recently, indeed as a minor supporting part of commit 92c56300c317c9e5573dca787a2cf20f777b3179 Author: Alan Mackenzie Date: Tue Dec 15 12:09:47 2020 +0000 CC Mode: Optimize for scrolling large buffers containing few braces The fix had been in standalone CC Mode for a few years, but somehow evaded getting merged to savannah. The above commit hit merge conflicts around the area, and adding in the fix to the Java annotations fixed those conflicts at the same time. So, could I ask you to try out the bug scenario again, notice that it is now fixed, and close the bug. Thanks! > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no -- Alan Mackenzie (Nuremberg, Germany).