]> git.eshelyaron.com Git - emacs.git/commitdiff
Add autoload problem in tramp-crypt.el.
authorMichael Albinus <michael.albinus@gmx.de>
Mon, 8 Jun 2020 08:18:35 +0000 (10:18 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Mon, 8 Jun 2020 08:18:35 +0000 (10:18 +0200)
* lisp/net/tramp-crypt.el (tramp-crypt-encfs-config):
Add ;;;###tramp-autoload cookie.
(tramp-crypt-directories): Move it up.
(tramp-crypt-file-name-p): Move it up.  Add ;;;###tramp-autoload
cookie.  Make it a defsubst.

* test/lisp/net/tramp-tests.el (tramp-crypt): Do not require.

lisp/net/tramp-crypt.el
test/lisp/net/tramp-tests.el

index 1df38c3121b6a02e0ca1c1bbb329ea03c24d183e..220a4add91f1b33e874565f6bf7f2a15bc45bc37 100644 (file)
@@ -114,6 +114,7 @@ initializing a new crypted remote directory."
   "Non-nil when encryption support is available.")
 (setq tramp-crypt-enabled (executable-find tramp-crypt-encfs-program))
 
+;;;###tramp-autoload
 (defconst tramp-crypt-encfs-config ".encfs6.xml"
   "Encfs configuration file name.")
 
@@ -123,6 +124,25 @@ initializing a new crypted remote directory."
   :version "28.1"
   :type 'booleanp)
 
+;;;###tramp-autoload
+(defvar tramp-crypt-directories nil
+  "List of crypted remote directories.")
+
+;; It must be a `defsubst' in order to push the whole code into
+;; tramp-loaddefs.el.  Otherwise, there would be recursive autoloading.
+;;;###tramp-autoload
+(defsubst tramp-crypt-file-name-p (name)
+  "Return the crypted remote directory NAME belongs to.
+If NAME doesn't belong to a crypted remote directory, retun nil."
+  (catch 'crypt-file-name-p
+    (and tramp-crypt-enabled (stringp name)
+        (not (tramp-compat-file-name-quoted-p name))
+        (not (string-suffix-p tramp-crypt-encfs-config name))
+        (dolist (dir tramp-crypt-directories)
+          (and (string-prefix-p
+                dir (file-name-as-directory (expand-file-name name)))
+               (throw  'crypt-file-name-p dir))))))
+
 \f
 ;; New handlers should be added here.
 ;;;###tramp-autoload
@@ -249,22 +269,6 @@ arguments to pass to the OPERATION."
 \f
 ;; File name conversions.
 
-;;;###tramp-autoload
-(defvar tramp-crypt-directories nil
-  "List of crypted remote directories.")
-
-(defun tramp-crypt-file-name-p (name)
-  "Return the crypted remote directory NAME belongs to.
-If NAME doesn't belong to a crypted remote directory, retun nil."
-  (catch 'crypt-file-name-p
-    (and tramp-crypt-enabled (stringp name)
-        (not (tramp-compat-file-name-quoted-p name))
-        (not (string-suffix-p tramp-crypt-encfs-config name))
-        (dolist (dir tramp-crypt-directories)
-          (and (string-prefix-p
-                dir (file-name-as-directory (expand-file-name name)))
-               (throw  'crypt-file-name-p dir))))))
-
 (defun tramp-crypt-config-file-name (vec)
   "Return the encfs config file name for VEC."
   (expand-file-name
index 25faf4e0fba1fd76f2d53c4ae05a7919bd501550..7faa409f2f09f8098455651882ba83153efd4f3f 100644 (file)
@@ -5595,8 +5595,6 @@ This does not support some special file names."
   (string-equal
    "docker" (file-remote-p tramp-test-temporary-file-directory 'method)))
 
-(require 'tramp-crypt)
-
 (defun tramp--test-crypt-p ()
   "Check, whether the remote directory is crypted"
   (tramp-crypt-file-name-p tramp-test-temporary-file-directory))