Mercurial > emacs
comparison lisp/net/tramp-gw.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 |
---|---|
36 ;; Pacify byte-compiler | 36 ;; Pacify byte-compiler |
37 (eval-when-compile | 37 (eval-when-compile |
38 (require 'cl) | 38 (require 'cl) |
39 (require 'custom)) | 39 (require 'custom)) |
40 | 40 |
41 ;; Autoload the socks library. It is used only when we access a SOCKS server. | |
42 (autoload 'socks-open-network-stream "socks") | |
43 (defvar socks-username (user-login-name)) | |
44 (defvar socks-server (list "Default server" "socks" 1080 5)) | |
45 | |
46 ;; Avoid byte-compiler warnings if the byte-compiler supports this. | 41 ;; Avoid byte-compiler warnings if the byte-compiler supports this. |
47 ;; Currently, XEmacs supports this. | 42 ;; Currently, XEmacs supports this. |
48 (eval-when-compile | 43 (eval-when-compile |
49 (when (featurep 'xemacs) | 44 (when (featurep 'xemacs) |
50 (byte-compiler-options (warnings (- unused-vars))))) | 45 (byte-compiler-options (warnings (- unused-vars))))) |
51 | 46 |
52 ;; Define HTTP tunnel method ... | 47 ;; Define HTTP tunnel method ... |
53 (defvar tramp-gw-tunnel-method "tunnel" | 48 ;;;###tramp-autoload |
49 (defconst tramp-gw-tunnel-method "tunnel" | |
54 "*Method to connect HTTP gateways.") | 50 "*Method to connect HTTP gateways.") |
55 | 51 |
56 ;; ... and port. | 52 ;; ... and port. |
57 (defvar tramp-gw-default-tunnel-port 8080 | 53 (defconst tramp-gw-default-tunnel-port 8080 |
58 "*Default port for HTTP gateways.") | 54 "*Default port for HTTP gateways.") |
59 | 55 |
60 ;; Define SOCKS method ... | 56 ;; Define SOCKS method ... |
61 (defvar tramp-gw-socks-method "socks" | 57 ;;;###tramp-autoload |
58 (defconst tramp-gw-socks-method "socks" | |
62 "*Method to connect SOCKS servers.") | 59 "*Method to connect SOCKS servers.") |
63 | 60 |
64 ;; ... and port. | 61 ;; ... and port. |
65 (defvar tramp-gw-default-socks-port 1080 | 62 (defconst tramp-gw-default-socks-port 1080 |
66 "*Default port for SOCKS servers.") | 63 "*Default port for SOCKS servers.") |
64 | |
65 ;; Autoload the socks library. It is used only when we access a SOCKS server. | |
66 (autoload 'socks-open-network-stream "socks") | |
67 (defvar socks-username (user-login-name)) | |
68 (defvar socks-server | |
69 (list "Default server" "socks" tramp-gw-default-socks-port 5)) | |
67 | 70 |
68 ;; Add a default for `tramp-default-user-alist'. Default is the local user. | 71 ;; Add a default for `tramp-default-user-alist'. Default is the local user. |
69 (add-to-list 'tramp-default-user-alist | 72 (add-to-list 'tramp-default-user-alist |
70 `(,tramp-gw-tunnel-method nil ,(user-login-name))) | 73 `(,tramp-gw-tunnel-method nil ,(user-login-name))) |
71 (add-to-list 'tramp-default-user-alist | 74 (add-to-list 'tramp-default-user-alist |
123 (defun tramp-gw-process-filter (proc string) | 126 (defun tramp-gw-process-filter (proc string) |
124 (let (tramp-verbose) | 127 (let (tramp-verbose) |
125 (process-send-string | 128 (process-send-string |
126 (tramp-get-connection-property proc "process" nil) string))) | 129 (tramp-get-connection-property proc "process" nil) string))) |
127 | 130 |
131 ;;;###tramp-autoload | |
128 (defun tramp-gw-open-connection (vec gw-vec target-vec) | 132 (defun tramp-gw-open-connection (vec gw-vec target-vec) |
129 "Open a remote connection to VEC (see `tramp-file-name' structure). | 133 "Open a remote connection to VEC (see `tramp-file-name' structure). |
130 Take GW-VEC as SOCKS or HTTP gateway, i.e. its method must be a | 134 Take GW-VEC as SOCKS or HTTP gateway, i.e. its method must be a |
131 gateway method. TARGET-VEC identifies where to connect to via | 135 gateway method. TARGET-VEC identifies where to connect to via |
132 the gateway, it can be different from VEC when there are more | 136 the gateway, it can be different from VEC when there are more |
308 (tramp-read-passwd | 312 (tramp-read-passwd |
309 nil | 313 nil |
310 (format | 314 (format |
311 "Password for %s@[%s]: " socks-username (read (current-buffer))))))))) | 315 "Password for %s@[%s]: " socks-username (read (current-buffer))))))))) |
312 | 316 |
317 (add-hook 'tramp-unload-hook | |
318 (lambda () | |
319 (unload-feature 'tramp-gw 'force))) | |
313 | 320 |
314 (provide 'tramp-gw) | 321 (provide 'tramp-gw) |
315 | 322 |
316 ;;; TODO: | 323 ;;; TODO: |
317 | 324 |