Subject: Re: bug#10196: 24.0.92; prolog-mode error
From: Stefan Monnier <[email-masked]>
To: Simen Heggestøyl <[email-masked]>
Cc: [email-masked]
Date: Fri, 02 Dec 2011 23:13:59 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

> Starting from 'emacs -Q', running 'M-x prolog-mode' gives the following
> error message:
>       prolog-find-value-by-system: Wrong type argument: bufferp, nil

Thanks, I've installed the patch below which should avoid this error,
tho it may hide some underlying problem, so if some other problem shows
up, make sure to come back here.

        Stefan

=== modified file 'lisp/progmodes/prolog.el'
--- lisp/progmodes/prolog.el	2011-11-26 08:26:37 +0000
+++ lisp/progmodes/prolog.el	2011-12-03 04:05:34 +0000
@@ -868,8 +868,9 @@
 (defun prolog-find-value-by-system (alist)
   "Get value from ALIST according to `prolog-system'."
   (let ((system (or prolog-system
-                    (buffer-local-value 'prolog-system
-                                        (prolog-inferior-buffer 'dont-run)))))
+                    (let ((infbuf (prolog-inferior-buffer 'dont-run)))
+                      (when infbuf
+                        (buffer-local-value 'prolog-system infbuf))))))
     (if (listp alist)
         (let (result
               id)