changeset 72535:e7ed98d0f919

(python-send-receive): Wait in the process's buffer so as to check the right buffer-local variables.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 26 Aug 2006 14:39:16 +0000
parents 4e3fb498c183
children 59670fc88353
files lisp/ChangeLog lisp/progmodes/python.el
diffstat 2 files changed, 13 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Aug 26 11:49:35 2006 +0000
+++ b/lisp/ChangeLog	Sat Aug 26 14:39:16 2006 +0000
@@ -1,3 +1,8 @@
+2006-08-26  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/python.el (python-send-receive): Wait in the
+	process's buffer so as to check the right buffer-local variables.
+
 2006-08-25  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* emacs-lisp/checkdoc.el: Remove * in defcustoms.
--- a/lisp/progmodes/python.el	Sat Aug 26 11:49:35 2006 +0000
+++ b/lisp/progmodes/python.el	Sat Aug 26 14:39:16 2006 +0000
@@ -1576,14 +1576,15 @@
 (defun python-send-receive (string)
   "Send STRING to inferior Python (if any) and return result.
 The result is what follows `_emacs_out' in the output."
+  (python-send-string string)
   (let ((proc (python-proc)))
-    (python-send-string string)
-    (set (make-local-variable 'python-preoutput-result) nil)
-    (while (progn
-	     (accept-process-output proc 5)
-	     (null python-preoutput-result)))
-    (prog1 python-preoutput-result
-      (kill-local-variable 'python-preoutput-result))))
+    (with-current-buffer (process-buffer proc)
+      (set (make-local-variable 'python-preoutput-result) nil)
+      (while (progn
+               (accept-process-output proc 5)
+               (null python-preoutput-result)))
+      (prog1 python-preoutput-result
+        (kill-local-variable 'python-preoutput-result)))))
 
 ;; Fixme:  Is there anything reasonable we can do with random methods?
 ;; (Currently only works with functions.)