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

From: Stefan Monnier <[email-masked]>
Date: Tue, 29 Sep 2015 22:07:27 -0400

> (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).

Hmmm you definitely shouldn't get

    testHERE(a, b).

but you should get

    HEREtest(a, b).

IOW, it's not a bug, it's a feature: the new code knows about infix
operators and knows how to jump over the left-hand-side or
right-hand-side of an infix operator.

Tho it seems the feature is not working 100%.  Indeed, I can reproduce
this problem, but only at the beginning of the buffer.  IOW if I have

   test(a).

   test(b).HERE

and I hit C-M-b I correctly end at

   HEREtest(b).

Since the problem only shows up on the very first element, it's not
too serious, but of course, we'd welcome a patch to fix it.

> (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,

Right, that's the same problem: you should see the first "t"
highlighted instead (since the dot closes the rule, which starts at the
first "t").

        Stefan