emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/net/tramp.el,v


From: Michael Albinus
Subject: [Emacs-diffs] Changes to emacs/lisp/net/tramp.el,v
Date: Wed, 20 Dec 2006 21:29:48 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Michael Albinus <albinus>       06/12/20 21:29:46

Index: net/tramp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/tramp.el,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -b -r1.112 -r1.113
--- net/tramp.el        20 Dec 2006 05:57:41 -0000      1.112
+++ net/tramp.el        20 Dec 2006 21:29:46 -0000      1.113
@@ -684,15 +684,20 @@
   :type '(repeat (list string function string)))
 
 (defcustom tramp-default-method
-  (cond
-   ;; An external copy method seems to be preferred, because it is
-   ;; much more performant for large files, and it hasn't too serious
-   ;; delays for small files.  But it must be ensured that there
-   ;; aren't permanent password queries.  Either a password agent like
+  ;; An external copy method seems to be preferred, because it is much
+  ;; more performant for large files, and it hasn't too serious delays
+  ;; for small files.  But it must be ensured that there aren't
+  ;; permanent password queries.  Either a password agent like
    ;; "ssh-agent" or "Pageant" shall run, or the optional password.el
-   ;; package shall be active for password caching.
-   ((executable-find "pscp")
+  ;; package shall be active for password caching.  "scpc" would be
+  ;; another good choice because of the "ControlMaster" option, but
+  ;; this is a more modern alternative in OpenSSH 4, which cannot be
+  ;; taken as default.
+  (let ((e-f (and (fboundp 'executable-find)
+                 (symbol-function 'executable-find))))
+    (cond
     ;; PuTTY is installed.
+     ((and e-f (funcall e-f "pscp"))
     (if        (or (fboundp 'password-read)
            ;; Pageant is running.
            (and (fboundp 'w32-window-exists-p)
@@ -701,15 +706,19 @@
        "pscp"
       "plink"))
    ;; There is an ssh installation.
-   ((executable-find "scp")
+     ((and e-f (funcall e-f "scp"))
     (if        (or (fboundp 'password-read)
            ;; ssh-agent is running.
            (getenv "SSH_AUTH_SOCK")
            (getenv "SSH_AGENT_PID"))
        "scp"
       "ssh"))
+     ;; Under Emacs 20, `executable-find' does not exists.  So we
+     ;; couldn't check whether there is an ssh implementation.  Let's
+     ;; hope the best.
+     ((not e-f) "ssh")
    ;; Fallback.
-   (t "ftp"))
+     (t "ftp")))
   "*Default method to use for transferring files.
 See `tramp-methods' for possibilities.
 Also see `tramp-default-method-alist'."
@@ -2863,12 +2872,11 @@
     (error
      "tramp-handle-file-name-completion invoked on non-tramp directory `%s'"
      directory))
-  (with-parsed-tramp-file-name directory nil
     (try-completion
      filename
-     (mapcar (lambda (x) (cons x nil))
-            (file-name-all-completions filename directory))
-     predicate)))
+   (mapcar 'list (file-name-all-completions filename directory))
+   (when predicate
+     (lambda (x) (funcall predicate (expand-file-name (car x) directory))))))
 
 ;; cp, mv and ln
 
@@ -4635,7 +4643,8 @@
   (try-completion
    filename
    (mapcar 'list (file-name-all-completions filename directory))
-   predicate))
+   (when predicate
+     (lambda (x) (funcall predicate (expand-file-name (car x) directory))))))
 
 ;; I misuse a little bit the tramp-file-name structure in order to handle
 ;; completion possibilities for partial methods / user names / host names.




reply via email to

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