Mercurial > emacs
comparison lisp/net/tramp-ftp.el @ 110264:ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
(Bug#1529, Bug#5448, Bug#5705)
* Makefile.in (TRAMP_DIR, TRAMP_SRC): New variables.
($(TRAMP_DIR)/tramp-loaddefs.el): New target.
(LOADDEFS): Add $(lisp)/net/tramp-loaddefs.el.
* net/tramp.el (top): Remove all other tramp-* loads except
tramp-compat.el. Remove all changes to tramp-unload-hook for
other tramp-* packages. Rearrange defun order. Change calls of
`tramp-compat-call-process', `tramp-compat-decimal-to-octal',
`tramp-compat-octal-to-decimal' to new function names.
(tramp-terminal-type, tramp-initial-end-of-output)
(tramp-methods, tramp-foreign-file-name-handler-alist)
(tramp-tramp-file-p, tramp-completion-mode-p)
(tramp-send-command-and-check, tramp-get-remote-path)
(tramp-get-remote-tmpdir, tramp-get-remote-ln)
(tramp-shell-quote-argument): Set tramp-autoload cookie.
(with-file-property, with-connection-property): Move to
tramp-cache.el.
(tramp-local-call-process, tramp-decimal-to-octal)
(tramp-octal-to-decimal): Move to tramp-compat.el.
(tramp-handle-shell-command): Do not require 'shell.
(tramp-compute-multi-hops): No special handling for tramp-gw-*
symbols.
(tramp-unload-tramp): Do not call `tramp-unload-file-name-handlers'.
* net/tramp-cache.el (top): Require 'tramp. Add to
`tramp-unload-hook'.
(tramp-cache-data, tramp-get-file-property)
(tramp-set-file-property, tramp-flush-file-property)
(tramp-flush-directory-property, tramp-get-connection-property)
(tramp-set-connection-property, tramp-flush-connection-property)
(tramp-cache-print, tramp-list-connections): Set tramp-autoload
cookie.
(with-file-property, with-connection-property): New defuns, moved
from tramp.el.
(tramp-flush-file-function): Use `with-parsed-tramp-file-name'
macro.
* net/tramp-cmds.el (top): Add to `tramp-unload-hook'.
(tramp-version): Set tramp-autoload cookie.
* net/tramp-compat.el (top): Require 'tramp-loaddefs. Remove all
changes to tramp-unload-hook for other tramp-* packages. Add to
`tramp-unload-hook'.
(tramp-compat-decimal-to-octal, tramp-compat-octal-to-decimal)
(tramp-compat-call-process): New defuns, moved from tramp.el.
* net/tramp-fish.el (top) Require just 'tramp. Add objects to
`tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add
to `tramp-unload-hook'. Change call of
`tramp-compat-decimal-to-octal' to new function name.
(tramp-fish-method): Make it a defconst.
(tramp-fish-file-name-p): Make it a defsubst.
(tramp-fish-method, tramp-fish-file-name-handler)
(tramp-fish-file-name-p): Set tramp-autoload cookie.
* net/tramp-ftp.el (top) Add objects to `tramp-methods' and
`tramp-foreign-file-name-handler-alist'. Add to
`tramp-unload-hook'.
(tramp-ftp-method): Make it a defconst.
(tramp-ftp-file-name-p): Make it a defsubst.
(tramp-ftp-method, tramp-ftp-file-name-handler)
(tramp-ftp-file-name-p): Set tramp-autoload cookie.
* net/tramp-gvfs.el (top) Add objects to `tramp-methods' and
`tramp-foreign-file-name-handler-alist'. Add to
`tramp-unload-hook'. Change checks, whether package can be
loaded.
(tramp-gvfs-file-name-p): Make it a defsubst.
(tramp-gvfs-methods, tramp-gvfs-file-name-handler)
(tramp-gvfs-file-name-p): Set tramp-autoload cookie.
(tramp-gvfs-handle-file-directory-p): New defun.
(tramp-gvfs-file-name-handler-alist): Use it.
* net/tramp-gw.el (top) Add objects to `tramp-methods' and
`tramp-foreign-file-name-handler-alist'. Add to
`tramp-unload-hook'.
(tramp-gw-tunnel-method, tramp-gw-default-tunnel-port)
(tramp-gw-socks-method, tramp-gw-default-socks-port): Make it a
defconst.
(tramp-gw-tunnel-method, tramp-gw-socks-method)
(tramp-gw-open-connection): Set tramp-autoload cookie.
* net/tramp-imap.el (top) Require just 'tramp. Add objects to
`tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add
to `tramp-unload-hook'. Change checks, whether package can be
loaded.
(tramp-imap-file-name-p): Make it a defsubst.
(tramp-imap-method, tramp-imaps-method)
(tramp-imap-file-name-handler)
(tramp-imap-file-name-p): Set tramp-autoload cookie.
* net/tramp-smb.el (top) Require just 'tramp. Add objects to
`tramp-methods' and `tramp-foreign-file-name-handler-alist'. Add
to `tramp-unload-hook'. Change checks, whether package can be
loaded. Change call of `tramp-compat-decimal-to-octal' to new
function name.
(tramp-smb-tunnel-method): Make it a defconst.
(tramp-smb-file-name-p): Make it a defsubst.
(tramp-smb-method, tramp-smb-file-name-handler)
(tramp-smb-file-name-p): Set tramp-autoload cookie.
* net/tramp-uu.el (top) Add to `tramp-unload-hook'.
(tramp-uuencode-region): Set tramp-autoload cookie.
* net/trampver.el (top) Add to `tramp-unload-hook'.
(tramp-version, tramp-bug-report-address): Set tramp-autoload
cookie. Update release number.
author | Michael Albinus <michael.albinus@gmx.de> |
---|---|
date | Wed, 08 Sep 2010 16:42:54 +0200 |
parents | 280c8ae2476d |
children | 4b26adbef9a2 |
comparison
equal
deleted
inserted
replaced
110263:280c5216180d | 110264:ec526909f60b |
---|---|
28 ;; Most of them are displaced from tramp.el. | 28 ;; Most of them are displaced from tramp.el. |
29 | 29 |
30 ;;; Code: | 30 ;;; Code: |
31 | 31 |
32 (require 'tramp) | 32 (require 'tramp) |
33 (autoload 'tramp-set-connection-property "tramp-cache") | |
34 | 33 |
35 (eval-when-compile | 34 (eval-when-compile |
36 | 35 |
37 ;; Pacify byte-compiler. | 36 ;; Pacify byte-compiler. |
38 (require 'cl) | 37 (require 'cl) |
97 file-name-handler-alist))))) | 96 file-name-handler-alist))))) |
98 | 97 |
99 (add-hook 'tramp-ftp-unload-hook 'tramp-ftp-enable-ange-ftp) | 98 (add-hook 'tramp-ftp-unload-hook 'tramp-ftp-enable-ange-ftp) |
100 | 99 |
101 ;; Define FTP method ... | 100 ;; Define FTP method ... |
102 (defcustom tramp-ftp-method "ftp" | 101 ;;;###tramp-autoload |
103 "*When this method name is used, forward all calls to Ange-FTP." | 102 (defconst tramp-ftp-method "ftp" |
104 :group 'tramp | 103 "*When this method name is used, forward all calls to Ange-FTP.") |
105 :type 'string) | |
106 | 104 |
107 ;; ... and add it to the method list. | 105 ;; ... and add it to the method list. |
108 (add-to-list 'tramp-methods (cons tramp-ftp-method nil)) | 106 ;;;###tramp-autoload |
107 (unless (featurep 'xemacs) | |
108 (add-to-list 'tramp-methods (cons tramp-ftp-method nil))) | |
109 | 109 |
110 ;; Add some defaults for `tramp-default-method-alist' | 110 ;; Add some defaults for `tramp-default-method-alist' |
111 (add-to-list 'tramp-default-method-alist | 111 (add-to-list 'tramp-default-method-alist |
112 (list "\\`ftp\\." "" tramp-ftp-method)) | 112 (list "\\`ftp\\." "" tramp-ftp-method)) |
113 (add-to-list 'tramp-default-method-alist | 113 (add-to-list 'tramp-default-method-alist |
127 (delete 'ange-ftp | 127 (delete 'ange-ftp |
128 (delete 'tramp-handle-substitute-in-file-name | 128 (delete 'tramp-handle-substitute-in-file-name |
129 (symbol-plist | 129 (symbol-plist |
130 'substitute-in-file-name)))))) | 130 'substitute-in-file-name)))))) |
131 | 131 |
132 ;;;###tramp-autoload | |
132 (defun tramp-ftp-file-name-handler (operation &rest args) | 133 (defun tramp-ftp-file-name-handler (operation &rest args) |
133 "Invoke the Ange-FTP handler for OPERATION. | 134 "Invoke the Ange-FTP handler for OPERATION. |
134 First arg specifies the OPERATION, second arg is a list of arguments to | 135 First arg specifies the OPERATION, second arg is a list of arguments to |
135 pass to the OPERATION." | 136 pass to the OPERATION." |
136 (save-match-data | 137 (save-match-data |
197 (and (eq inhibit-file-name-operation operation) | 198 (and (eq inhibit-file-name-operation operation) |
198 inhibit-file-name-handlers))) | 199 inhibit-file-name-handlers))) |
199 (inhibit-file-name-operation operation)) | 200 (inhibit-file-name-operation operation)) |
200 (apply 'ange-ftp-hook-function operation args))))))) | 201 (apply 'ange-ftp-hook-function operation args))))))) |
201 | 202 |
202 (defun tramp-ftp-file-name-p (filename) | 203 ;;;###tramp-autoload |
204 (defsubst tramp-ftp-file-name-p (filename) | |
203 "Check if it's a filename that should be forwarded to Ange-FTP." | 205 "Check if it's a filename that should be forwarded to Ange-FTP." |
204 (let ((v (tramp-dissect-file-name filename))) | 206 (let ((v (tramp-dissect-file-name filename))) |
205 (string= (tramp-file-name-method v) tramp-ftp-method))) | 207 (string= (tramp-file-name-method v) tramp-ftp-method))) |
206 | 208 |
207 (add-to-list 'tramp-foreign-file-name-handler-alist | 209 ;;;###tramp-autoload |
208 (cons 'tramp-ftp-file-name-p 'tramp-ftp-file-name-handler)) | 210 (unless (featurep 'xemacs) |
211 (add-to-list 'tramp-foreign-file-name-handler-alist | |
212 (cons 'tramp-ftp-file-name-p 'tramp-ftp-file-name-handler))) | |
213 | |
214 (add-hook 'tramp-unload-hook | |
215 (lambda () | |
216 (unload-feature 'tramp-ftp 'force))) | |
209 | 217 |
210 (provide 'tramp-ftp) | 218 (provide 'tramp-ftp) |
211 | 219 |
212 ;;; TODO: | 220 ;;; TODO: |
213 | 221 |