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

From: Markus Triska <[email-masked]>
Date: Tue, 22 Sep 2015 18:38:34 +0200

Stefan Monnier <[email-masked]> writes:

> I believe I found a solution for this one.  Please test the new code in
> master.

It's amazing, thank you! I found two remaining issues:

(1) Parentheses matching does not work yet. When I have a fact like:

   test(a, b).HERE

(with point again at the H) and press C-M-b (backward-sexp), I expect to
see, as with prolog.el directly supplied by Stefan Bruda:

   testHERE(a, b).

Instead, I currently unexpectedly get:

   HERE
   test(a, b).

or, depending on the empty lines before this fact, even things like:

   HERE

   test(a, b).

This also applies in cases like:

   test :-
           (   a
           ;   b
           ).HERE

where, when pressing C-M-b, I expect to see:

   test :-
           HERE(   a
           ;   b
           ).

instead of (as currently) placing point before the whole clause.

(2) When I set `prolog-electric-dot-flag' to t, and enter, at
(point-min) of an empty Prolog mode buffer from "emacs -Q -nw":

   RET RET RET t e s t .

then I see that the first line of the buffer is briefly highlighted,
apparently in connection with parsing. This may be connected to the
previous issue, and I hope that fixing (1) also fixes this.

All the best!
Markus