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

From: Stefan Monnier <[email-masked]>
Date: Tue, 06 Oct 2015 16:09:44 -0400

> This is completely unexpected and unusual in Emacs modes: In other modes
> I tested (C, Lisp etc.), C-M-b and C-M-f behave very consistently, also
> if the syntactic elements they usually jump over arise in comments.

Actually this is a manifestation of a problem that's plagued Emacs
navigation for ever: try

    % foo)HERE

and hit C-M-b (replace the "%" by the comment-starter of the mode you
happen to be using).

But indeed, in the present case it's worse because the comment actually
does contain a complete "sexp", it's just that with infix operators, we
have to find the "previous" in order to decide that we've seen the end.

Also I can't explain why

   % Hello,
   % there.

   it_is_a_fact.

   %?- test(a,b).HERE

would jump back all the way to the beginning.  I'd expect it to stop
at

   HERE%?- test(a,b).

or nearby (since the preceding token is a "." which should stop the movement).

> making the current navigation work better with comments.

Indeed.

        Stefan