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

From: Markus Triska <[email-masked]>
Date: Mon, 21 Sep 2015 08:02:32 +0200

Stefan Monnier <[email-masked]> writes:

> I installed the patch below which should fix many of your problems.

Thank you! There are several remaining issues. First, if-then-else
constructs can be nested. For example, when I have:

   test :-
           (   a,
               HERE

and press "(", then, in the prolog.el supplied by Stefan Bruda and using
the settings I posted, I get:

   test :-
           (   a,
               (   HERE

That is, it automatically indents for placing the next "if" as expected.

Eventually, a nested mixed disjunction/if-then-else may either look like:

   test :-
           (   a,
               (   b ->
                   (   c ->
                       d
                   ;   e
                   )
               ;   f
               )
           ;   g
           ).

or:

   test :-
           (   a,
               (   b
               ->  (   c
                   ->  d
                   ;   e
                   )
               ;   f
               )
           ;   g
           ).

When I try it with your patch, it fails to indent subsequent lines.

> IIUC the only remaining issue is the indentation we get when the line is
> empty.

This issue also remains. Thank you!

All the best,
Markus