emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r109933: * progmodes/python.el (pytho


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109933: * progmodes/python.el (python-shell-send-string): When
Date: Fri, 07 Sep 2012 16:53:15 +0200
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109933
author: Matt McClure  <address@hidden>
committer: Michael Albinus <address@hidden
branch nick: trunk
timestamp: Fri 2012-09-07 16:53:15 +0200
message:
  * 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)
modified:
  lisp/ChangeLog
  lisp/progmodes/python.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-09-07 13:53:21 +0000
+++ b/lisp/ChangeLog    2012-09-07 14:53:15 +0000
@@ -1,3 +1,11 @@
+2012-09-07  Matt McClure  <address@hidden>  (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  <address@hidden>
 
        * window.el (switch-to-buffer): Doc fix (Bug#12181).

=== modified file 'lisp/progmodes/python.el'
--- a/lisp/progmodes/python.el  2012-08-15 16:29:11 +0000
+++ b/lisp/progmodes/python.el  2012-09-07 14:53:15 +0000
@@ -1824,7 +1824,11 @@
         (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)
@@ -1931,8 +1935,14 @@
   (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


reply via email to

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