mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-13 16:38:14 +00:00
* net/tramp.el (tramp-default-method): We still need to check for
`executable-find', because it is not bound under Emacs 20.
This commit is contained in:
parent
7fb2429835
commit
83e20b5c89
@ -1,9 +1,8 @@
|
||||
2006-12-20 Michael Albinus <michael.albinus@gmx.de>
|
||||
|
||||
* net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
|
||||
parameter PREDICATE.
|
||||
|
||||
* lisp/tramp.el (tramp-handle-file-name-completion)
|
||||
* net/tramp.el (tramp-default-method): We still need to check for
|
||||
`executable-find', because it is not bound under Emacs 20.
|
||||
(tramp-handle-file-name-completion)
|
||||
(tramp-completion-handle-file-name-completion): Handle optional
|
||||
parameter PREDICATE.
|
||||
(tramp-find-default-method): Add code for default values.
|
||||
|
@ -684,32 +684,41 @@ various functions for details."
|
||||
: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
|
||||
;; "ssh-agent" or "Pageant" shall run, or the optional password.el
|
||||
;; package shall be active for password caching.
|
||||
((executable-find "pscp")
|
||||
;; PuTTY is installed.
|
||||
(if (or (fboundp 'password-read)
|
||||
;; Pageant is running.
|
||||
(and (fboundp 'w32-window-exists-p)
|
||||
(funcall (symbol-function 'w32-window-exists-p)
|
||||
"Pageant" "Pageant")))
|
||||
"pscp"
|
||||
"plink"))
|
||||
;; There is an ssh installation.
|
||||
((executable-find "scp")
|
||||
(if (or (fboundp 'password-read)
|
||||
;; ssh-agent is running.
|
||||
(getenv "SSH_AUTH_SOCK")
|
||||
(getenv "SSH_AGENT_PID"))
|
||||
"scp"
|
||||
"ssh"))
|
||||
;; Fallback.
|
||||
(t "ftp"))
|
||||
;; 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. "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)
|
||||
(funcall (symbol-function 'w32-window-exists-p)
|
||||
"Pageant" "Pageant")))
|
||||
"pscp"
|
||||
"plink"))
|
||||
;; There is an ssh installation.
|
||||
((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")))
|
||||
"*Default method to use for transferring files.
|
||||
See `tramp-methods' for possibilities.
|
||||
Also see `tramp-default-method-alist'."
|
||||
@ -2863,12 +2872,11 @@ of."
|
||||
(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)))
|
||||
(try-completion
|
||||
filename
|
||||
(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 @@ Falls back to normal file name handler if no tramp file name handler exists."
|
||||
(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.
|
||||
|
Loading…
Reference in New Issue
Block a user