Commits

Anonymous committed 550c6c4

* lisp/progmodes/prolog.el (prolog-find-value-by-system): Avoid error when
there's no inferior buffer.
(prolog-consult-compile): Don't use toggle-read-only.

  • Participants
  • Parent commits d5e39c5

Comments (0)

Files changed (2)

File lisp/ChangeLog

+2011-12-03  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/prolog.el (prolog-find-value-by-system): Avoid error when
+	there's no inferior buffer (bug#10196).
+	(prolog-consult-compile): Don't use toggle-read-only.
+
 2011-12-02  Michael Albinus  <michael.albinus@gmx.de>
 
 	* net/tramp-sh.el (tramp-maybe-open-connection): Handle user

File lisp/progmodes/prolog.el

 (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)
           ;; Emacs-20).
             (set (make-local-variable 'compilation-parse-errors-function)
                'prolog-parse-sicstus-compilation-errors))
-      (toggle-read-only 0)
+      (setq buffer-read-only nil)
       (insert command-string "\n"))
     (save-selected-window
       (pop-to-buffer buffer))