diff Misc/python-mode.el @ 12994:01ce89fc745f legacy-trunk

(py-execute-region): Make sure the new temporary buffer is current for the insertion of the text.
author Barry Warsaw <barry@python.org>
date Fri, 23 Jun 2000 20:24:25 +0000
parents d2573dbf6852
children f480d52c0760
line wrap: on
line diff
--- a/Misc/python-mode.el	Fri Jun 23 19:37:02 2000 +0000
+++ b/Misc/python-mode.el	Fri Jun 23 20:24:25 2000 +0000
@@ -1284,10 +1284,11 @@
     ;; Write the contents of the buffer, watching out for indented regions.
     (save-excursion
       (goto-char start)
-      (when (/= (py-point 'bol) (py-point 'boi))
+      (let ((needs-if (/= (py-point 'bol) (py-point 'boi))))
 	(set-buffer buf)
-	(insert "if 1:\n"))
-      (insert-buffer-substring cur start end))
+	(when needs-if
+	  (insert "if 1:\n"))
+	(insert-buffer-substring cur start end)))
     (cond
      ;; always run the code in its own asynchronous subprocess
      (async