bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22270: Indentation following a multi-line Java annotation not correc


From: Alan Mackenzie
Subject: bug#22270: Indentation following a multi-line Java annotation not correct
Date: Mon, 1 Feb 2021 20:48:55 +0000

Hello, Lars.

On Thu, Dec 03, 2020 at 11:39:23 +0100, Lars Ingebrigtsen wrote:
> Lanning <lanning@gmail.com> 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 <acm@muc.de>
    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).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]