aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index b281c01b7d9..122b44a9dde 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1002,7 +1002,8 @@ commands.)"
1002 (let* ((contents (buffer-substring start end)) 1002 (let* ((contents (buffer-substring start end))
1003 (current-file (buffer-file-name)) 1003 (current-file (buffer-file-name))
1004 (process (python-shell-get-or-create-process)) 1004 (process (python-shell-get-or-create-process))
1005 (temp-file (make-temp-file "py"))) 1005 (temp-file (make-temp-file "py"))
1006 (process-buffer (process-buffer process)))
1006 (with-temp-file temp-file 1007 (with-temp-file temp-file
1007 (insert contents) 1008 (insert contents)
1008 (delete-trailing-whitespace) 1009 (delete-trailing-whitespace)
@@ -1012,7 +1013,11 @@ commands.)"
1012 (line-end-position))))) 1013 (line-end-position)))))
1013 (with-current-buffer (process-buffer process) 1014 (with-current-buffer (process-buffer process)
1014 (setq inferior-python-mode-current-file current-file) 1015 (setq inferior-python-mode-current-file current-file)
1015 (setq inferior-python-mode-current-temp-file temp-file)) 1016 (setq inferior-python-mode-current-temp-file temp-file)
1017 (delete-region (save-excursion
1018 (move-to-column 0)
1019 (point-marker))
1020 (line-end-position)))
1016 (comint-send-string process (format "execfile(r'%s')\n" temp-file)))) 1021 (comint-send-string process (format "execfile(r'%s')\n" temp-file))))
1017 1022
1018(defun python-shell-send-buffer () 1023(defun python-shell-send-buffer ()
@@ -1146,7 +1151,6 @@ It is specially designed to be added to the
1146 (display-completion-list 1151 (display-completion-list
1147 (all-completions input completions)))))))) 1152 (all-completions input completions))))))))
1148 1153
1149
1150(defun python-shell-completion-complete-or-indent () 1154(defun python-shell-completion-complete-or-indent ()
1151 "Complete or indent depending on the context. 1155 "Complete or indent depending on the context.
1152If content before pointer is all whitespace indent. If not try to 1156If content before pointer is all whitespace indent. If not try to