From 3e9ecaec3b17e63a3832213f10cb5299f4883172 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 17 Dec 2018 11:50:06 +0100 Subject: [PATCH] Reduce autoloaded objects in Tramp * lisp/net/tramp-adb.el (tramp-adb-program) (tramp-adb-connect-if-not-connected, tramp-adb-prompt): Remove autoload cookie. * lisp/net/tramp-cache.el (tramp-connection-properties) (tramp-persistency-file-name): Remove autoload cookie. * lisp/net/tramp-ftp.el (tramp-ftp-enable-ange-ftp): Use `tramp-autoload' cookie. * lisp/net/tramp-gvfs.el (tramp-gvfs-zeroconf-domain): Remove autoload cookie. * lisp/net/tramp-rclone.el (tramp-rclone-program): Remove autoload cookie. (tramp-set-completion-function): Use `tramp--with-startup'. * lisp/net/tramp-sh.el (tramp-inline-compress-start-size) (tramp-copy-size-limit, tramp-histfile-override) (tramp-use-ssh-controlmaster-options, tramp-remote-path) (tramp-remote-process-environment, tramp-sh-extra-args): Remove autoload cookie. (tramp-stat-marker, tramp-stat-quoted-marker): Move to tramp.el. * lisp/net/tramp-smb.el (tramp-smb-program) (tramp-smb-acl-program, tramp-smb-conf) (tramp-smb-winexe-program, tramp-smb-winexe-shell-command) (tramp-smb-winexe-shell-command-switch): Remove autoload cookie. * lisp/net/tramp-sudoedit.el (server, tramp-sh): Do not require. * lisp/net/tramp.el (tramp--startup-hook): Define. (tramp-stat-marker, tramp-stat-quoted-marker): New defconsts, taken from tramp-sh.el. * test/lisp/net/tramp-archive-tests.el (tramp-copy-size-limit) (tramp-persistency-file-name): Declare. * test/lisp/net/tramp-tests.el (tramp-connection-properties) (tramp-display-escape-sequence-regexp) (tramp-inline-compress-start-size, tramp-remote-path): Declare. --- lisp/net/tramp-adb.el | 3 --- lisp/net/tramp-cache.el | 2 -- lisp/net/tramp-ftp.el | 2 +- lisp/net/tramp-gvfs.el | 1 - lisp/net/tramp-rclone.el | 7 +++---- lisp/net/tramp-sh.el | 16 +--------------- lisp/net/tramp-smb.el | 6 ------ lisp/net/tramp-sudoedit.el | 2 -- lisp/net/tramp.el | 10 ++++++++++ test/lisp/net/tramp-archive-tests.el | 2 ++ test/lisp/net/tramp-tests.el | 4 ++++ 11 files changed, 21 insertions(+), 34 deletions(-) diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 4b839f5e2b7..4d92ae91fa5 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -35,14 +35,12 @@ (require 'tramp) -;;;###tramp-autoload (defcustom tramp-adb-program "adb" "Name of the Android Debug Bridge program." :group 'tramp :version "24.4" :type 'string) -;;;###tramp-autoload (defcustom tramp-adb-connect-if-not-connected nil "Try to run `adb connect' if provided device is not connected currently. It is used for TCP/IP devices." @@ -54,7 +52,6 @@ It is used for TCP/IP devices." (defconst tramp-adb-method "adb" "When this method name is used, forward all calls to Android Debug Bridge.") -;;;###tramp-autoload (defcustom tramp-adb-prompt "^\\(?:[[:digit:]]*|?\\)?\\(?:[[:alnum:]\e;[]*@?[[:alnum:]]*[^#\\$]*\\)?[#\\$][[:space:]]" "Regexp used as prompt in almquist shell." diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 575d188c05f..47066760fb6 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -72,7 +72,6 @@ (defvar tramp-cache-data (make-hash-table :test 'equal) "Hash table for remote files properties.") -;;;###tramp-autoload (defcustom tramp-connection-properties nil "List of static connection properties. Every entry has the form (REGEXP PROPERTY VALUE). The regexp @@ -86,7 +85,6 @@ details see the info pages." (choice :tag " Property" string) (choice :tag " Value" sexp)))) -;;;###tramp-autoload (defcustom tramp-persistency-file-name (expand-file-name (locate-user-emacs-file "tramp")) "File which keeps connection history for Tramp connections." diff --git a/lisp/net/tramp-ftp.el b/lisp/net/tramp-ftp.el index 8526b4e2178..35f5c8f4da4 100644 --- a/lisp/net/tramp-ftp.el +++ b/lisp/net/tramp-ftp.el @@ -57,7 +57,7 @@ present for backward compatibility." '(when (functionp 'tramp-disable-ange-ftp) (tramp-disable-ange-ftp))) -;;;###autoload +;;;###tramp-autoload (defun tramp-ftp-enable-ange-ftp () "Reenable Ange-FTP, when Tramp is unloaded." ;; The following code is commented out in Ange-FTP. diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 047f4109d7d..2321617b0ac 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -155,7 +155,6 @@ (add-to-list 'tramp-default-host-alist '("\\`gdrive\\'" nil ,(match-string 2 user-mail-address))))) -;;;###tramp-autoload (defcustom tramp-gvfs-zeroconf-domain "local" "Zeroconf domain to be used for discovering services, like host names." :group 'tramp diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el index 4b94ab6bdc7..f1a2cd81c67 100644 --- a/lisp/net/tramp-rclone.el +++ b/lisp/net/tramp-rclone.el @@ -42,7 +42,6 @@ (defconst tramp-rclone-method "rclone" "When this method name is used, forward all calls to rclone mounts.") -;;;###tramp-autoload (defcustom tramp-rclone-program "rclone" "Name of the rclone program." :group 'tramp @@ -60,9 +59,9 @@ (tramp-about-args ("--full"))))) ;;;###tramp-autoload -(eval-after-load 'tramp - '(tramp-set-completion-function - tramp-rclone-method '((tramp-rclone-parse-device-names "")))) +(tramp--with-startup + (tramp-set-completion-function + tramp-rclone-method '((tramp-rclone-parse-device-names "")))) ;; New handlers should be added here. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 1aecebb37f4..05715f2477f 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -41,8 +41,6 @@ (defvar vc-git-program) (defvar vc-hg-program) -;; FIXME: Why autoload all those defcustoms? -;;;###tramp-autoload (defcustom tramp-inline-compress-start-size 4096 "The minimum size of compressing where inline transfer. When inline transfer, compress transferred data of file @@ -51,7 +49,6 @@ If it is nil, no compression at all will be applied." :group 'tramp :type '(choice (const nil) integer)) -;;;###tramp-autoload (defcustom tramp-copy-size-limit 10240 "The maximum file size where inline copying is preferred over an \ out-of-the-band copy. @@ -68,7 +65,6 @@ files conditionalize this setup based on the TERM environment variable." :group 'tramp :type 'string) -;;;###tramp-autoload (defcustom tramp-histfile-override "~/.tramp_history" "When invoking a shell, override the HISTFILE with this value. When setting to a string, it redirects the shell history to that @@ -110,7 +106,6 @@ detected as prompt when being sent on echoing hosts, therefore.") (defconst tramp-end-of-heredoc (md5 tramp-end-of-output) "String used to recognize end of heredoc strings.") -;;;###tramp-autoload (defcustom tramp-use-ssh-controlmaster-options t "Whether to use `tramp-ssh-controlmaster-options'." :group 'tramp @@ -471,7 +466,6 @@ The string is used in `tramp-methods'.") ;; Darwin: /usr/bin:/bin:/usr/sbin:/sbin ;; IRIX64: /usr/bin ;; QNAP QTS: --- -;;;###tramp-autoload (defcustom tramp-remote-path '(tramp-default-remote-path "/bin" "/usr/bin" "/sbin" "/usr/sbin" "/usr/local/bin" "/usr/local/sbin" "/local/bin" "/local/freeware/bin" @@ -501,7 +495,6 @@ the list by the special value `tramp-own-remote-path'." (const :tag "Private Directories" tramp-own-remote-path) (string :tag "Directory")))) -;;;###tramp-autoload (defcustom tramp-remote-process-environment '("ENV=''" "TMOUT=0" "LC_CTYPE=''" "CDPATH=" "HISTORY=" "MAIL=" "MAILCHECK=" "MAILPATH=" "PAGER=cat" @@ -525,7 +518,6 @@ based on the Tramp and Emacs versions, and should not be set here." :version "26.1" :type '(repeat string)) -;;;###tramp-autoload (defcustom tramp-sh-extra-args '(("/bash\\'" . "-norc -noprofile")) "Alist specifying extra arguments to pass to the remote shell. Entries are (REGEXP . ARGS) where REGEXP is a regular expression @@ -920,13 +912,6 @@ od -v -t x1 -A n