+2012-09-07 Matt McClure <mlm@aya.yale.edu> (tiny change)
+
+ * progmodes/python.el (python-shell-send-string): When
+ default-directory is remote, create temp file on remote
+ filesystem.
+ (python-shell-send-file): When file is remote, pass local view of
+ file paths to remote Python interpreter. (Bug#12340)
+
2012-09-07 Chong Yidong <cyd@gnu.org>
* window.el (switch-to-buffer): Doc fix (Bug#12181).
(lines (split-string string "\n" t)))
(and msg (message "Sent: %s..." (nth 0 lines)))
(if (> (length lines) 1)
- (let* ((temp-file-name (make-temp-file "py"))
+ (let* ((temporary-file-directory
+ (if (file-remote-p default-directory)
+ (concat (file-remote-p default-directory) "/tmp")
+ temporary-file-directory))
+ (temp-file-name (make-temp-file "py"))
(file-name (or (buffer-file-name) temp-file-name)))
(with-temp-file temp-file-name
(insert string)
(interactive "fFile to send: ")
(let* ((process (or process (python-shell-get-or-create-process)))
(temp-file-name (when temp-file-name
- (expand-file-name temp-file-name)))
- (file-name (or (expand-file-name file-name) temp-file-name)))
+ (expand-file-name
+ (or (file-remote-p temp-file-name 'localname)
+ temp-file-name))))
+ (file-name (or (when file-name
+ (expand-file-name
+ (or (file-remote-p file-name 'localname)
+ file-name)))
+ temp-file-name)))
(when (not file-name)
(error "If FILE-NAME is nil then TEMP-FILE-NAME must be non-nil"))
(python-shell-send-string