diff options
| author | Fabián Ezequiel Gallina | 2012-05-17 00:02:52 -0300 |
|---|---|---|
| committer | Fabián Ezequiel Gallina | 2012-05-17 00:02:52 -0300 |
| commit | 6ac2041b868fb13d2838a83a1e7bd565f9dcd81c (patch) | |
| tree | 8eaf4c19107dd6ac41210f62f210498ddbd77c9c | |
| parent | 45c138ac0ff103d83e1fd5ba5893b70c4a6d316e (diff) | |
| download | emacs-6ac2041b868fb13d2838a83a1e7bd565f9dcd81c.tar.gz emacs-6ac2041b868fb13d2838a83a1e7bd565f9dcd81c.zip | |
Cleanup prompts when sending region to shell.
| -rw-r--r-- | lisp/progmodes/python.el | 10 |
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. |
| 1152 | If content before pointer is all whitespace indent. If not try to | 1156 | If content before pointer is all whitespace indent. If not try to |