From: Michael Albinus Date: Wed, 6 Jun 2012 13:05:11 +0000 (+0200) Subject: * progmodes/python.el (python-send-region): Ensure, that the X-Git-Tag: emacs-24.2.90~1199^2~474^2~113 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=eed0bb91900aba4235aca59219ed88e0561f7fb1;p=emacs.git * progmodes/python.el (python-send-region): Ensure, that the temporary file is created also in the remote case. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 343368bc591..124b2bbeff6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -8,6 +8,9 @@ * files.el (enable-remote-dir-locals): New option. (hack-dir-local-variables): Use it. (Bug#1933, Bug#6731) + * progmodes/python.el (python-send-region): Ensure, that the + temporary file is created also in the remote case. + 2012-06-06 Glenn Morris * vc/vc-rcs.el (vc-rcs-rcs2log-program): New. 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." ;; Fixme: Write a `coding' header to the temp file if the region is ;; non-ASCII. (interactive "r") - (let* ((f (make-temp-file "py" nil ".py")) + (let* ((temporary-file-directory + (if (file-remote-p default-directory) + (concat (file-remote-p default-directory) "/tmp") + temporary-file-directory)) + (f (make-temp-file "py" nil ".py")) + (f-local (or (file-remote-p f 'localname) f)) (command ;; IPython puts the FakeModule module into __main__ so ;; emacs.eexecfile becomes useless. (if (string-match "^ipython" python-command) - (format "execfile %S" f) - (format "emacs.eexecfile(%S)" f))) + (format "execfile %S" f-local) + (format "emacs.eexecfile(%S)" f-local))) (orig-start (copy-marker start))) (when (save-excursion (goto-char start)