diff options
| author | Michael Albinus | 2019-05-18 16:04:02 +0200 |
|---|---|---|
| committer | Michael Albinus | 2019-05-18 16:04:02 +0200 |
| commit | cac8884d892a8708d74c55e53328ee45f88d82f0 (patch) | |
| tree | d3773ceb74a83f198ba53c18d187c9fe70d82f66 | |
| parent | 1943220d1b7ed28b2708c86acfe5493d5c6e3089 (diff) | |
| download | emacs-cac8884d892a8708d74c55e53328ee45f88d82f0.tar.gz emacs-cac8884d892a8708d74c55e53328ee45f88d82f0.zip | |
Require less packages in Tramp
* lisp/net/tramp-compat.el (format-spec): Do not require advice, cl-lib,
custom, password-cache, timer and ucs-normalize.
* lisp/net/tramp-gvfs.el: Do not require zeroconf. Declare
zeroconf-* functions.
(tramp-gvfs-enabled): Autoload `zeroconf-init'.
* lisp/net/tramp-sh.el: Do not require dired.
* lisp/net/tramp.el (tramp-get-debug-buffer): Do not require outline.
(tramp-file-name-for-operation): Extend docstring.
(tramp-parse-netrc): Do not require netrc. Autoload `netrc-parse'.
| -rw-r--r-- | lisp/net/tramp-compat.el | 6 | ||||
| -rw-r--r-- | lisp/net/tramp-gvfs.el | 9 | ||||
| -rw-r--r-- | lisp/net/tramp-integration.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 4 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 14 |
5 files changed, 17 insertions, 18 deletions
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index b515f253c92..21a819f79fd 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el | |||
| @@ -35,15 +35,9 @@ | |||
| 35 | (defun tramp-unload-file-name-handlers ()) | 35 | (defun tramp-unload-file-name-handlers ()) |
| 36 | 36 | ||
| 37 | (require 'auth-source) | 37 | (require 'auth-source) |
| 38 | (require 'advice) | ||
| 39 | (require 'cl-lib) | ||
| 40 | (require 'custom) | ||
| 41 | (require 'format-spec) | 38 | (require 'format-spec) |
| 42 | (require 'parse-time) | 39 | (require 'parse-time) |
| 43 | (require 'password-cache) | ||
| 44 | (require 'shell) | 40 | (require 'shell) |
| 45 | (require 'timer) | ||
| 46 | (require 'ucs-normalize) | ||
| 47 | 41 | ||
| 48 | (declare-function tramp-handle-temporary-file-directory "tramp") | 42 | (declare-function tramp-handle-temporary-file-directory "tramp") |
| 49 | 43 | ||
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 52eaf686eaa..03870537c9a 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el | |||
| @@ -99,16 +99,21 @@ | |||
| 99 | 99 | ||
| 100 | (eval-when-compile (require 'cl-lib)) | 100 | (eval-when-compile (require 'cl-lib)) |
| 101 | (require 'tramp) | 101 | (require 'tramp) |
| 102 | |||
| 103 | (require 'dbus) | 102 | (require 'dbus) |
| 104 | (require 'url-parse) | 103 | (require 'url-parse) |
| 105 | (require 'url-util) | 104 | (require 'url-util) |
| 106 | (require 'zeroconf) | ||
| 107 | 105 | ||
| 108 | ;; Pacify byte-compiler. | 106 | ;; Pacify byte-compiler. |
| 109 | (eval-when-compile | 107 | (eval-when-compile |
| 110 | (require 'custom)) | 108 | (require 'custom)) |
| 111 | 109 | ||
| 110 | (declare-function zeroconf-init "zeroconf") | ||
| 111 | (declare-function zeroconf-list-service-types "zeroconf") | ||
| 112 | (declare-function zeroconf-list-services "zeroconf") | ||
| 113 | (declare-function zeroconf-service-host "zeroconf") | ||
| 114 | (declare-function zeroconf-service-port "zeroconf") | ||
| 115 | (declare-function zeroconf-service-txt "zeroconf") | ||
| 116 | |||
| 112 | ;; We don't call `dbus-ping', because this would load dbus.el. | 117 | ;; We don't call `dbus-ping', because this would load dbus.el. |
| 113 | (defconst tramp-gvfs-enabled | 118 | (defconst tramp-gvfs-enabled |
| 114 | (ignore-errors | 119 | (ignore-errors |
diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el index da168adce77..35d2eb38e60 100644 --- a/lisp/net/tramp-integration.el +++ b/lisp/net/tramp-integration.el | |||
| @@ -31,10 +31,10 @@ | |||
| 31 | 31 | ||
| 32 | ;; Pacify byte-compiler. | 32 | ;; Pacify byte-compiler. |
| 33 | (require 'cl-lib) | 33 | (require 'cl-lib) |
| 34 | (declare-function recentf-cleanup "recentf") | ||
| 34 | (declare-function tramp-dissect-file-name "tramp") | 35 | (declare-function tramp-dissect-file-name "tramp") |
| 35 | (declare-function tramp-file-name-equal-p "tramp") | 36 | (declare-function tramp-file-name-equal-p "tramp") |
| 36 | (declare-function tramp-tramp-file-p "tramp") | 37 | (declare-function tramp-tramp-file-p "tramp") |
| 37 | (declare-function recentf-cleanup "recentf") | ||
| 38 | (defvar eshell-path-env) | 38 | (defvar eshell-path-env) |
| 39 | (defvar recentf-exclude) | 39 | (defvar recentf-exclude) |
| 40 | (defvar tramp-current-connection) | 40 | (defvar tramp-current-connection) |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 95fa61af983..2d27baf454a 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -30,10 +30,6 @@ | |||
| 30 | (eval-when-compile (require 'cl-lib)) | 30 | (eval-when-compile (require 'cl-lib)) |
| 31 | (require 'tramp) | 31 | (require 'tramp) |
| 32 | 32 | ||
| 33 | ;; Pacify byte-compiler. | ||
| 34 | (eval-when-compile | ||
| 35 | (require 'dired)) | ||
| 36 | |||
| 37 | (declare-function dired-remove-file "dired-aux") | 33 | (declare-function dired-remove-file "dired-aux") |
| 38 | (defvar dired-compress-file-suffixes) | 34 | (defvar dired-compress-file-suffixes) |
| 39 | (defvar vc-handled-backends) | 35 | (defvar vc-handled-backends) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 88389346c33..48152444a61 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1641,8 +1641,6 @@ The outline level is equal to the verbosity of the Tramp message." | |||
| 1641 | (get-buffer-create (tramp-debug-buffer-name vec)) | 1641 | (get-buffer-create (tramp-debug-buffer-name vec)) |
| 1642 | (when (bobp) | 1642 | (when (bobp) |
| 1643 | (setq buffer-undo-list t) | 1643 | (setq buffer-undo-list t) |
| 1644 | ;; So it does not get loaded while `outline-regexp' is let-bound. | ||
| 1645 | (require 'outline) | ||
| 1646 | ;; Activate `outline-mode'. This runs `text-mode-hook' and | 1644 | ;; Activate `outline-mode'. This runs `text-mode-hook' and |
| 1647 | ;; `outline-mode-hook'. We must prevent that local processes | 1645 | ;; `outline-mode-hook'. We must prevent that local processes |
| 1648 | ;; die. Yes: I've seen `flyspell-mode', which starts "ispell". | 1646 | ;; die. Yes: I've seen `flyspell-mode', which starts "ispell". |
| @@ -2142,7 +2140,11 @@ pass to the OPERATION." | |||
| 2142 | ;; function as well but regexp only. | 2140 | ;; function as well but regexp only. |
| 2143 | (defun tramp-file-name-for-operation (operation &rest args) | 2141 | (defun tramp-file-name-for-operation (operation &rest args) |
| 2144 | "Return file name related to OPERATION file primitive. | 2142 | "Return file name related to OPERATION file primitive. |
| 2145 | ARGS are the arguments OPERATION has been called with." | 2143 | ARGS are the arguments OPERATION has been called with. |
| 2144 | |||
| 2145 | It does not always return a Tramp file name, for example if the | ||
| 2146 | first argument of `expand-file-name' is absolute and not remote. | ||
| 2147 | Must be handled by the callers." | ||
| 2146 | (cond | 2148 | (cond |
| 2147 | ;; FILE resp DIRECTORY. | 2149 | ;; FILE resp DIRECTORY. |
| 2148 | ((member operation | 2150 | ((member operation |
| @@ -2954,7 +2956,9 @@ Host is always \"localhost\"." | |||
| 2954 | (defun tramp-parse-netrc (filename) | 2956 | (defun tramp-parse-netrc (filename) |
| 2955 | "Return a list of (user host) tuples allowed to access. | 2957 | "Return a list of (user host) tuples allowed to access. |
| 2956 | User may be nil." | 2958 | User may be nil." |
| 2957 | (require 'netrc) | 2959 | ;; The declaration is not sufficient at runtime, because netrc.el is |
| 2960 | ;; not autoloaded. | ||
| 2961 | (autoload 'netrc-parse "netrc") | ||
| 2958 | (mapcar | 2962 | (mapcar |
| 2959 | (lambda (item) | 2963 | (lambda (item) |
| 2960 | (and (assoc "machine" item) | 2964 | (and (assoc "machine" item) |
| @@ -3387,6 +3391,7 @@ User is always nil." | |||
| 3387 | (access-file filename "Reading directory")) | 3391 | (access-file filename "Reading directory")) |
| 3388 | (with-parsed-tramp-file-name (expand-file-name filename) nil | 3392 | (with-parsed-tramp-file-name (expand-file-name filename) nil |
| 3389 | (with-tramp-progress-reporter v 0 (format "Opening directory %s" filename) | 3393 | (with-tramp-progress-reporter v 0 (format "Opening directory %s" filename) |
| 3394 | ;; We must load it in order to get the advice around `insert-directory'. | ||
| 3390 | (require 'ls-lisp) | 3395 | (require 'ls-lisp) |
| 3391 | (let (ls-lisp-use-insert-directory-program start) | 3396 | (let (ls-lisp-use-insert-directory-program start) |
| 3392 | (tramp-run-real-handler | 3397 | (tramp-run-real-handler |
| @@ -4879,7 +4884,6 @@ Only works for Bourne-like shells." | |||
| 4879 | ;; - Unload all `tramp-*' packages | 4884 | ;; - Unload all `tramp-*' packages |
| 4880 | ;; - Reset `file-name-handler-alist' | 4885 | ;; - Reset `file-name-handler-alist' |
| 4881 | ;; - Cleanup hooks where Tramp functions are in | 4886 | ;; - Cleanup hooks where Tramp functions are in |
| 4882 | ;; - Cleanup advised functions | ||
| 4883 | ;; - Cleanup autoloads | 4887 | ;; - Cleanup autoloads |
| 4884 | ;;;###autoload | 4888 | ;;;###autoload |
| 4885 | (defun tramp-unload-tramp () | 4889 | (defun tramp-unload-tramp () |