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

From: Stefan Monnier <[email-masked]>
Date: Mon, 21 Sep 2015 16:22:31 -0400

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

Ugh!  That should be fixed now (see patch below).

>> IIUC the only remaining issue is the indentation we get when the line is
>> empty.
> This issue also remains. Thank you!

Right.  This one requires thinking (but will benefit other modes as well).

        Stefan

diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index 24ac8d7..8c02e54 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -2081,7 +2081,7 @@ Argument BOUND is a buffer position limiting searching."
 (defun prolog-find-unmatched-paren ()
   "Return the column of the last unmatched left parenthesis."
   (save-excursion
-    (goto-char (or (car (nth 9 (syntax-ppss))) (point-min)))
+    (goto-char (or (nth 1 (syntax-ppss)) (point-min)))
     (current-column)))