(let* ((contents (buffer-substring start end))
(current-file (buffer-file-name))
(process (python-shell-get-or-create-process))
- (temp-file (make-temp-file "py")))
+ (temp-file (make-temp-file "py"))
+ (process-buffer (process-buffer process)))
(with-temp-file temp-file
(insert contents)
(delete-trailing-whitespace)
(line-end-position)))))
(with-current-buffer (process-buffer process)
(setq inferior-python-mode-current-file current-file)
- (setq inferior-python-mode-current-temp-file temp-file))
+ (setq inferior-python-mode-current-temp-file temp-file)
+ (delete-region (save-excursion
+ (move-to-column 0)
+ (point-marker))
+ (line-end-position)))
(comint-send-string process (format "execfile(r'%s')\n" temp-file))))
(defun python-shell-send-buffer ()
(display-completion-list
(all-completions input completions))))))))
-
(defun python-shell-completion-complete-or-indent ()
"Complete or indent depending on the context.
If content before pointer is all whitespace indent. If not try to