From 6ac2041b868fb13d2838a83a1e7bd565f9dcd81c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabi=C3=A1n=20Ezequiel=20Gallina?= Date: Thu, 17 May 2012 00:02:52 -0300 Subject: [PATCH] Cleanup prompts when sending region to shell. --- lisp/progmodes/python.el | 10 +++++++--- 1 file 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.)" (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) @@ -1012,7 +1013,11 @@ commands.)" (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 () @@ -1146,7 +1151,6 @@ It is specially designed to be added to the (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 -- 2.39.2