diff options
| author | Michael Albinus | 2017-11-05 20:08:05 +0100 |
|---|---|---|
| committer | Michael Albinus | 2017-11-05 20:08:05 +0100 |
| commit | ca2d94ba61dee678f85bfc7299d167e7219e6d8f (patch) | |
| tree | 10dd2860d7fc05945d738c8a2b26eaaa96caca7b /test | |
| parent | 709478eaa866e10a4600f8d8829ab8c79200d45e (diff) | |
| download | emacs-ca2d94ba61dee678f85bfc7299d167e7219e6d8f.tar.gz emacs-ca2d94ba61dee678f85bfc7299d167e7219e6d8f.zip | |
Do not load Tramp unless `tramp-mode' is non-nil
* lisp/net/tramp.el (tramp-autoload-file-name-handler): Load Tramp only if
`tramp-mode' is non-nil.
(tramp-unload-file-name-handlers): Unload also
`tramp-autoload-file-name-handler'.
* test/lisp/net/tramp-tests.el (tramp-test42-delay-load): Extend test.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index af707f85007..8eedfd72094 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -4432,23 +4432,27 @@ process sentinels. They shall not disturb each other." | |||
| 4432 | "Check that Tramp is loaded lazily, only when needed." | 4432 | "Check that Tramp is loaded lazily, only when needed." |
| 4433 | ;; Tramp is neither loaded at Emacs startup, nor when completing a | 4433 | ;; Tramp is neither loaded at Emacs startup, nor when completing a |
| 4434 | ;; non-Tramp file name like "/foo". Completing a Tramp-alike file | 4434 | ;; non-Tramp file name like "/foo". Completing a Tramp-alike file |
| 4435 | ;; name like "/foo:" autoloads Tramp. | 4435 | ;; name like "/foo:" autoloads Tramp, when `tramp-mode' is t. |
| 4436 | (let ((code | 4436 | (let ((code |
| 4437 | "(progn \ | 4437 | "(progn \ |
| 4438 | (message \"Tramp loaded: %s\" (featurep 'tramp)) \ | 4438 | (setq tramp-mode %s) \ |
| 4439 | (message \"Tramp loaded: %%s\" (featurep 'tramp)) \ | ||
| 4439 | (file-name-all-completions \"/foo\" \"/\") \ | 4440 | (file-name-all-completions \"/foo\" \"/\") \ |
| 4440 | (message \"Tramp loaded: %s\" (featurep 'tramp)) \ | 4441 | (message \"Tramp loaded: %%s\" (featurep 'tramp)) \ |
| 4441 | (file-name-all-completions \"/foo:\" \"/\") \ | 4442 | (file-name-all-completions \"/foo:\" \"/\") \ |
| 4442 | (message \"Tramp loaded: %s\" (featurep 'tramp)))")) | 4443 | (message \"Tramp loaded: %%s\" (featurep 'tramp)))")) |
| 4443 | (should | 4444 | (dolist (tm '(t nil)) |
| 4444 | (string-match | 4445 | (should |
| 4445 | "Tramp loaded: nil[\n\r]+Tramp loaded: nil[\n\r]+Tramp loaded: t[\n\r]+" | 4446 | (string-match |
| 4446 | (shell-command-to-string | 4447 | (format |
| 4447 | (format | 4448 | "Tramp loaded: nil[\n\r]+Tramp loaded: nil[\n\r]+Tramp loaded: %s[\n\r]+" |
| 4448 | "%s -batch -Q -L %s --eval %s" | 4449 | tm) |
| 4449 | (expand-file-name invocation-name invocation-directory) | 4450 | (shell-command-to-string |
| 4450 | (mapconcat 'shell-quote-argument load-path " -L ") | 4451 | (format |
| 4451 | (shell-quote-argument code))))))) | 4452 | "%s -batch -Q -L %s --eval %s" |
| 4453 | (expand-file-name invocation-name invocation-directory) | ||
| 4454 | (mapconcat 'shell-quote-argument load-path " -L ") | ||
| 4455 | (shell-quote-argument (format code tm))))))))) | ||
| 4452 | 4456 | ||
| 4453 | (ert-deftest tramp-test43-unload () | 4457 | (ert-deftest tramp-test43-unload () |
| 4454 | "Check that Tramp and its subpackages unload completely. | 4458 | "Check that Tramp and its subpackages unload completely. |