]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/prolog.el (prolog-find-value-by-system): Avoid error when
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 3 Dec 2011 04:12:11 +0000 (23:12 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 3 Dec 2011 04:12:11 +0000 (23:12 -0500)
there's no inferior buffer.
(prolog-consult-compile): Don't use toggle-read-only.

Fixes: debbugs:10196
lisp/ChangeLog
lisp/progmodes/prolog.el

index 4ab35890caedb314d316291a9eb5ea468bb8382a..33e20f297a9788d78fdc4591ad63fe92ca26d727 100644 (file)
@@ -1,3 +1,9 @@
+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
index 24ca78ad4ef003113882299364e3ac3bc6b0fec2..5b229cc0c24267e175cb8d1bcf86f1d44963e2d5 100644 (file)
@@ -868,8 +868,9 @@ VERSION is of the format (Major . Minor)"
 (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)
@@ -1522,7 +1523,7 @@ This function must be called from the source code buffer."
           ;; 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))