From 52dd3fcf89c441be64a94eefa01b704c9aba5090 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Thu, 17 Mar 2022 15:32:01 +0100 Subject: [PATCH] Enable Tramp reloading * lisp/net/tramp.el (tramp-file-name): Add ;;;###tramp-autoload cookie. (Bug#50869) * test/lisp/net/tramp-tests.el (tramp-test47-unload): Do not skip. Test reload. --- lisp/net/tramp.el | 5 ++++- test/lisp/net/tramp-tests.el | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 49778cbfeee..38bdfab1929 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1421,7 +1421,10 @@ calling HANDLER.") ;; internal data structure. Convenience functions for internal ;; data structure. -;; The basic structure for remote file names. +;; The basic structure for remote file names. We must autoload it in +;; tramp-loaddefs.el, because some functions, which need it, wouldn't +;; work otherwise when unloading / reloading Tramp. (Bug#50869) +;;;###tramp-autoload (cl-defstruct (tramp-file-name (:type list) :named) method user domain host port localname hop) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index afe7a740638..f34fdbdaf79 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -7265,7 +7265,6 @@ process sentinels. They shall not disturb each other." "Check that Tramp and its subpackages unload completely. Since it unloads Tramp, it shall be the last test to run." :tags '(:expensive-test) - (skip-unless noninteractive) ;; We have autoloaded objects from tramp.el and tramp-archive.el. ;; In order to remove them, we first need to load both packages. (require 'tramp) @@ -7331,7 +7330,13 @@ Since it unloads Tramp, it shall be the last test to run." (and (string-match-p "^tramp" (symbol-name fun)) (ert-fail (format "Function `%s' still contains Tramp advice" x)))) - x))))) + x)))) + + ;; Reload. + (require 'tramp) + (require 'tramp-archive) + (should (featurep 'tramp)) + (should (featurep 'tramp-archive))) (defun tramp-test-all (&optional interactive) "Run all tests for \\[tramp]. -- 2.39.2