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

From: Stefan Monnier <[email-masked]>
Date: Wed, 21 Oct 2015 12:06:53 -0400

>    serious_predicate :-
>            goal_1,
>            goal_2,
>            something_complicated,
>            something_complicated :-
>                    goal_3,
>                    goal_4.

> But this is not valid Prolog syntax,

Exactly.  We could try and coerce Prolog into interpreting it the way
you suggest, but I think we're better off telling people to add
a terminating "." in the previous rule, even that rule is not yet finished.

> Therefore, the above program is not syntactically valid, and it should
> be treated for what it actually is: Two independent rules, with one of
> them still unfinished, and only the second one mattering for indentation
> in this situation, which previously also worked exactly this way.

There's no way to know that this is "what it actually is".

And even if it is, the mis-indentation can be useful, in case the user
didn't realize that she forgot to close the previous rule.

IOW, in this particular case, the ideal behavior depends on what's
inside the user's head, so I don't think we should spend much time
trying to fit any particular expected state of mind of the user.

        Stefan