From: Barry Warsaw Date: Fri, 23 Jun 2000 20:24:25 +0000 (+0000) Subject: (py-execute-region): Make sure the new temporary buffer is current for X-Git-Tag: v2.0b1~1437 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=99eadf4de9bd19653471516f5c33e2f1e40a4655;p=thirdparty%2FPython%2Fcpython.git (py-execute-region): Make sure the new temporary buffer is current for the insertion of the text. --- diff --git a/Misc/python-mode.el b/Misc/python-mode.el index 9906a52ba771..8a059f51decf 100644 --- a/Misc/python-mode.el +++ b/Misc/python-mode.el @@ -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. (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