(eval-when-compile (require 'cl-lib))
(require 'tramp)
-
(require 'dbus)
(require 'url-parse)
(require 'url-util)
-(require 'zeroconf)
;; Pacify byte-compiler.
(eval-when-compile
(require 'custom))
+(declare-function zeroconf-init "zeroconf")
+(declare-function zeroconf-list-service-types "zeroconf")
+(declare-function zeroconf-list-services "zeroconf")
+(declare-function zeroconf-service-host "zeroconf")
+(declare-function zeroconf-service-port "zeroconf")
+(declare-function zeroconf-service-txt "zeroconf")
+
;; We don't call `dbus-ping', because this would load dbus.el.
(defconst tramp-gvfs-enabled
(ignore-errors
;; Pacify byte-compiler.
(require 'cl-lib)
+(declare-function recentf-cleanup "recentf")
(declare-function tramp-dissect-file-name "tramp")
(declare-function tramp-file-name-equal-p "tramp")
(declare-function tramp-tramp-file-p "tramp")
-(declare-function recentf-cleanup "recentf")
(defvar eshell-path-env)
(defvar recentf-exclude)
(defvar tramp-current-connection)
(get-buffer-create (tramp-debug-buffer-name vec))
(when (bobp)
(setq buffer-undo-list t)
- ;; So it does not get loaded while `outline-regexp' is let-bound.
- (require 'outline)
;; Activate `outline-mode'. This runs `text-mode-hook' and
;; `outline-mode-hook'. We must prevent that local processes
;; die. Yes: I've seen `flyspell-mode', which starts "ispell".
;; function as well but regexp only.
(defun tramp-file-name-for-operation (operation &rest args)
"Return file name related to OPERATION file primitive.
-ARGS are the arguments OPERATION has been called with."
+ARGS are the arguments OPERATION has been called with.
+
+It does not always return a Tramp file name, for example if the
+first argument of `expand-file-name' is absolute and not remote.
+Must be handled by the callers."
(cond
;; FILE resp DIRECTORY.
((member operation
(defun tramp-parse-netrc (filename)
"Return a list of (user host) tuples allowed to access.
User may be nil."
- (require 'netrc)
+ ;; The declaration is not sufficient at runtime, because netrc.el is
+ ;; not autoloaded.
+ (autoload 'netrc-parse "netrc")
(mapcar
(lambda (item)
(and (assoc "machine" item)
(access-file filename "Reading directory"))
(with-parsed-tramp-file-name (expand-file-name filename) nil
(with-tramp-progress-reporter v 0 (format "Opening directory %s" filename)
+ ;; We must load it in order to get the advice around `insert-directory'.
(require 'ls-lisp)
(let (ls-lisp-use-insert-directory-program start)
(tramp-run-real-handler
;; - Unload all `tramp-*' packages
;; - Reset `file-name-handler-alist'
;; - Cleanup hooks where Tramp functions are in
-;; - Cleanup advised functions
;; - Cleanup autoloads
;;;###autoload
(defun tramp-unload-tramp ()