emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r108500: * progmodes/python.el (py


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r108500: * progmodes/python.el (python-send-region): Ensure, that the
Date: Fri, 02 Nov 2012 02:30:31 -0000
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108500
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Wed 2012-06-06 15:05:11 +0200
message:
  * progmodes/python.el (python-send-region): Ensure, that the
  temporary file is created also in the remote case.
modified:
  lisp/ChangeLog
  lisp/progmodes/python.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-06-06 12:51:48 +0000
+++ b/lisp/ChangeLog    2012-06-06 13:05:11 +0000
@@ -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  <address@hidden>
 
        * vc/vc-rcs.el (vc-rcs-rcs2log-program): New.

=== modified file 'lisp/progmodes/python.el'
--- a/lisp/progmodes/python.el  2012-04-25 16:46:01 +0000
+++ b/lisp/progmodes/python.el  2012-06-06 13:05:11 +0000
@@ -1601,13 +1601,18 @@
   ;; 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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]