emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-24 r116931: * net/tramp.el (tramp-file-name-handler)


From: Michael Albinus
Subject: [Emacs-diffs] emacs-24 r116931: * net/tramp.el (tramp-file-name-handler)
Date: Thu, 10 Apr 2014 07:17:52 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116931
revision-id: address@hidden
parent: address@hidden
committer: Michael Albinus <address@hidden>
branch nick: emacs-24
timestamp: Thu 2014-04-10 09:17:40 +0200
message:
  * net/tramp.el (tramp-file-name-handler)
  (tramp-completion-file-name-handler): Avoid recursive loading.
  
  * net/tramp-sh.el (tramp-make-copy-program-file-name):
  Quote result also locally.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/net/tramp-sh.el           trampsh.el-20100913133439-a1faifh29eqoi4nh-1
  lisp/net/tramp.el              tramp.el-20091113204419-o5vbwnq5f7feedwu-2427
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-04-09 00:14:37 +0000
+++ b/lisp/ChangeLog    2014-04-10 07:17:40 +0000
@@ -1,3 +1,11 @@
+2014-04-10  Michael Albinus  <address@hidden>
+
+       * net/tramp.el (tramp-file-name-handler)
+       (tramp-completion-file-name-handler): Avoid recursive loading.
+
+       * net/tramp-sh.el (tramp-make-copy-program-file-name):
+       Quote result also locally.
+
 2014-04-09  Dmitry Gutov  <address@hidden>
 
        * progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight more

=== modified file 'lisp/net/tramp-sh.el'
--- a/lisp/net/tramp-sh.el      2014-03-25 09:49:37 +0000
+++ b/lisp/net/tramp-sh.el      2014-04-10 07:17:40 +0000
@@ -4836,9 +4836,10 @@
        (host (tramp-file-name-real-host vec))
        (localname (tramp-shell-quote-argument
                    (tramp-file-name-localname vec))))
-    (if (not (zerop (length user)))
-        (format "address@hidden:%s" user host localname)
-      (format "%s:%s" host localname))))
+    (shell-quote-argument
+     (if (not (zerop (length user)))
+        (format "address@hidden:%s" user host localname)
+       (format "%s:%s" host localname)))))
 
 (defun tramp-method-out-of-band-p (vec size)
   "Return t if this is an out-of-band method, nil otherwise."

=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2014-03-25 08:16:49 +0000
+++ b/lisp/net/tramp.el 2014-04-10 07:17:40 +0000
@@ -2106,7 +2106,16 @@
 Falls back to normal file name handler if no Tramp file name handler exists."
   (if tramp-mode
       (save-match-data
-       (let* ((filename
+       (let* ((default-directory
+                ;; Some packages set the default directory to a
+                ;; remote path, before tramp.el has been loaded.
+                ;; This results in recursive loading.  Therefore, we
+                ;; set `default-directory' to a local path.  `args'
+                ;; could also be remote when loading tramp.el, but
+                ;; that would be such perverse we don't care about.
+                (if load-in-progress
+                    temporary-file-directory default-directory))
+              (filename
                (tramp-replace-environment-variables
                 (apply 'tramp-file-name-for-operation operation args)))
               (completion (tramp-completion-mode-p))
@@ -2218,8 +2227,11 @@
   "Invoke Tramp file name completion handler.
 Falls back to normal file name handler if no Tramp file name handler exists."
   ;; We bind `directory-sep-char' here for XEmacs on Windows, which
-  ;; would otherwise use backslash.
+  ;; would otherwise use backslash.  For `default-directory', see
+  ;; comment in `tramp-file-name-handler'.
   (let ((directory-sep-char ?/)
+       (default-directory
+         (if load-in-progress temporary-file-directory default-directory))
        (fn (assoc operation tramp-completion-file-name-handler-alist)))
     (if (and
         ;; When `tramp-mode' is not enabled, we don't do anything.


reply via email to

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