diff options
| author | Daniel Colascione | 2012-09-17 04:07:36 -0800 |
|---|---|---|
| committer | Daniel Colascione | 2012-09-17 04:07:36 -0800 |
| commit | 2ab329f3b5d52a39f0a45c3d9c129f1c19560142 (patch) | |
| tree | 6dd6784d63e54cb18071df8e28fbdbc27d418728 /lisp/progmodes/python.el | |
| parent | f701ab72dd55460d23c8b029550aa4d7ecef3cfa (diff) | |
| parent | bb7dce392f6d9d5fc4b9d7de09ff920a52f07669 (diff) | |
| download | emacs-2ab329f3b5d52a39f0a45c3d9c129f1c19560142.tar.gz emacs-2ab329f3b5d52a39f0a45c3d9c129f1c19560142.zip | |
Merge from trunk
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 601850ed0fb..ffc6c1ac885 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -1824,7 +1824,11 @@ When MSG is non-nil messages the first line of STRING." | |||
| 1824 | (lines (split-string string "\n" t))) | 1824 | (lines (split-string string "\n" t))) |
| 1825 | (and msg (message "Sent: %s..." (nth 0 lines))) | 1825 | (and msg (message "Sent: %s..." (nth 0 lines))) |
| 1826 | (if (> (length lines) 1) | 1826 | (if (> (length lines) 1) |
| 1827 | (let* ((temp-file-name (make-temp-file "py")) | 1827 | (let* ((temporary-file-directory |
| 1828 | (if (file-remote-p default-directory) | ||
| 1829 | (concat (file-remote-p default-directory) "/tmp") | ||
| 1830 | temporary-file-directory)) | ||
| 1831 | (temp-file-name (make-temp-file "py")) | ||
| 1828 | (file-name (or (buffer-file-name) temp-file-name))) | 1832 | (file-name (or (buffer-file-name) temp-file-name))) |
| 1829 | (with-temp-file temp-file-name | 1833 | (with-temp-file temp-file-name |
| 1830 | (insert string) | 1834 | (insert string) |
| @@ -1931,8 +1935,14 @@ FILE-NAME." | |||
| 1931 | (interactive "fFile to send: ") | 1935 | (interactive "fFile to send: ") |
| 1932 | (let* ((process (or process (python-shell-get-or-create-process))) | 1936 | (let* ((process (or process (python-shell-get-or-create-process))) |
| 1933 | (temp-file-name (when temp-file-name | 1937 | (temp-file-name (when temp-file-name |
| 1934 | (expand-file-name temp-file-name))) | 1938 | (expand-file-name |
| 1935 | (file-name (or (expand-file-name file-name) temp-file-name))) | 1939 | (or (file-remote-p temp-file-name 'localname) |
| 1940 | temp-file-name)))) | ||
| 1941 | (file-name (or (when file-name | ||
| 1942 | (expand-file-name | ||
| 1943 | (or (file-remote-p file-name 'localname) | ||
| 1944 | file-name))) | ||
| 1945 | temp-file-name))) | ||
| 1936 | (when (not file-name) | 1946 | (when (not file-name) |
| 1937 | (error "If FILE-NAME is nil then TEMP-FILE-NAME must be non-nil")) | 1947 | (error "If FILE-NAME is nil then TEMP-FILE-NAME must be non-nil")) |
| 1938 | (python-shell-send-string | 1948 | (python-shell-send-string |