• Michael Albinus's avatar
    Refactor some Tramp functions · 294b2c2b
    Michael Albinus authored
    * lisp/net/tramp-compat.el (tramp-compat-file-local-name): New defsubst.
    (tramp-compat-file-name-quoted-p, tramp-compat-file-name-quote)
    (tramp-compat-file-name-unquote):
    * lisp/net/tramp.el (tramp-handle-file-name-case-insensitive-p)
    (tramp-handle-file-truename, tramp-get-remote-tmpdir):
    * lisp/net/tramp-adb.el (tramp-adb-handle-copy-file)
    (tramp-adb-handle-rename-file, tramp-adb-handle-exec-path):
    * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-directly)
    (tramp-sh-handle-exec-path, tramp-find-inline-encoding)
    (tramp-get-remote-touch): Use it.
    
    * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
    Use `tramp-handle-expand-file-name'.
    (tramp-adb-handle-expand-file-name): Move to tramp.el.
    (tramp-adb-handle-file-writable-p): Adapt docstring.
    
    * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
    Use `tramp-handle-file-local-copy', `tramp-handle-file-writable-p'
    and `tramp-handle-write-region'.
    (tramp-gvfs-handle-file-local-copy)
    (tramp-gvfs-handle-file-writable-p)
    (tramp-gvfs-handle-write-region): Move to tramp.el.
    
    * lisp/net/tramp-rclone.el: Dont't require `tramp-adb' and
    `tramp-gvfs' anymore.
    (tramp-rclone-file-name-handler-alist):
    Use `tramp-handle-expand-file-name', `tramp-handle-file-local-copy',
    `tramp-handle-file-writable-p' and `tramp-handle-write-region'.
    (tramp-rclone-handle-directory-files): Simplify.
    
    * lisp/net/tramp.el (tramp-methods): Extend docstring.
    (tramp-parse-netrc): Require `netrc'.
    (tramp-handle-expand-file-name, tramp-handle-file-local-copy)
    (tramp-handle-file-writable-p, tramp-handle-write-region): New defuns.
    294b2c2b
tramp-compat.el 11 KB