Commit 37e86445 authored by Barry Warsaw's avatar Barry Warsaw

(py-execute-region): Make sure the new temporary buffer is current for

the insertion of the text.
parent 2d5e1d30
...@@ -1284,10 +1284,11 @@ is inserted at the end. See also the command `py-clear-queue'." ...@@ -1284,10 +1284,11 @@ is inserted at the end. See also the command `py-clear-queue'."
;; Write the contents of the buffer, watching out for indented regions. ;; Write the contents of the buffer, watching out for indented regions.
(save-excursion (save-excursion
(goto-char start) (goto-char start)
(when (/= (py-point 'bol) (py-point 'boi)) (let ((needs-if (/= (py-point 'bol) (py-point 'boi))))
(set-buffer buf) (set-buffer buf)
(insert "if 1:\n")) (when needs-if
(insert-buffer-substring cur start end)) (insert "if 1:\n"))
(insert-buffer-substring cur start end)))
(cond (cond
;; always run the code in its own asynchronous subprocess ;; always run the code in its own asynchronous subprocess
(async (async
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment