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

From: Markus Triska <[email-masked]>
Date: Tue, 22 Sep 2015 08:25:13 +0200

Stefan Monnier <[email-masked]> writes:

>> When I try it with your patch, it fails to indent subsequent lines.
>
> Ugh!  That should be fixed now (see patch below).

Great, thank you!

> Right.  This one requires thinking (but will benefit other modes as
> well).

This will make the new mode much more useable, so thank you for looking
into this! Currently, not only is the new empty line indented in a
distracting and unexpected way, but closing the bock does not indent it
as expected either. For example, when I press RET at:

   test :-
           (   a
           ;   bHERE

then I get:

   test :-
           (   a
           ;   b
                       HERE

and when I then press ")" followed by "." to end the block, I get:

   test :-
           (   a
           ;   b
                       ).

Previously you suggested to make "." electric, this would fix this,
however, I expect the correct indentation already when pressing ")":

   test :-
           (   a
           ;   b
           )

because the block need not end with "." but can look for example like:

   test :-
           (   a
           ;   b
           ),
           c.

I hope this helps.

All the best,
Markus