diff options
| author | Stefan Monnier | 2002-05-20 18:51:49 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2002-05-20 18:51:49 +0000 |
| commit | 7ca26b02cfe1f8942faac526e8f3b1143d2c78d0 (patch) | |
| tree | 4b949665c43f377f8cbe607e5c05154ae60b235a | |
| parent | 4ead48d7c5f13748750c0aa7319d5b501a8ed947 (diff) | |
| download | emacs-7ca26b02cfe1f8942faac526e8f3b1143d2c78d0.tar.gz emacs-7ca26b02cfe1f8942faac526e8f3b1143d2c78d0.zip | |
(ange-ftp-generate-root-prefixes)
(ange-ftp-file-name-completion): Don't cons unnecessarily.
(ange-ftp-send-cmd): Always `cd' before doing `ls'.
| -rw-r--r-- | lisp/net/ange-ftp.el | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 720255726ad..dde35b017e3 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el | |||
| @@ -1459,13 +1459,11 @@ only return the directory part of FILE." | |||
| 1459 | (if (string-match "^[^/]*\\(/\\).*$" key) | 1459 | (if (string-match "^[^/]*\\(/\\).*$" key) |
| 1460 | (let ((host (substring key 0 (match-beginning 1))) | 1460 | (let ((host (substring key 0 (match-beginning 1))) |
| 1461 | (user (substring key (match-end 1)))) | 1461 | (user (substring key (match-end 1)))) |
| 1462 | (setq res (cons (list (concat user "@" host ":")) | 1462 | (push (concat user "@" host ":") res))))) |
| 1463 | res)))))) | ||
| 1464 | ange-ftp-passwd-hashtable) | 1463 | ange-ftp-passwd-hashtable) |
| 1465 | (ange-ftp-map-hashtable | 1464 | (ange-ftp-map-hashtable |
| 1466 | (function (lambda (host user) | 1465 | (function (lambda (host user) |
| 1467 | (setq res (cons (list (concat host ":")) | 1466 | (push (concat host ":") res))) |
| 1468 | res)))) | ||
| 1469 | ange-ftp-user-hashtable) | 1467 | ange-ftp-user-hashtable) |
| 1470 | (or res (list nil))))) | 1468 | (or res (list nil))))) |
| 1471 | 1469 | ||
| @@ -2357,9 +2355,13 @@ and NOWAIT." | |||
| 2357 | (setq cmd1 ".")) | 2355 | (setq cmd1 ".")) |
| 2358 | 2356 | ||
| 2359 | ;; If the remote ls can take switches, put them in | 2357 | ;; If the remote ls can take switches, put them in |
| 2360 | (or (memq host-type ange-ftp-dumb-host-types) | 2358 | (unless (memq host-type ange-ftp-dumb-host-types) |
| 2361 | (setq cmd0 'ls | 2359 | (setq cmd0 'ls) |
| 2362 | cmd1 (format "\"%s %s\"" cmd3 cmd1)))) | 2360 | ;; We cd and then use `ls' with no directory argument. |
| 2361 | ;; This works around a misfeature of some versions of netbsd ftpd. | ||
| 2362 | (unless (equal cmd1 ".") | ||
| 2363 | (setq result (ange-ftp-cd host user (nth 1 cmd) 'noerror))) | ||
| 2364 | (setq cmd1 cmd3))) | ||
| 2363 | 2365 | ||
| 2364 | ;; First argument is the remote name | 2366 | ;; First argument is the remote name |
| 2365 | ((progn | 2367 | ((progn |
| @@ -4077,9 +4079,8 @@ E.g., | |||
| 4077 | (try-completion | 4079 | (try-completion |
| 4078 | file | 4080 | file |
| 4079 | (nconc (ange-ftp-generate-root-prefixes) | 4081 | (nconc (ange-ftp-generate-root-prefixes) |
| 4080 | (mapcar 'list | 4082 | (ange-ftp-real-file-name-all-completions |
| 4081 | (ange-ftp-real-file-name-all-completions | 4083 | file ange-ftp-this-dir))) |
| 4082 | file ange-ftp-this-dir)))) | ||
| 4083 | (ange-ftp-real-file-name-completion file ange-ftp-this-dir))))) | 4084 | (ange-ftp-real-file-name-completion file ange-ftp-this-dir))))) |
| 4084 | 4085 | ||
| 4085 | 4086 | ||