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

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

bug#21526: 24.5; prolog-mode: broken indentation for if-then-else constr


From: Markus Triska
Subject: bug#21526: 24.5; prolog-mode: broken indentation for if-then-else construct
Date: Tue, 06 Oct 2015 00:38:49 +0200

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Looks good, installed, thanks.

Great! One further devation from Stefan Bruda's mode is:

   test :-
           X = [
                   a,
                   b
           ].


We expect instead, as with Stefan Bruda's version, the layout:

   test :-
           X = [
                   a,
                   b
               ].

Notice that this regression is very visible, since it affects the module
declaration that most Prolog files begin with. For example, consider:

   :- module(x, [
                     a,
                     bHERE

when I, with point at "HERE", press RET, then I get with Emacs git:

   :- module(x, [
                     a,
                     b
                     HERE

The indentation for this new line is already different from Stefan
Bruda's version, but not in itself a serious mistake at that point: It
is theoretically possible that further list elements still follow.  In
practice though, that is extremely unlikely, and we would therefore
prefer the level of the opening "[" (as with Stefan Bruda's version):

   :- module(x, [
                     a,
                     b
                 HERE

However, suppose you retain the current behaviour of Emacs git, and then
close the whole module declaration by entering "]).", yielding:

   :- module(x, [
                     a,
                     b
                     ]).HERE

Then, if you press RET (as most users certainly would here), you get:

   :- module(x, [
                     a,
                     b
             ]).

and this is clearly not the intended layout for a term like that.
Instead, the indentation level of "[" should equal that of "]".

Another deviation from Stefan Bruda's mode is an unusually large
indentation for arguments of declarations like:

   :- public
                   a,
                   b.


Please consider indenting arguments less, for example, as in:

   :- public
             a,
             b.

Thank you and all the best,
Markus






reply via email to

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