diff options
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 620ea8cd519..8595ac581c0 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -1601,13 +1601,18 @@ behavior, change `python-remove-cwd-from-path' to nil." | |||
| 1601 | ;; Fixme: Write a `coding' header to the temp file if the region is | 1601 | ;; Fixme: Write a `coding' header to the temp file if the region is |
| 1602 | ;; non-ASCII. | 1602 | ;; non-ASCII. |
| 1603 | (interactive "r") | 1603 | (interactive "r") |
| 1604 | (let* ((f (make-temp-file "py" nil ".py")) | 1604 | (let* ((temporary-file-directory |
| 1605 | (if (file-remote-p default-directory) | ||
| 1606 | (concat (file-remote-p default-directory) "/tmp") | ||
| 1607 | temporary-file-directory)) | ||
| 1608 | (f (make-temp-file "py" nil ".py")) | ||
| 1609 | (f-local (or (file-remote-p f 'localname) f)) | ||
| 1605 | (command | 1610 | (command |
| 1606 | ;; IPython puts the FakeModule module into __main__ so | 1611 | ;; IPython puts the FakeModule module into __main__ so |
| 1607 | ;; emacs.eexecfile becomes useless. | 1612 | ;; emacs.eexecfile becomes useless. |
| 1608 | (if (string-match "^ipython" python-command) | 1613 | (if (string-match "^ipython" python-command) |
| 1609 | (format "execfile %S" f) | 1614 | (format "execfile %S" f-local) |
| 1610 | (format "emacs.eexecfile(%S)" f))) | 1615 | (format "emacs.eexecfile(%S)" f-local))) |
| 1611 | (orig-start (copy-marker start))) | 1616 | (orig-start (copy-marker start))) |
| 1612 | (when (save-excursion | 1617 | (when (save-excursion |
| 1613 | (goto-char start) | 1618 | (goto-char start) |