emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 3e9ecae 1/4: Reduce autoloaded objects in Tramp


From: Michael Albinus
Subject: [Emacs-diffs] master 3e9ecae 1/4: Reduce autoloaded objects in Tramp
Date: Mon, 17 Dec 2018 06:27:22 -0500 (EST)

branch: master
commit 3e9ecaec3b17e63a3832213f10cb5299f4883172
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    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 4b839f5..4d92ae9 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;address@hidden:alnum:]]*[^#\\$]*\\)?[#\\$][[:space:]]"
   "Regexp used as prompt in almquist shell."
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 575d188..4706676 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 8526b4e..35f5c8f 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 047f410..2321617 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 4b94ab6..f1a2cd8 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 1aecebb..05715f2 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 </dev/null && \
 busybox awk '{}' </dev/null"
   "Test command for checking `tramp-awk-encode' and `tramp-awk-decode'.")
 
-(eval-and-compile
-(defconst tramp-stat-marker "/////"
-  "Marker in stat commands for file attributes."))
-
-(defconst tramp-stat-quoted-marker "\\/\\/\\/\\/\\/"
-  "Quoted marker in stat commands for file attributes.")
-
 (defconst tramp-vc-registered-read-file-names
   "echo \"(\"
 while read file; do
@@ -5092,6 +5077,7 @@ raises an error."
                  "`%s' does not return a valid Lisp expression: `%s'"
                  command (buffer-string))))))))
 
+;; FIXME: Move to tramp.el?
 ;;;###tramp-autoload
 (defun tramp-convert-file-attributes (vec attr)
   "Convert `file-attributes' ATTR generated by perl script, stat or ls.
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 0404b38..ee19f98 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -64,20 +64,17 @@
   tramp-smb-method
   '((tramp-parse-netrc "~/.netrc"))))
 
-;;;###tramp-autoload
 (defcustom tramp-smb-program "smbclient"
   "Name of SMB client to run."
   :group 'tramp
   :type 'string)
 
-;;;###tramp-autoload
 (defcustom tramp-smb-acl-program "smbcacls"
   "Name of SMB acls to run."
   :group 'tramp
   :type 'string
   :version "24.4")
 
-;;;###tramp-autoload
 (defcustom tramp-smb-conf "/dev/null"
   "Path of the smb.conf file.
 If it is nil, no smb.conf will be added to the `tramp-smb-program'
@@ -292,7 +289,6 @@ See `tramp-actions-before-shell' for more info.")
 Operations not mentioned here will be handled by the default Emacs 
primitives.")
 
 ;; Options for remote processes via winexe.
-;;;###tramp-autoload
 (defcustom tramp-smb-winexe-program "winexe"
   "Name of winexe client to run.
 If it isn't found in the local $PATH, the absolute path of winexe
@@ -301,7 +297,6 @@ shall be given.  This is needed for remote processes."
   :type 'string
   :version "24.3")
 
-;;;###tramp-autoload
 (defcustom tramp-smb-winexe-shell-command "powershell.exe"
   "Shell to be used for processes on remote machines.
 This must be Powershell V2 compatible."
@@ -309,7 +304,6 @@ This must be Powershell V2 compatible."
   :type 'string
   :version "24.3")
 
-;;;###tramp-autoload
 (defcustom tramp-smb-winexe-shell-command-switch "-file -"
   "Command switch used together with `tramp-smb-winexe-shell-command'.
 This can be used to disable echo etc."
diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el
index 07ae868..08fc79d 100644
--- a/lisp/net/tramp-sudoedit.el
+++ b/lisp/net/tramp-sudoedit.el
@@ -35,8 +35,6 @@
 ;;; Code:
 
 (require 'tramp)
-(eval-when-compile (require 'tramp-sh)) ;For tramp-stat-marker
-(require 'server)
 
 ;;;###tramp-autoload
 (defconst tramp-sudoedit-method "sudoedit"
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 78f1e28..cf7c51f 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -76,6 +76,9 @@
   :version "22.1")
 
 (eval-and-compile ;; So it's also available in tramp-loaddefs.el!
+  (defvar tramp--startup-hook nil
+    "Forms to be executed at the end of tramp.el.")
+
   (defmacro tramp--with-startup (&rest body)
     "Schedule BODY to be executed at the end of tramp.el."
     `(add-hook 'tramp--startup-hook (lambda () ,@body))))
@@ -3831,6 +3834,13 @@ of."
       (tramp-message v 0 "Wrote %s" filename))
     (run-hooks 'tramp-handle-write-region-hook)))
 
+;; This is used in tramp-sh.el and tramp-sudoedit.el.
+(defconst tramp-stat-marker "/////"
+  "Marker in stat commands for file attributes.")
+
+(defconst tramp-stat-quoted-marker "\\/\\/\\/\\/\\/"
+  "Quoted marker in stat commands for file attributes.")
+
 ;; This is used in tramp-gvfs.el and tramp-sh.el.
 (defconst tramp-gio-events
   '("attribute-changed" "changed" "changes-done-hint"
diff --git a/test/lisp/net/tramp-archive-tests.el 
b/test/lisp/net/tramp-archive-tests.el
index e759786..f902ed5 100644
--- a/test/lisp/net/tramp-archive-tests.el
+++ b/test/lisp/net/tramp-archive-tests.el
@@ -24,6 +24,8 @@
 
 (require 'ert)
 (require 'tramp-archive)
+(defvar tramp-copy-size-limit)
+(defvar tramp-persistency-file-name)
 
 (defconst tramp-archive-test-resource-directory
   (let ((default-directory
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 056b6ce..57b67a0 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -57,8 +57,12 @@
 (declare-function tramp-method-out-of-band-p "tramp-sh")
 (declare-function tramp-smb-get-localname "tramp-smb")
 (defvar auto-save-file-name-transforms)
+(defvar tramp-connection-properties)
 (defvar tramp-copy-size-limit)
+(defvar tramp-display-escape-sequence-regexp)
+(defvar tramp-inline-compress-start-size)
 (defvar tramp-persistency-file-name)
+(defvar tramp-remote-path)
 (defvar tramp-remote-process-environment)
 
 ;; Beautify batch mode.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]