summaryrefslogtreecommitdiff
path: root/lisp/net/tramp-compat.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2018-12-16 10:32:53 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2018-12-16 10:32:53 -0500
commit07d8827946f9364180f18d6842acc80f0997ed75 (patch)
tree53a43e103081c815c3377475f187ffb5347cfb5e /lisp/net/tramp-compat.el
parente8199e765f81968be840d8e7e3978f5974c1be9d (diff)
downloademacs-07d8827946f9364180f18d6842acc80f0997ed75.tar.gz
* lisp/net/tramp: Rework mutual dependencies
Functionally split tramp-loaddefs.el into two parts: one part run while loading it at the very beginning of loading tramp.el (holding plain autoloads and declarations), and another run at the very end of loading tramp.el (holding setup code). This should reduce infinite-recursion problems while loading. * lisp/net/tramp.el: Require tramp-loaddefs at beginning. Run (new and internal) tramp--startup-hook at the end. Remove all tramp-autoloads. Prefer tramp--with-startup over eval-after-load. (tramp--with-startup): New macro. (tramp-set-syntax): Show the new value rather than the old value in the error message. (tramp-syntax-values): Explicitly return 'values'. (tramp-prefix-format, tramp-prefix-regexp, tramp-method-regexp) (tramp-postfix-method-format, tramp-postfix-method-regexp) (tramp-prefix-ipv6-format, tramp-prefix-ipv6-regexp) (tramp-postfix-ipv6-format, tramp-postfix-ipv6-regexp) (tramp-postfix-host-format, tramp-postfix-host-regexp) (tramp-remote-file-name-spec-regexp, tramp-file-name-structure) (tramp-completion-file-name-regexp): Don't initialize in the declaration, since it's recomputed at the end anyway. (tramp-time-dont-know, tramp-time-doesnt-exist): Move before first use. * lisp/net/tramp-compat.el: Don't require tramp-loaddefs any more. (tramp-compat-tramp-syntax): Declare tramp-syntax. * lisp/net/tramp-smb.el: * lisp/net/tramp-rclone.el: * lisp/net/tramp-gvfs.el: * lisp/net/tramp-ftp.el: * lisp/net/tramp-adb.el: Wrap all autoloaded setup operations within tramp--with-startup. * lisp/net/tramp-sh.el: Wrap all autoloaded setup operations within tramp--with-startup. (tramp-display-escape-sequence-regexp) (tramp-device-escape-sequence-regexp): Don't tramp-autoload any more. (tramp-stat-marker): Use eval-and-compile rather than tramp-autoload. * lisp/net/tramp-sudoedit.el: Wrap all autoloaded setup operations within tramp--with-startup. Require tramp-sh at compile-time to precompute some regexps based on tramp-stat-marker.
Diffstat (limited to 'lisp/net/tramp-compat.el')
-rw-r--r--lisp/net/tramp-compat.el3
1 files changed, 1 insertions, 2 deletions
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index 046966e0190..df0e0887b4a 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -45,8 +45,6 @@
(require 'timer)
(require 'ucs-normalize)
-(require 'tramp-loaddefs)
-
;; For not existing functions, obsolete functions, or functions with a
;; changed argument list, there are compiler warnings. We want to
;; avoid them in cases we know what we do.
@@ -230,6 +228,7 @@ If NAME is a remote file name, the local part of NAME is unquoted."
;; support old settings.
(defsubst tramp-compat-tramp-syntax ()
"Return proper value of `tramp-syntax'."
+ (defvar tramp-syntax)
(cond ((eq tramp-syntax 'ftp) 'default)
((eq tramp-syntax 'sep) 'separate)
(t tramp-syntax)))