summaryrefslogtreecommitdiffstats
path: root/Misc/python-mode.el
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2000-06-23 20:24:25 (GMT)
committerBarry Warsaw <barry@python.org>2000-06-23 20:24:25 (GMT)
commit99eadf4de9bd19653471516f5c33e2f1e40a4655 (patch)
tree828d1b70af804f83d5bdd629540bff5fb36c1ee7 /Misc/python-mode.el
parentd08b4c4524a31695d7e63768c02f472c9cb54fbd (diff)
downloadcpython-99eadf4de9bd19653471516f5c33e2f1e40a4655.zip
cpython-99eadf4de9bd19653471516f5c33e2f1e40a4655.tar.gz
cpython-99eadf4de9bd19653471516f5c33e2f1e40a4655.tar.bz2
(py-execute-region): Make sure the new temporary buffer is current for
the insertion of the text.
Diffstat (limited to 'Misc/python-mode.el')
-rw-r--r--Misc/python-mode.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el
index 9906a52..8a059f5 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