emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/tramp 3b40cc5: Tramp ELPA version 2.5.0.1 released


From: Michael Albinus
Subject: [elpa] externals/tramp 3b40cc5: Tramp ELPA version 2.5.0.1 released
Date: Fri, 29 Jan 2021 09:54:03 -0500 (EST)

branch: externals/tramp
commit 3b40cc5cf51dfb584826b9862f352acb4f560a63
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>

    Tramp ELPA version 2.5.0.1 released
---
 test/tramp-tests.el  | 287 ++++++++++++++++++++++++++++++++++-----------------
 texi/tramp.texi      |  64 +++++++++---
 texi/trampver.texi   |   4 +-
 tramp-adb.el         |  18 +++-
 tramp-archive.el     |   2 +-
 tramp-cache.el       |   2 +-
 tramp-cmds.el        |   2 +-
 tramp-compat.el      |   2 +-
 tramp-crypt.el       |   2 +-
 tramp-ftp.el         |   2 +-
 tramp-gvfs.el        |   2 +-
 tramp-integration.el |   2 +-
 tramp-rclone.el      |   2 +-
 tramp-sh.el          | 190 ++++++++++++++++++----------------
 tramp-smb.el         |  26 ++---
 tramp-sudoedit.el    |   2 +-
 tramp-uu.el          |   2 +-
 tramp.el             |  47 ++++++---
 trampver.el          |   8 +-
 19 files changed, 411 insertions(+), 255 deletions(-)

diff --git a/test/tramp-tests.el b/test/tramp-tests.el
index c709337..982d85e 100644
--- a/test/tramp-tests.el
+++ b/test/tramp-tests.el
@@ -1,6 +1,6 @@
 ;;; tramp-tests.el --- Tests of remote file access  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 
@@ -78,6 +78,8 @@
 ;; Needed for Emacs 27.
 (defvar process-file-return-signal-string)
 (defvar shell-command-dont-erase-buffer)
+;; Needed for Emacs 28.
+(defvar dired-copy-dereference)
 
 ;; Beautify batch mode.
 (when noninteractive
@@ -98,7 +100,6 @@
        '("mock"
         (tramp-login-program        "sh")
         (tramp-login-args           (("-i")))
-        (tramp-direct-async-args    (("-c")))
         (tramp-remote-shell         "/bin/sh")
         (tramp-remote-shell-args    ("-c"))
         (tramp-connection-timeout   10)))
@@ -2271,8 +2272,8 @@ This checks also `file-name-as-directory', 
`file-name-directory',
       (delete-file tmp-name)
       (should-not (file-exists-p tmp-name))
 
-      ;; Trashing files doesn't work for crypted remote files.
-      (unless (tramp--test-crypt-p)
+      ;; Trashing files doesn't work on MS Windows, and for crypted remote 
files.
+      (unless (or (tramp--test-windows-nt-p) (tramp--test-crypt-p))
        (let ((trash-directory (tramp--test-make-temp-name 'local quoted))
              (delete-by-moving-to-trash t))
          (make-directory trash-directory)
@@ -2438,7 +2439,7 @@ This checks also `file-name-as-directory', 
`file-name-directory',
                      ;; We must check the last line.  There could be
                      ;; other messages from the progress reporter.
                      (should
-                      (string-match
+                      (string-match-p
                        (if (and (null noninteractive)
                                 (or (eq visit t) (null visit) (stringp visit)))
                            (format "^Wrote %s\n\\'" (regexp-quote tmp-name))
@@ -2785,9 +2786,9 @@ This tests also `file-directory-p' and 
`file-accessible-directory-p'."
       (should-not (file-directory-p tmp-name1))
 
       ;; Trashing directories works only since Emacs 27.1.  It doesn't
-      ;; work for crypted remote directories and for ange-ftp.
-      (when (and (not (tramp--test-crypt-p)) (not (tramp--test-ftp-p))
-                (tramp--test-emacs27-p))
+      ;; work on MS Windows, for crypted remote directories and for ange-ftp.
+      (when (and (not  (tramp--test-windows-nt-p)) (not (tramp--test-crypt-p))
+                (not (tramp--test-ftp-p)) (tramp--test-emacs27-p))
        (let ((trash-directory (tramp--test-make-temp-name 'local quoted))
              (delete-by-moving-to-trash t))
          (make-directory trash-directory)
@@ -2833,6 +2834,7 @@ This tests also `file-directory-p' and 
`file-accessible-directory-p'."
 (ert-deftest tramp-test15-copy-directory ()
   "Check `copy-directory'."
   (skip-unless (tramp--test-enabled))
+  (skip-unless (or (tramp--test-emacs26-p) (not (tramp--test-rclone-p))))
 
   (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
     (let* ((tmp-name1 (tramp--test-make-temp-name nil quoted))
@@ -3067,9 +3069,7 @@ This tests also `file-directory-p' and 
`file-accessible-directory-p'."
                  (regexp-opt (directory-files tmp-name1))
                  (length (directory-files tmp-name1)))))))
 
-           ;; Check error case.  We do not check for the error type,
-           ;; because ls-lisp returns `file-error', and native Tramp
-           ;; returns `file-missing'.
+           ;; Check error case.
            (delete-directory tmp-name1 'recursive)
            (with-temp-buffer
              (should-error
@@ -3188,6 +3188,61 @@ This tests also `file-directory-p' and 
`file-accessible-directory-p'."
        (ignore-errors (delete-directory tmp-name1 'recursive))
        (ignore-errors (delete-directory tmp-name2 'recursive))))))
 
+;; The following test is inspired by Bug#45691.
+(ert-deftest tramp-test17-insert-directory-one-file ()
+  "Check `insert-directory' inside directory listing."
+  (skip-unless (tramp--test-enabled))
+  ;; Relative file names in dired are not supported in tramp-crypt.el.
+  (skip-unless (not (tramp--test-crypt-p)))
+
+  (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
+    (let* ((tmp-name1
+           (expand-file-name (tramp--test-make-temp-name nil quoted)))
+          (tmp-name2 (expand-file-name "foo" tmp-name1))
+          (tmp-name3 (expand-file-name "bar" tmp-name1))
+          (dired-copy-preserve-time t)
+          (dired-recursive-copies 'top)
+          dired-copy-dereference
+          buffer)
+      (unwind-protect
+         (progn
+           (make-directory tmp-name1)
+           (write-region "foo" nil tmp-name2)
+           (should (file-directory-p tmp-name1))
+           (should (file-exists-p tmp-name2))
+
+           ;; Check, that `insert-directory' works properly.
+           (with-current-buffer
+               (setq buffer (dired-noselect tmp-name1 "--dired -al"))
+             (read-only-mode -1)
+             (goto-char (point-min))
+             (while (not (or (eobp)
+                             (string-equal
+                              (dired-get-filename 'localp 'no-error)
+                              (file-name-nondirectory tmp-name2))))
+               (forward-line 1))
+             (should-not (eobp))
+             (copy-file tmp-name2 tmp-name3)
+             (insert-directory
+              (file-name-nondirectory tmp-name3) "--dired -al -d")
+             ;; Point shall still be the recent file.
+             (should
+              (string-equal
+               (dired-get-filename 'localp 'no-error)
+               (file-name-nondirectory tmp-name2)))
+             (should-not (re-search-forward "dired" nil t))
+             ;; The copied file has been inserted the line before.
+             (forward-line -1)
+             (should
+              (string-equal
+               (dired-get-filename 'localp 'no-error)
+               (file-name-nondirectory tmp-name3))))
+           (kill-buffer buffer))
+
+       ;; Cleanup.
+       (ignore-errors (kill-buffer buffer))
+       (ignore-errors (delete-directory tmp-name1 'recursive))))))
+
 ;; Method "smb" supports `make-symbolic-link' only if the remote host
 ;; has CIFS capabilities.  tramp-adb.el, tramp-gvfs.el and
 ;; tramp-rclone.el do not support symbolic links at all.
@@ -3561,8 +3616,8 @@ This tests also `file-executable-p', `file-writable-p' 
and `set-file-modes'."
   `(condition-case err
        (progn ,@body)
      (file-error
-      (unless (string-match "^error with add-name-to-file"
-                           (error-message-string err))
+      (unless (string-match-p "^error with add-name-to-file"
+                             (error-message-string err))
        (signal (car err) (cdr err))))))
 
 (ert-deftest tramp-test21-file-links ()
@@ -4337,7 +4392,7 @@ This tests also `make-symbolic-link', `file-truename' and 
`add-name-to-file'."
            ;; there's an indication for a signal describing string.
            (let ((process-file-return-signal-string t))
              (should
-              (string-match
+              (string-match-p
                "Interrupt\\|Signal 2"
                (process-file
                 (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh")
@@ -4405,7 +4460,7 @@ This tests also `make-symbolic-link', `file-truename' and 
`add-name-to-file'."
            (with-timeout (10 (tramp--test-timeout-handler))
              (while (< (- (point-max) (point-min)) (length "foo"))
                (while (accept-process-output proc 0 nil t))))
-           (should (string-match "foo" (buffer-string))))
+           (should (string-match-p "foo" (buffer-string))))
 
        ;; Cleanup.
        (ignore-errors (delete-process proc)))
@@ -4424,7 +4479,7 @@ This tests also `make-symbolic-link', `file-truename' and 
`add-name-to-file'."
            (with-timeout (10 (tramp--test-timeout-handler))
              (while (< (- (point-max) (point-min)) (length "foo"))
                (while (accept-process-output proc 0 nil t))))
-           (should (string-match "foo" (buffer-string))))
+           (should (string-match-p "foo" (buffer-string))))
 
        ;; Cleanup.
        (ignore-errors
@@ -4446,7 +4501,7 @@ This tests also `make-symbolic-link', `file-truename' and 
`add-name-to-file'."
            (with-timeout (10 (tramp--test-timeout-handler))
              (while (< (- (point-max) (point-min)) (length "foo"))
                (while (accept-process-output proc 0 nil t))))
-           (should (string-match "foo" (buffer-string))))
+           (should (string-match-p "foo" (buffer-string))))
 
        ;; Cleanup.
        (ignore-errors (delete-process proc)))
@@ -4488,8 +4543,6 @@ If UNSTABLE is non-nil, the test is tagged as 
`:unstable'."
              (cons '(nil "direct-async-process" t)
                    tramp-connection-properties)))
         (skip-unless (tramp-direct-async-process-p))
-        ;; For whatever reason, it doesn't cooperate with the "mock" method.
-        (skip-unless (not (tramp--test-mock-p)))
         ;; We do expect an established connection already,
         ;; `file-truename' does it by side-effect.  Suppress
         ;; `tramp--test-enabled', in order to keep the connection.
@@ -4535,7 +4588,7 @@ If UNSTABLE is non-nil, the test is tagged as 
`:unstable'."
            (with-timeout (10 (tramp--test-timeout-handler))
              (while (< (- (point-max) (point-min)) (length "foo"))
                (while (accept-process-output proc 0 nil t))))
-           (should (string-match "foo" (buffer-string))))
+           (should (string-match-p "foo" (buffer-string))))
 
        ;; Cleanup.
        (ignore-errors (delete-process proc)))
@@ -4556,7 +4609,7 @@ If UNSTABLE is non-nil, the test is tagged as 
`:unstable'."
            (with-timeout (10 (tramp--test-timeout-handler))
              (while (< (- (point-max) (point-min)) (length "foo"))
                (while (accept-process-output proc 0 nil t))))
-           (should (string-match "foo" (buffer-string))))
+           (should (string-match-p "foo" (buffer-string))))
 
        ;; Cleanup.
        (ignore-errors
@@ -4580,9 +4633,9 @@ If UNSTABLE is non-nil, the test is tagged as 
`:unstable'."
            (process-send-eof proc)
            ;; Read output.
            (with-timeout (10 (tramp--test-timeout-handler))
-             (while (not (string-match "foo" (buffer-string)))
+             (while (not (string-match-p "foo" (buffer-string)))
                (while (accept-process-output proc 0 nil t))))
-           (should (string-match "foo" (buffer-string))))
+           (should (string-match-p "foo" (buffer-string))))
 
        ;; Cleanup.
        (ignore-errors (delete-process proc)))
@@ -4607,7 +4660,7 @@ If UNSTABLE is non-nil, the test is tagged as 
`:unstable'."
            (with-timeout (10 (tramp--test-timeout-handler))
              (while (accept-process-output proc 0 nil t)))
            ;; On some MS Windows systems, it returns "unknown signal".
-           (should (string-match "unknown signal\\|killed" (buffer-string))))
+           (should (string-match-p "unknown signal\\|killed" (buffer-string))))
 
        ;; Cleanup.
        (ignore-errors (delete-process proc)))
@@ -4631,7 +4684,7 @@ If UNSTABLE is non-nil, the test is tagged as 
`:unstable'."
                (delete-process proc)
                (with-current-buffer stderr
                  (should
-                  (string-match
+                  (string-match-p
                    "cat:.* No such file or directory" (buffer-string)))))
 
            ;; Cleanup.
@@ -4658,7 +4711,7 @@ If UNSTABLE is non-nil, the test is tagged as 
`:unstable'."
                (with-temp-buffer
                  (insert-file-contents tmpfile)
                  (should
-                  (string-match
+                  (string-match-p
                    "cat:.* No such file or directory" (buffer-string)))))
 
            ;; Cleanup.
@@ -4670,7 +4723,7 @@ If UNSTABLE is non-nil, the test is tagged as 
`:unstable'."
 
 (ert-deftest tramp-test31-interrupt-process ()
   "Check `interrupt-process'."
-  :tags (if (getenv "EMACS_EMBA_CI")
+  :tags (if (or (getenv "EMACS_HYDRA_CI") (getenv "EMACS_EMBA_CI"))
            '(:expensive-test :unstable) '(:expensive-test))
   (skip-unless (tramp--test-enabled))
   (skip-unless (tramp--test-sh-p))
@@ -4801,7 +4854,7 @@ INPUT, if non-nil, is a string sent to the process."
            (should
             (string-equal
              ;; tramp-adb.el echoes, so we must add the string.
-             (if (tramp--test-adb-p)
+             (if (and (tramp--test-adb-p) (not (tramp-direct-async-process-p)))
                  (format
                   "%s\n%s\n"
                   (file-name-nondirectory tmp-name)
@@ -4992,7 +5045,7 @@ INPUT, if non-nil, is a string sent to the process."
             (cons (concat envvar "=foo") process-environment)))
        ;; Default value.
        (should
-        (string-match
+        (string-match-p
          "foo"
          (funcall
           this-shell-command-to-string
@@ -5003,13 +5056,13 @@ INPUT, if non-nil, is a string sent to the process."
             (cons (concat envvar "=") process-environment)))
        ;; Value is null.
        (should
-        (string-match
+        (string-match-p
          "bla"
          (funcall
           this-shell-command-to-string (format "echo \"${%s:-bla}\"" envvar))))
        ;; Variable is set.
        (should
-        (string-match
+        (string-match-p
          (regexp-quote envvar)
          (funcall this-shell-command-to-string "set"))))
 
@@ -5021,7 +5074,7 @@ INPUT, if non-nil, is a string sent to the process."
               (cons (concat envvar "=foo") tramp-remote-process-environment)))
          ;; Set the initial value, we want to unset below.
          (should
-          (string-match
+          (string-match-p
            "foo"
            (funcall
             this-shell-command-to-string
@@ -5029,14 +5082,14 @@ INPUT, if non-nil, is a string sent to the process."
          (let ((process-environment (cons envvar process-environment)))
            ;; Variable is unset.
            (should
-            (string-match
+            (string-match-p
              "bla"
              (funcall
               this-shell-command-to-string
               (format "echo \"${%s:-bla}\"" envvar))))
            ;; Variable is unset.
            (should-not
-            (string-match
+            (string-match-p
              (regexp-quote envvar)
              ;; We must remove PS1, the output is truncated otherwise.
              (funcall
@@ -5074,7 +5127,7 @@ Use direct async.")
                 (format "%s=%d" envvar port)
                 tramp-remote-process-environment)))
          (should
-          (string-match
+          (string-match-p
            (number-to-string port)
            (shell-command-to-string (format "echo $%s" envvar))))))
 
@@ -5196,13 +5249,13 @@ Use direct async.")
          ;; order to avoid a question.  `explicit-sh-args' echoes the
          ;; test data.
          (with-current-buffer (get-buffer-create "*shell*")
-           (ignore-errors (kill-process (current-buffer)))
+           (ignore-errors (kill-process (get-buffer-process (current-buffer))))
            (should-not explicit-shell-file-name)
            (call-interactively #'shell)
            (with-timeout (10)
              (while (accept-process-output
                      (get-buffer-process (current-buffer)) nil nil t)))
-           (should (string-match "^foo$" (buffer-string)))))
+           (should (string-match-p "^foo$" (buffer-string)))))
 
       ;; Cleanup.
       (put 'explicit-shell-file-name 'permanent-local nil)
@@ -5337,25 +5390,27 @@ Use direct async.")
           (tramp-remote-process-environment tramp-remote-process-environment)
            (inhibit-message t)
           (vc-handled-backends
-           (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
-             (cond
-              ((tramp-find-executable
-                v vc-git-program (tramp-get-remote-path v))
-               '(Git))
-              ((tramp-find-executable
-                v vc-hg-program (tramp-get-remote-path v))
-               '(Hg))
-              ((tramp-find-executable
-                v vc-bzr-program (tramp-get-remote-path v))
-               (setq tramp-remote-process-environment
-                     (cons (format "BZR_HOME=%s"
-                                   (file-remote-p tmp-name1 'localname))
-                           tramp-remote-process-environment))
-               ;; We must force a reconnect, in order to activate $BZR_HOME.
-               (tramp-cleanup-connection
-                tramp-test-vec 'keep-debug 'keep-password)
-               '(Bzr))
-              (t nil))))
+           (cond
+            ((tramp-find-executable
+              tramp-test-vec vc-git-program
+              (tramp-get-remote-path tramp-test-vec))
+             '(Git))
+            ((tramp-find-executable
+              tramp-test-vec vc-hg-program
+              (tramp-get-remote-path tramp-test-vec))
+             '(Hg))
+            ((tramp-find-executable
+              tramp-test-vec vc-bzr-program
+              (tramp-get-remote-path tramp-test-vec))
+             (setq tramp-remote-process-environment
+                   (cons (format "BZR_HOME=%s"
+                                 (file-remote-p tmp-name1 'localname))
+                         tramp-remote-process-environment))
+             ;; We must force a reconnect, in order to activate $BZR_HOME.
+             (tramp-cleanup-connection
+              tramp-test-vec 'keep-debug 'keep-password)
+             '(Bzr))
+            (t nil)))
           ;; Suppress nasty messages.
           (inhibit-message t))
       (skip-unless vc-handled-backends)
@@ -5667,21 +5722,21 @@ This requires restrictions of file name syntax."
    (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory)
    'tramp-ftp-file-name-handler))
 
+(defun tramp--test-crypt-p ()
+  "Check, whether the remote directory is crypted"
+  (tramp-crypt-file-name-p tramp-test-temporary-file-directory))
+
 (defun tramp--test-docker-p ()
   "Check, whether the docker method is used.
 This does not support some special file names."
   (string-equal
    "docker" (file-remote-p tramp-test-temporary-file-directory 'method)))
 
-(defun tramp--test-crypt-p ()
-  "Check, whether the remote directory is crypted"
-  (tramp-crypt-file-name-p tramp-test-temporary-file-directory))
-
 (defun tramp--test-ftp-p ()
   "Check, whether an FTP-like method is used.
 This does not support globbing characters in file names (yet)."
   ;; Globbing characters are ??, ?* and ?\[.
-  (string-match
+  (string-match-p
    "ftp$" (file-remote-p tramp-test-temporary-file-directory 'method)))
 
 (defun tramp--test-gvfs-p (&optional method)
@@ -5695,18 +5750,18 @@ If optional METHOD is given, it is checked first."
   "Check, whether the remote host runs HP-UX.
 Several special characters do not work properly there."
   ;; We must refill the cache.  `file-truename' does it.
-  (with-parsed-tramp-file-name
-      (file-truename tramp-test-temporary-file-directory) nil
-    (string-match "^HP-UX" (tramp-get-connection-property v "uname" ""))))
+  (file-truename tramp-test-temporary-file-directory)
+  (string-match-p
+   "^HP-UX" (tramp-get-connection-property tramp-test-vec "uname" "")))
 
 (defun tramp--test-ksh-p ()
   "Check, whether the remote shell is ksh.
 ksh93 makes some strange conversions of non-latin characters into
 a $'' syntax."
   ;; We must refill the cache.  `file-truename' does it.
-  (with-parsed-tramp-file-name
-      (file-truename tramp-test-temporary-file-directory) nil
-    (string-match "ksh$" (tramp-get-connection-property v "remote-shell" ""))))
+  (file-truename tramp-test-temporary-file-directory)
+  (string-match-p
+   "ksh$" (tramp-get-connection-property tramp-test-vec "remote-shell" "")))
 
 (defun tramp--test-mock-p ()
   "Check, whether the mock method is used.
@@ -5734,6 +5789,17 @@ This does not support special file names."
   "Check, whether the remote host runs a based method from tramp-sh.el."
   (tramp-sh-file-name-handler-p tramp-test-vec))
 
+(defun tramp--test-sh-no-ls--dired-p ()
+  "Check, whether the remote host runs a based method from tramp-sh.el.
+Additionally, ls does not support \"--dired\"."
+  (and (tramp--test-sh-p)
+       (with-temp-buffer
+        ;; We must refill the cache.  `insert-directory' does it.
+        ;; This fails for tramp-crypt.el, so we ignore that.
+        (ignore-errors
+          (insert-directory tramp-test-temporary-file-directory "-al"))
+        (not (tramp-get-connection-property tramp-test-vec "ls--dired" nil)))))
+
 (defun tramp--test-share-p ()
   "Check, whether the method needs a share."
   (and (tramp--test-gvfs-p)
@@ -5758,7 +5824,7 @@ This does not support special characters."
   "Check, whether the locale host runs MS Windows, and ps{cp,ftp} is used.
 This does not support utf8 based file transfer."
   (and (eq system-type 'windows-nt)
-       (string-match
+       (string-match-p
        (regexp-opt '("pscp" "psftp"))
        (file-remote-p tramp-test-temporary-file-directory 'method))))
 
@@ -5787,7 +5853,8 @@ This requires restrictions of file name syntax."
           (tmp-name2 (tramp--test-make-temp-name 'local quoted))
           (files (delq nil files))
           (process-environment process-environment)
-          (sorted-files (sort (copy-sequence files) #'string-lessp)))
+          (sorted-files (sort (copy-sequence files) #'string-lessp))
+          buffer)
       (unwind-protect
          (progn
            (make-directory tmp-name1)
@@ -5849,6 +5916,18 @@ This requires restrictions of file name syntax."
                             tmp-name2 nil directory-files-no-dot-files-regexp))
                           sorted-files))
 
+           ;; Check, that `insert-directory' works properly.
+           (with-current-buffer
+               (setq buffer (dired-noselect tmp-name1 "--dired -al"))
+             (goto-char (point-min))
+             (while (not (eobp))
+               (when-let ((name (dired-get-filename 'localp 'no-error)))
+                 (unless
+                     (string-match-p name directory-files-no-dot-files-regexp)
+                   (should (member name files))))
+               (forward-line 1)))
+           (kill-buffer buffer)
+
            ;; `substitute-in-file-name' could return different
            ;; values.  For `adb', there could be strange file
            ;; permissions preventing overwriting a file.  We don't
@@ -5944,6 +6023,7 @@ This requires restrictions of file name syntax."
                       (regexp-quote (getenv envvar))))))))))
 
        ;; Cleanup.
+       (ignore-errors (kill-buffer buffer))
        (ignore-errors (delete-directory tmp-name1 'recursive))
        (ignore-errors (delete-directory tmp-name2 'recursive))))))
 
@@ -5956,17 +6036,20 @@ This requires restrictions of file name syntax."
   ;; expanded to <TAB>.
   (let ((files
         (list
-         (if (or (tramp--test-ange-ftp-p)
-                 (tramp--test-gvfs-p)
-                 (tramp--test-rclone-p)
-                 (tramp--test-sudoedit-p)
-                 (tramp--test-windows-nt-or-smb-p))
-             "foo bar baz"
-           (if (or (tramp--test-adb-p)
-                   (tramp--test-docker-p)
-                   (eq system-type 'cygwin))
-               " foo bar baz "
-             " foo\tbar baz\t"))
+         (cond ((or (tramp--test-ange-ftp-p)
+                    (tramp--test-docker-p)
+                    (tramp--test-gvfs-p)
+                    (tramp--test-rclone-p)
+                    (tramp--test-sudoedit-p)
+                    (tramp--test-windows-nt-or-smb-p))
+                "foo bar baz")
+               ((or (tramp--test-adb-p)
+                    (eq system-type 'cygwin))
+                " foo bar baz ")
+               ((tramp--test-sh-no-ls--dired-p)
+                "\tfoo bar baz\t")
+               (t " foo\tbar baz\t"))
+         "@foo@bar@baz@"
          "$foo$bar$$baz$"
          "-foo-bar-baz-"
          "%foo%bar%baz%"
@@ -6007,6 +6090,7 @@ This requires restrictions of file name syntax."
   (skip-unless (tramp--test-enabled))
   (skip-unless (not (tramp--test-rsync-p)))
   (skip-unless (not (tramp--test-windows-nt-and-pscp-psftp-p)))
+  (skip-unless (or (tramp--test-emacs26-p) (not (tramp--test-rclone-p))))
 
   (tramp--test-special-characters))
 
@@ -6018,6 +6102,8 @@ Use the `stat' command."
   (skip-unless (tramp--test-sh-p))
   (skip-unless (not (tramp--test-rsync-p)))
   (skip-unless (not (tramp--test-windows-nt-and-pscp-psftp-p)))
+  (skip-unless (or (tramp--test-emacs26-p) (not (tramp--test-rclone-p))))
+  ;; We cannot use `tramp-test-vec', because this fails during compilation.
   (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
     (skip-unless (tramp-get-remote-stat v)))
 
@@ -6036,6 +6122,8 @@ Use the `perl' command."
   (skip-unless (tramp--test-sh-p))
   (skip-unless (not (tramp--test-rsync-p)))
   (skip-unless (not (tramp--test-windows-nt-and-pscp-psftp-p)))
+  (skip-unless (or (tramp--test-emacs26-p) (not (tramp--test-rclone-p))))
+  ;; We cannot use `tramp-test-vec', because this fails during compilation.
   (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
     (skip-unless (tramp-get-remote-perl v)))
 
@@ -6058,6 +6146,7 @@ Use the `ls' command."
   (skip-unless (not (tramp--test-rsync-p)))
   (skip-unless (not (tramp--test-windows-nt-and-batch-p)))
   (skip-unless (not (tramp--test-windows-nt-and-pscp-psftp-p)))
+  (skip-unless (or (tramp--test-emacs26-p) (not (tramp--test-rclone-p))))
 
   (let ((tramp-connection-properties
         (append
@@ -6126,6 +6215,7 @@ Use the `ls' command."
   (skip-unless (not (tramp--test-windows-nt-and-pscp-psftp-p)))
   (skip-unless (not (tramp--test-ksh-p)))
   (skip-unless (not (tramp--test-crypt-p)))
+  (skip-unless (or (tramp--test-emacs26-p) (not (tramp--test-rclone-p))))
 
   (tramp--test-utf8))
 
@@ -6141,6 +6231,8 @@ Use the `stat' command."
   (skip-unless (not (tramp--test-windows-nt-and-pscp-psftp-p)))
   (skip-unless (not (tramp--test-ksh-p)))
   (skip-unless (not (tramp--test-crypt-p)))
+  (skip-unless (or (tramp--test-emacs26-p) (not (tramp--test-rclone-p))))
+  ;; We cannot use `tramp-test-vec', because this fails during compilation.
   (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
     (skip-unless (tramp-get-remote-stat v)))
 
@@ -6163,6 +6255,8 @@ Use the `perl' command."
   (skip-unless (not (tramp--test-windows-nt-and-pscp-psftp-p)))
   (skip-unless (not (tramp--test-ksh-p)))
   (skip-unless (not (tramp--test-crypt-p)))
+  (skip-unless (or (tramp--test-emacs26-p) (not (tramp--test-rclone-p))))
+  ;; We cannot use `tramp-test-vec', because this fails during compilation.
   (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
     (skip-unless (tramp-get-remote-perl v)))
 
@@ -6188,6 +6282,7 @@ Use the `ls' command."
   (skip-unless (not (tramp--test-windows-nt-and-pscp-psftp-p)))
   (skip-unless (not (tramp--test-ksh-p)))
   (skip-unless (not (tramp--test-crypt-p)))
+  (skip-unless (or (tramp--test-emacs26-p) (not (tramp--test-rclone-p))))
 
   (let ((tramp-connection-properties
         (append
@@ -6270,6 +6365,7 @@ process sentinels.  They shall not disturb each other."
                   (tramp--test-sh-p)))
   (skip-unless (not (tramp--test-crypt-p)))
   (skip-unless (not (tramp--test-docker-p)))
+  (skip-unless (not (tramp--test-windows-nt-p)))
 
   (with-timeout
       (tramp--test-asynchronous-requests-timeout (tramp--test-timeout-handler))
@@ -6279,12 +6375,11 @@ process sentinels.  They shall not disturb each other."
           (shell-file-name (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh"))
           ;; It doesn't work on w32 systems.
           (watchdog
-           (unless (tramp--test-windows-nt-p)
-              (start-process-shell-command
-               "*watchdog*" nil
-               (format
-               "sleep %d; kill -USR1 %d"
-               tramp--test-asynchronous-requests-timeout (emacs-pid)))))
+            (start-process-shell-command
+             "*watchdog*" nil
+             (format
+             "sleep %d; kill -USR1 %d"
+             tramp--test-asynchronous-requests-timeout (emacs-pid))))
            (tmp-name (tramp--test-make-temp-name))
            (default-directory tmp-name)
            ;; Do not cache Tramp properties.
@@ -6584,7 +6679,7 @@ process sentinels.  They shall not disturb each other."
              (message \"Tramp loaded: %%s\" (and (file-remote-p %S) t)))"
          tramp-test-temporary-file-directory)))
     (should
-     (string-match
+     (string-match-p
       "Tramp loaded: t[\n\r]+"
       (shell-command-to-string
        (format
@@ -6615,7 +6710,7 @@ process sentinels.  They shall not disturb each other."
     ;; Tramp doesn't load when `tramp-mode' is nil.
     (dolist (tm '(t nil))
       (should
-       (string-match
+       (string-match-p
        (format
        "Tramp loaded: nil[\n\r]+Tramp loaded: nil[\n\r]+Tramp loaded: 
%s[\n\r]+"
         tm)
@@ -6641,7 +6736,7 @@ process sentinels.  They shall not disturb each other."
               tramp-test-temporary-file-directory
               temporary-file-directory)))
       (should-not
-       (string-match
+       (string-match-p
        "Recursive load"
        (shell-command-to-string
         (format
@@ -6666,7 +6761,7 @@ process sentinels.  They shall not disturb each other."
                (load-path (cons \"/foo:bar:\" load-path))) \
            (tramp-cleanup-all-connections))"))
     (should
-     (string-match
+     (string-match-p
       (format
        "Loading %s"
        (regexp-quote
@@ -6713,11 +6808,11 @@ Since it unloads Tramp, it shall be the last test to 
run."
    (lambda (x)
      (and (or (and (boundp x) (null (local-variable-if-set-p x)))
              (and (functionp x) (null (autoloadp (symbol-function x)))))
-         (string-match "^tramp" (symbol-name x))
+         (string-match-p "^tramp" (symbol-name x))
          ;; `tramp-completion-mode' is autoloaded in Emacs < 28.1.
          (not (eq 'tramp-completion-mode x))
-         (not (string-match "^tramp\\(-archive\\)?--?test" (symbol-name x)))
-         (not (string-match "unload-hook$" (symbol-name x)))
+         (not (string-match-p "^tramp\\(-archive\\)?--?test" (symbol-name x)))
+         (not (string-match-p "unload-hook$" (symbol-name x)))
          (ert-fail (format "`%s' still bound" x)))))
   ;; The defstruct `tramp-file-name' and all its internal functions
   ;; shall be purged.
@@ -6725,15 +6820,15 @@ Since it unloads Tramp, it shall be the last test to 
run."
   (mapatoms
    (lambda (x)
      (and (functionp x)
-          (string-match "tramp-file-name" (symbol-name x))
+          (string-match-p "tramp-file-name" (symbol-name x))
           (ert-fail (format "Structure function `%s' still exists" x)))))
   ;; There shouldn't be left a hook function containing a Tramp
   ;; function.  We do not regard the Tramp unload hooks.
   (mapatoms
    (lambda (x)
      (and (boundp x)
-         (string-match "-\\(hook\\|function\\)s?$" (symbol-name x))
-         (not (string-match "unload-hook$" (symbol-name x)))
+         (string-match-p "-\\(hook\\|function\\)s?$" (symbol-name x))
+         (not (string-match-p "unload-hook$" (symbol-name x)))
          (consp (symbol-value x))
          (ignore-errors (all-completions "tramp" (symbol-value x)))
          (ert-fail (format "Hook `%s' still contains Tramp function" x))))))
diff --git a/texi/tramp.texi b/texi/tramp.texi
index 087074e..aabda59 100644
--- a/texi/tramp.texi
+++ b/texi/tramp.texi
@@ -12,7 +12,7 @@
 @footnotestyle end
 
 @copying
-Copyright @copyright{} 1999--2020 Free Software Foundation, Inc.
+Copyright @copyright{} 1999--2021 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -443,7 +443,7 @@ are optional, in case of a missing part a default value is 
assumed.
 The default value for an empty local file name part is the remote
 user's home directory.  The shortest remote file name is
 @file{@trampfn{-,,}}, therefore.  The @samp{-} notation for the
-default host is used for syntactical reasons, @ref{Default Host}.
+default method is used for syntactical reasons, @ref{Default Method}.
 
 The @code{method} part describes the connection method used to reach
 the remote host, see below.
@@ -810,9 +810,10 @@ behavior.
 @cindex @option{sshx} method
 
 Works like @option{ssh} but without the extra authentication prompts.
-@option{sshx} uses @samp{ssh -t -t @var{host} -l @var{user} /bin/sh}
-to open a connection with a ``standard'' login shell.  It supports
-changing the remote login shell @command{/bin/sh}.
+@option{sshx} uses @samp{ssh -t -t -l @var{user} -o
+RemoteCommand='/bin/sh -i' @var{host}} to open a connection with a
+``standard'' login shell.  It supports changing the remote login shell
+@command{/bin/sh}.
 
 @strong{Note} that @option{sshx} does not bypass authentication
 questions.  For example, if the host key of the remote host is not
@@ -935,9 +936,10 @@ This method supports the @samp{-p} argument.
 @cindex @command{ssh} (with @option{scpx} method)
 
 @option{scpx} is useful to avoid login shell questions.  It is similar
-in performance to @option{scp}.  @option{scpx} uses @samp{ssh -t -t
-@var{host} -l @var{user} /bin/sh} to open a connection.  It supports
-changing the remote login shell @command{/bin/sh}.
+in performance to @option{scp}.  @option{scpx} uses @samp{ssh -t -t -l
+@var{user} -o RemoteCommand='/bin/sh -i' @var{host}} to open a
+connection.  It supports changing the remote login shell
+@command{/bin/sh}.
 
 @option{scpx} is useful for MS Windows users when @command{ssh}
 triggers an error about allocating a pseudo tty.  This happens due to
@@ -1284,6 +1286,9 @@ This method uses @command{sftp} in order to securely 
access remote
 hosts.  @command{sftp} is a more secure option for connecting to hosts
 that for security reasons refuse @command{ssh} connections.
 
+When there is a respective entry in your @command{ssh} configuration,
+do @emph{not} set the @option{RemoteCommand} option.
+
 @end table
 
 @defopt tramp-gvfs-methods
@@ -1622,6 +1627,7 @@ support this command.
 
 @subsection Tunneling with ssh
 
+@vindex ProxyCommand@r{, ssh option}
 With @command{ssh}, you could use the @option{ProxyCommand} entry in
 @file{~/.ssh/config}:
 
@@ -2056,9 +2062,11 @@ default value is @t{"/data/local/tmp"} for the 
@option{adb} method,
 @item @t{"direct-async-process"}
 
 When this property is non-@code{nil}, an alternative, more performant
-implementation of @code{make-process} and
-@code{start-file-process} is applied.  @ref{Improving performance of
-asynchronous remote processes} for a discussion of constraints.
+implementation of @code{make-process} and @code{start-file-process} is
+applied.  The connection method must also be marked with a
+non-@code{nil} @code{tramp-direct-async} parameter in
+@code{tramp-methods}.  @ref{Improving performance of asynchronous
+remote processes} for a discussion of constraints.
 
 @item @t{"posix"}
 
@@ -2214,6 +2222,14 @@ overwrite this, you might apply
 
 This uses also the settings in @code{tramp-sh-extra-args}.
 
+@vindex RemoteCommand@r{, ssh option}
+@strong{Note}: If you use an @option{ssh}-based method for connection,
+do @emph{not} set the @option{RemoteCommand} option in your
+@command{ssh} configuration, for example to @command{screen}.  On the
+other hand, some @option{ssh}-based methods, like @option{sshx} or
+@option{scpx}, silently overwrite a @option{RemoteCommand} option of
+the configuration file.
+
 
 @subsection Other remote shell setup hints
 @cindex remote shell setup
@@ -2361,8 +2377,7 @@ that can identify such questions using
 @lisp
 @group
 (defconst my-tramp-prompt-regexp
-  (concat (regexp-opt '("Enter the birth date of your mother:") t)
-          "\\s-*")
+  "Enter the birth date of your mother:\\s-*"
   "Regular expression matching my login prompt question.")
 @end group
 
@@ -2381,6 +2396,11 @@ that can identify such questions using
 @end group
 @end lisp
 
+The regular expressions used in @code{tramp-actions-before-shell} must
+match the end of the connection buffer.  Due to performance reasons,
+this search starts at the end of the buffer, and it is limited to 256
+characters backwards.
+
 
 @item Conflicting names for users and variables in @file{.profile}
 
@@ -3304,6 +3324,8 @@ whatever reason, then replace @code{(getenv "DISPLAY")} 
with a
 hard-coded, fixed name.  Note that using @code{:0} for X11 display name
 here will not work as expected.
 
+@vindex ForwardX11@r{, ssh option}
+@vindex ForwardX11Trusted@r{, ssh option}
 An alternate approach is specify @option{ForwardX11 yes} or
 @option{ForwardX11Trusted yes} in @file{~/.ssh/config} on the local
 host.
@@ -3573,6 +3595,10 @@ agent like @command{ssh-agent}, using public key 
authentication, or
 using @option{ControlMaster} options.
 
 @item
+It cannot be applied for @option{ssh}-based methods, which use the
+@option{RemoteCommand} option.
+
+@item
 It cannot be killed via @code{interrupt-process}.
 
 @item
@@ -3582,8 +3608,7 @@ It does not report the remote terminal name via 
@code{process-tty-name}.
 It does not set process property @code{remote-pid}.
 
 @item
-It does not use @code{tramp-remote-path} and
-@code{tramp-remote-process-environment}.
+It does not use @code{tramp-remote-path}.
 @end itemize
 
 In order to gain even more performance, it is recommended to bind
@@ -4269,6 +4294,7 @@ In order to disable those optimizations, set user option
 @item
 @value{tramp} does not recognize if a @command{ssh} session hangs
 
+@vindex ServerAliveInterval@r{, ssh option}
 @command{ssh} sessions on the local host hang when the network is
 down.  @value{tramp} cannot safely detect such hangs.  The network
 configuration for @command{ssh} can be configured to kill such hangs
@@ -4285,6 +4311,8 @@ Host *
 @item
 @value{tramp} does not use default @command{ssh} @option{ControlPath}
 
+@vindex ControlPath@r{, ssh option}
+@vindex ControlPersist@r{, ssh option}
 @value{tramp} overwrites @option{ControlPath} settings when initiating
 @command{ssh} sessions.  @value{tramp} does this to fend off a stall
 if a master session opened outside the Emacs session is no longer
@@ -4306,8 +4334,8 @@ which allows you to set the @option{ControlPath} provided 
the variable
 @end group
 @end lisp
 
-Note how "%r", "%h" and "%p" must be encoded as "%%r", "%%h" and
-"%%p".
+Note how @samp{%r}, @samp{%h} and @samp{%p} must be encoded as
+@samp{%%r}, @samp{%%h} and @samp{%%p}.
 
 @vindex tramp-use-ssh-controlmaster-options
 If the @file{~/.ssh/config} is configured appropriately for the above
@@ -4318,6 +4346,8 @@ this @code{nil} setting:
 (customize-set-variable 'tramp-use-ssh-controlmaster-options nil)
 @end lisp
 
+@vindex ProxyCommand@r{, ssh option}
+@vindex ProxyJump@r{, ssh option}
 This shall also be set to @code{nil} if you use the
 @option{ProxyCommand} or @option{ProxyJump} options in your
 @command{ssh} configuration.
diff --git a/texi/trampver.texi b/texi/trampver.texi
index ba98a7e..bc7eadb 100644
--- a/texi/trampver.texi
+++ b/texi/trampver.texi
@@ -2,13 +2,13 @@
 @c texi/trampver.texi.  Generated from trampver.texi.in by configure.
 
 @c This is part of the Emacs manual.
-@c Copyright (C) 2003--2020 Free Software Foundation, Inc.
+@c Copyright (C) 2003--2021 Free Software Foundation, Inc.
 @c See file doclicense.texi for copying conditions.
 
 @c In the Tramp GIT, the version numbers are auto-frobbed from
 @c tramp.el, and the bug report address is auto-frobbed from
 @c configure.ac.
-@set trampver 2.5.0
+@set trampver 2.5.0.1
 @set trampurl https://www.gnu.org/software/tramp/
 @set tramp-bug-report-address tramp-devel@@gnu.org
 @set emacsver 25.1
diff --git a/tramp-adb.el b/tramp-adb.el
index 2d702b6..73dffe1 100644
--- a/tramp-adb.el
+++ b/tramp-adb.el
@@ -1,6 +1,6 @@
 ;;; tramp-adb.el --- Functions for calling Android Debug Bridge from Tramp  
-*- lexical-binding:t -*-
 
-;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
 ;; Author: Jürgen Hötzel <juergen@archlinux.org>
 ;; Keywords: comm, processes
@@ -98,6 +98,7 @@ It is used for TCP/IP devices."
              `(,tramp-adb-method
                 (tramp-login-program ,tramp-adb-program)
                 (tramp-login-args    (("shell")))
+                (tramp-direct-async  t)
                (tramp-tmpdir        "/data/local/tmp")
                 (tramp-default-port  5555)))
 
@@ -635,7 +636,10 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
       (copy-directory filename newname keep-date t)
 
     (let ((t1 (tramp-tramp-file-p filename))
-         (t2 (tramp-tramp-file-p newname)))
+         (t2 (tramp-tramp-file-p newname))
+         ;; We don't want the target file to be compressed, so we
+         ;; let-bind `jka-compr-inhibit' to t.
+         (jka-compr-inhibit t))
       (with-parsed-tramp-file-name (if t1 filename newname) nil
        (unless (file-exists-p filename)
          (tramp-error
@@ -716,7 +720,10 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
        (delete-directory filename 'recursive))
 
     (let ((t1 (tramp-tramp-file-p filename))
-         (t2 (tramp-tramp-file-p newname)))
+         (t2 (tramp-tramp-file-p newname))
+         ;; We don't want the target file to be compressed, so we
+         ;; let-bind `jka-compr-inhibit' to t.
+         (jka-compr-inhibit t))
       (with-parsed-tramp-file-name (if t1 filename newname) nil
        (unless (file-exists-p filename)
          (tramp-error
@@ -895,8 +902,9 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
 ;; terminated.
 (defun tramp-adb-handle-make-process (&rest args)
   "Like `make-process' for Tramp files.
-If connection property \"direct-async-process\" is non-nil, an
-alternative implementation will be used."
+If method parameter `tramp-direct-async' and connection property
+\"direct-async-process\" are non-nil, an alternative
+implementation will be used."
   (if (tramp-direct-async-process-p args)
       (apply #'tramp-handle-make-process args)
     (when args
diff --git a/tramp-archive.el b/tramp-archive.el
index 931a971..0bbd927 100644
--- a/tramp-archive.el
+++ b/tramp-archive.el
@@ -1,6 +1,6 @@
 ;;; tramp-archive.el --- Tramp archive manager  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
diff --git a/tramp-cache.el b/tramp-cache.el
index d2c451c..dc71648 100644
--- a/tramp-cache.el
+++ b/tramp-cache.el
@@ -1,6 +1,6 @@
 ;;; tramp-cache.el --- file information caching for Tramp  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2000, 2005-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2005-2021 Free Software Foundation, Inc.
 
 ;; Author: Daniel Pittman <daniel@inanna.danann.net>
 ;;         Michael Albinus <michael.albinus@gmx.de>
diff --git a/tramp-cmds.el b/tramp-cmds.el
index 9b62504..097f25e 100644
--- a/tramp-cmds.el
+++ b/tramp-cmds.el
@@ -1,6 +1,6 @@
 ;;; tramp-cmds.el --- Interactive commands for Tramp  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
diff --git a/tramp-compat.el b/tramp-compat.el
index cae3273..80347cd 100644
--- a/tramp-compat.el
+++ b/tramp-compat.el
@@ -1,6 +1,6 @@
 ;;; tramp-compat.el --- Tramp compatibility functions  -*- lexical-binding:t 
-*-
 
-;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
diff --git a/tramp-crypt.el b/tramp-crypt.el
index 4d34bbb..a10da25 100644
--- a/tramp-crypt.el
+++ b/tramp-crypt.el
@@ -1,6 +1,6 @@
 ;;; tramp-crypt.el --- Tramp crypt utilities  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
diff --git a/tramp-ftp.el b/tramp-ftp.el
index 46835c5..85af1c0 100644
--- a/tramp-ftp.el
+++ b/tramp-ftp.el
@@ -1,6 +1,6 @@
 ;;; tramp-ftp.el --- Tramp convenience functions for Ange-FTP  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
diff --git a/tramp-gvfs.el b/tramp-gvfs.el
index fa1a90b..f882636 100644
--- a/tramp-gvfs.el
+++ b/tramp-gvfs.el
@@ -1,6 +1,6 @@
 ;;; tramp-gvfs.el --- Tramp access functions for GVFS daemon  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
diff --git a/tramp-integration.el b/tramp-integration.el
index 566c673..64b5b48 100644
--- a/tramp-integration.el
+++ b/tramp-integration.el
@@ -1,6 +1,6 @@
 ;;; tramp-integration.el --- Tramp integration into other packages  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
diff --git a/tramp-rclone.el b/tramp-rclone.el
index 4790bb4..8638bb4 100644
--- a/tramp-rclone.el
+++ b/tramp-rclone.el
@@ -1,6 +1,6 @@
 ;;; tramp-rclone.el --- Tramp access functions to cloud storages  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
diff --git a/tramp-sh.el b/tramp-sh.el
index 0dbcb83..2274efd 100644
--- a/tramp-sh.el
+++ b/tramp-sh.el
@@ -1,6 +1,6 @@
 ;;; tramp-sh.el --- Tramp access functions for (s)sh-like connections  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; (copyright statements below in code to be updated with the above notice)
 
@@ -168,6 +168,7 @@ The string is used in `tramp-methods'.")
                 (tramp-login-args           (("-l" "%u") ("-p" "%p") ("%c")
                                             ("-e" "none") ("%h")))
                 (tramp-async-args           (("-q")))
+                (tramp-direct-async         t)
                 (tramp-remote-shell         ,tramp-default-remote-shell)
                 (tramp-remote-shell-login   ("-l"))
                 (tramp-remote-shell-args    ("-c"))
@@ -180,8 +181,8 @@ The string is used in `tramp-methods'.")
               `("scpx"
                 (tramp-login-program        "ssh")
                 (tramp-login-args           (("-l" "%u") ("-p" "%p") ("%c")
-                                            ("-e" "none") ("-t" "-t") ("%h")
-                                            ("%l")))
+                                            ("-e" "none") ("-t" "-t")
+                                            ("-o" "RemoteCommand='%l'") 
("%h")))
                 (tramp-async-args           (("-q")))
                 (tramp-remote-shell         ,tramp-default-remote-shell)
                 (tramp-remote-shell-login   ("-l"))
@@ -197,6 +198,7 @@ The string is used in `tramp-methods'.")
                 (tramp-login-args           (("-l" "%u") ("-p" "%p") ("%c")
                                             ("-e" "none") ("%h")))
                 (tramp-async-args           (("-q")))
+                (tramp-direct-async         t)
                 (tramp-remote-shell         ,tramp-default-remote-shell)
                 (tramp-remote-shell-login   ("-l"))
                 (tramp-remote-shell-args    ("-c"))
@@ -227,6 +229,7 @@ The string is used in `tramp-methods'.")
                 (tramp-login-args           (("-l" "%u") ("-p" "%p") ("%c")
                                             ("-e" "none") ("%h")))
                 (tramp-async-args           (("-q")))
+                (tramp-direct-async         t)
                 (tramp-remote-shell         ,tramp-default-remote-shell)
                 (tramp-remote-shell-login   ("-l"))
                 (tramp-remote-shell-args    ("-c"))))
@@ -234,8 +237,8 @@ The string is used in `tramp-methods'.")
               `("sshx"
                 (tramp-login-program        "ssh")
                 (tramp-login-args           (("-l" "%u") ("-p" "%p") ("%c")
-                                            ("-e" "none") ("-t" "-t") ("%h")
-                                            ("%l")))
+                                            ("-e" "none") ("-t" "-t")
+                                            ("-o" "RemoteCommand='%l'") 
("%h")))
                 (tramp-async-args           (("-q")))
                 (tramp-remote-shell         ,tramp-default-remote-shell)
                 (tramp-remote-shell-login   ("-l"))
@@ -781,7 +784,7 @@ characters need to be doubled.")
 (defconst tramp-perl-encode
   "%p -e '
 # This script contributed by Juanma Barranquero <lektu@terra.es>.
-# Copyright (C) 2002-2020 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
 use strict;
 
 my %%trans = do {
@@ -820,7 +823,7 @@ characters need to be doubled.")
 (defconst tramp-perl-decode
   "%p -e '
 # This script contributed by Juanma Barranquero <lektu@terra.es>.
-# Copyright (C) 2002-2020 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
 use strict;
 
 my %%trans = do {
@@ -1705,6 +1708,12 @@ ID-FORMAT valid values are `string' and `integer'."
             (= (tramp-compat-file-attribute-user-id attributes)
                (tramp-get-remote-uid v 'integer))
             (or (not group)
+                ;; On BSD-derived systems files always inherit the
+                 ;; parent directory's group, so skip the group-gid
+                 ;; test.
+                (string-match-p
+                 "BSD\\|DragonFly\\|Darwin"
+                 (tramp-get-connection-property v "uname" ""))
                 (= (tramp-compat-file-attribute-group-id attributes)
                    (tramp-get-remote-gid v 'integer)))))))))
 
@@ -2601,25 +2610,21 @@ The method used must be an out-of-band method."
                       (t nil)))))))))
 
 (defun tramp-sh-handle-insert-directory
-  (filename switches &optional wildcard full-directory-p)
+    (filename switches &optional wildcard full-directory-p)
   "Like `insert-directory' for Tramp files."
-  (setq filename (expand-file-name filename))
   (unless switches (setq switches ""))
   ;; Check, whether directory is accessible.
   (unless wildcard
     (access-file filename "Reading directory"))
-  (with-parsed-tramp-file-name filename nil
+  (with-parsed-tramp-file-name (expand-file-name filename) nil
     (if (and (featurep 'ls-lisp)
             (not (symbol-value 'ls-lisp-use-insert-directory-program)))
        (tramp-handle-insert-directory
         filename switches wildcard full-directory-p)
       (when (stringp switches)
         (setq switches (split-string switches)))
-      (when (tramp-get-ls-command-with ;FIXME: tramp-sh--quoting-style-options?
-            v "--quoting-style=literal --show-control-chars")
-       (setq switches
-             (append
-              switches '("--quoting-style=literal" "--show-control-chars"))))
+      (setq switches
+           (append switches (split-string (tramp-sh--quoting-style-options 
v))))
       (unless (tramp-get-ls-command-with v "--dired")
        (setq switches (delete "--dired" switches)))
       (when wildcard
@@ -2636,63 +2641,63 @@ The method used must be an out-of-band method."
        v 4 "Inserting directory `ls %s %s', wildcard %s, fulldir %s"
        switches filename (if wildcard "yes" "no")
        (if full-directory-p "yes" "no"))
-      ;; If `full-directory-p', we just say `ls -l FILENAME'.
-      ;; Else we chdir to the parent directory, then say `ls -ld BASENAME'.
+      ;; If `full-directory-p', we just say `ls -l FILENAME'.  Else we
+      ;; chdir to the parent directory, then say `ls -ld BASENAME'.
       (if full-directory-p
          (tramp-send-command
-          v
-          (format "%s %s %s 2>%s"
-                  (tramp-get-ls-command v)
-                  switches
-                  (if wildcard
-                      localname
-                    (tramp-shell-quote-argument (concat localname ".")))
-                   (tramp-get-remote-null-device v)))
+          v (format "%s %s %s 2>%s"
+                    (tramp-get-ls-command v)
+                    switches
+                    (if wildcard
+                        localname
+                      (tramp-shell-quote-argument (concat localname ".")))
+                     (tramp-get-remote-null-device v)))
        (tramp-barf-unless-okay
-        v
-        (format "cd %s" (tramp-shell-quote-argument
-                         (tramp-run-real-handler
-                          #'file-name-directory (list localname))))
+        v (format "cd %s" (tramp-shell-quote-argument
+                           (tramp-run-real-handler
+                            #'file-name-directory (list localname))))
         "Couldn't `cd %s'"
         (tramp-shell-quote-argument
          (tramp-run-real-handler #'file-name-directory (list localname))))
        (tramp-send-command
-        v
-        (format "%s %s %s 2>%s"
-                (tramp-get-ls-command v)
-                switches
-                (if (or wildcard
-                        (zerop (length
-                                (tramp-run-real-handler
-                                 #'file-name-nondirectory (list localname)))))
-                    ""
-                  (tramp-shell-quote-argument
-                   (tramp-run-real-handler
-                     #'file-name-nondirectory (list localname))))
-                 (tramp-get-remote-null-device v))))
-
-      (save-restriction
-       (let ((beg (point)))
-         (narrow-to-region (point) (point))
-         ;; We cannot use `insert-buffer-substring' because the Tramp
-         ;; buffer changes its contents before insertion due to calling
-         ;; `expand-file-name' and alike.
-         (insert
-          (with-current-buffer (tramp-get-buffer v)
-            (buffer-string)))
-
+        v (format "%s %s %s 2>%s"
+                  (tramp-get-ls-command v)
+                  switches
+                  (if (or wildcard
+                          (zerop (length
+                                  (tramp-run-real-handler
+                                   #'file-name-nondirectory (list 
localname)))))
+                      ""
+                    (tramp-shell-quote-argument
+                     (tramp-run-real-handler
+                       #'file-name-nondirectory (list localname))))
+                   (tramp-get-remote-null-device v))))
+
+      (let ((beg-marker (copy-marker (point) nil))
+           (end-marker (copy-marker (point) t))
+           (emc enable-multibyte-characters))
+       ;; We cannot use `insert-buffer-substring' because the Tramp
+       ;; buffer changes its contents before insertion due to calling
+       ;; `expand-file-name' and alike.
+       (insert (with-current-buffer (tramp-get-buffer v) (buffer-string)))
+
+       ;; We must enable unibyte strings, because the "--dired"
+       ;; output counts in bytes.
+       (set-buffer-multibyte nil)
+       (save-restriction
+         (narrow-to-region beg-marker end-marker)
          ;; Check for "--dired" output.
          (forward-line -2)
          (when (looking-at-p "//SUBDIRED//")
            (forward-line -1))
          (when (looking-at "//DIRED//\\s-+")
-           (let ((databeg (match-end 0))
+           (let ((beg (match-end 0))
                  (end (point-at-eol)))
              ;; Now read the numeric positions of file names.
-             (goto-char databeg)
+             (goto-char beg)
              (while (< (point) end)
-               (let ((start (+ beg (read (current-buffer))))
-                     (end (+ beg (read (current-buffer)))))
+               (let ((start (+ (point-min) (read (current-buffer))))
+                     (end (+ (point-min) (read (current-buffer)))))
                  (if (memq (char-after end) '(?\n ?\ ))
                      ;; End is followed by \n or by " -> ".
                      (put-text-property start end 'dired-filename t))))))
@@ -2700,16 +2705,18 @@ The method used must be an out-of-band method."
          (goto-char (point-at-bol))
          (while (looking-at "//")
            (forward-line 1)
-           (delete-region (match-beginning 0) (point)))
+           (delete-region (match-beginning 0) (point))))
+       ;; Reset multibyte if needed.
+       (set-buffer-multibyte emc)
 
+       (save-restriction
+         (narrow-to-region beg-marker end-marker)
          ;; Some busyboxes are reluctant to discard colors.
          (unless
              (string-match-p "color" (tramp-get-connection-property v "ls" ""))
-            (save-excursion
-             (goto-char beg)
-             (while
-                 (re-search-forward tramp-display-escape-sequence-regexp nil t)
-               (replace-match ""))))
+           (goto-char (point-min))
+           (while (re-search-forward tramp-display-escape-sequence-regexp nil 
t)
+             (replace-match "")))
 
           ;; Now decode what read if necessary.  Stolen from 
`insert-directory'.
          (let ((coding (or coding-system-for-read
@@ -2724,36 +2731,32 @@ The method used must be an out-of-band method."
              ;; If no coding system is specified or detection is
              ;; requested, detect the coding.
              (if (eq (coding-system-base coding) 'undecided)
-                 (setq coding (detect-coding-region beg (point) t)))
-             (if (not (eq (coding-system-base coding) 'undecided))
-                 (save-restriction
-                   (setq coding-no-eol
-                         (coding-system-change-eol-conversion coding 'unix))
-                   (narrow-to-region beg (point))
-                   (goto-char (point-min))
-                   (while (not (eobp))
-                     (setq pos (point)
-                           val (get-text-property (point) 'dired-filename))
-                     (goto-char (next-single-property-change
-                                 (point) 'dired-filename nil (point-max)))
-                     ;; Force no eol conversion on a file name, so
-                     ;; that CR is preserved.
-                     (decode-coding-region pos (point)
-                                           (if val coding-no-eol coding))
-                     (if val
-                         (put-text-property pos (point)
-                                            'dired-filename t)))))))
+                 (setq coding (detect-coding-region (point-min) (point) t)))
+             (unless (eq (coding-system-base coding) 'undecided)
+               (setq coding-no-eol
+                     (coding-system-change-eol-conversion coding 'unix))
+               (goto-char (point-min))
+               (while (not (eobp))
+                 (setq pos (point)
+                       val (get-text-property (point) 'dired-filename))
+                 (goto-char (next-single-property-change
+                             (point) 'dired-filename nil (point-max)))
+                 ;; Force no eol conversion on a file name, so that
+                 ;; CR is preserved.
+                 (decode-coding-region
+                  pos (point) (if val coding-no-eol coding))
+                 (if val (put-text-property pos (point) 'dired-filename t))))))
 
          ;; The inserted file could be from somewhere else.
          (when (and (not wildcard) (not full-directory-p))
            (goto-char (point-max))
            (when (file-symlink-p filename)
-             (goto-char (search-backward "->" beg 'noerror)))
+             (goto-char (search-backward "->" (point-min) 'noerror)))
            (search-backward
             (if (directory-name-p filename)
                 "."
               (file-name-nondirectory filename))
-            beg 'noerror)
+            (point-min) 'noerror)
            (replace-match (file-relative-name filename) t))
 
          ;; Try to insert the amount of free space.
@@ -2764,9 +2767,11 @@ The method used must be an out-of-band method."
              ;; Replace "total" with "total used", to avoid confusion.
              (replace-match "\\1 used in directory")
              (end-of-line)
-             (insert " available " available)))
+             (insert " available " available))))
 
-         (goto-char (point-max)))))))
+       (prog1 (goto-char end-marker)
+         (set-marker beg-marker nil)
+         (set-marker end-marker nil))))))
 
 ;; Canonicalization of file names.
 
@@ -2835,9 +2840,9 @@ the result will be a local, non-Tramp, file name."
 ;; terminated.
 (defun tramp-sh-handle-make-process (&rest args)
   "Like `make-process' for Tramp files.
-STDERR can also be a file name.  If connection property
-\"direct-async-process\" is non-nil, an alternative
-implementation will be used."
+STDERR can also be a file name.  If method parameter `tramp-direct-async'
+and connection property \"direct-async-process\" are non-nil, an
+alternative implementation will be used."
   (if (tramp-direct-async-process-p args)
       (apply #'tramp-handle-make-process args)
     (when args
@@ -4301,11 +4306,14 @@ file exists and nonzero exit status otherwise."
     ;; ensure they have the correct values when the shell starts, not
     ;; just processes run within the shell.  (Which processes include
     ;; our initial probes to ensure the remote shell is usable.)
+    ;; For the time being, we assume that all shells interpret -i as
+    ;; interactive shell.  Must be the last argument, because (for
+    ;; example) bash expects long options first.
     (tramp-send-command
      vec (format
          (concat
           "exec env TERM='%s' INSIDE_EMACS='%s,tramp:%s' "
-          "ENV=%s %s PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s")
+          "ENV=%s %s PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s -i")
           tramp-terminal-type
           (or (getenv "INSIDE_EMACS") emacs-version) tramp-version
           (or (getenv-internal "ENV" tramp-remote-process-environment) "")
@@ -5117,7 +5125,7 @@ connection if a previous connection has died for some 
reason."
                     options (format-spec options spec)
                     spec (format-spec-make
                           ?h l-host ?u l-user ?p l-port ?c options
-                          ?l (concat remote-shell " " extra-args))
+                          ?l (concat remote-shell " " extra-args " -i"))
                     command
                     (concat
                      ;; We do not want to see the trailing local
diff --git a/tramp-smb.el b/tramp-smb.el
index 83c1b58..c5a74a5 100644
--- a/tramp-smb.el
+++ b/tramp-smb.el
@@ -1,6 +1,6 @@
 ;;; tramp-smb.el --- Tramp access functions for SMB servers  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
@@ -156,6 +156,7 @@ this variable (\"client min protocol=NT1\") ."
         "NT_STATUS_NO_SUCH_FILE"
         "NT_STATUS_NO_SUCH_USER"
         "NT_STATUS_NOT_A_DIRECTORY"
+        "NT_STATUS_NOT_SUPPORTED"
         "NT_STATUS_OBJECT_NAME_COLLISION"
         "NT_STATUS_OBJECT_NAME_INVALID"
         "NT_STATUS_OBJECT_NAME_NOT_FOUND"
@@ -371,17 +372,17 @@ pass to the OPERATION."
        (tramp-error
         v2 'file-error
         "add-name-to-file: %s must not be a directory" filename))
-       ;; Do the 'confirm if exists' thing.
-       (when (file-exists-p newname)
-         ;; What to do?
-         (if (or (null ok-if-already-exists) ; not allowed to exist
-                 (and (numberp ok-if-already-exists)
-                      (not (yes-or-no-p
-                            (format
-                             "File %s already exists; make it a link anyway? "
-                             v2-localname)))))
-             (tramp-error v2 'file-already-exists newname)
-           (delete-file newname)))
+      ;; Do the 'confirm if exists' thing.
+      (when (file-exists-p newname)
+       ;; What to do?
+       (if (or (null ok-if-already-exists) ; not allowed to exist
+               (and (numberp ok-if-already-exists)
+                    (not (yes-or-no-p
+                          (format
+                           "File %s already exists; make it a link anyway? "
+                           v2-localname)))))
+           (tramp-error v2 'file-already-exists newname)
+         (delete-file newname)))
       ;; We must also flush the cache of the directory, because
       ;; `file-attributes' reads the values from there.
       (tramp-flush-file-properties v2 v2-localname)
@@ -1166,7 +1167,6 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
                   (insert " -> " (tramp-compat-file-attribute-type attr))))
 
               (insert "\n")
-              (forward-line)
               (beginning-of-line)))
           entries))))))
 
diff --git a/tramp-sudoedit.el b/tramp-sudoedit.el
index 558a57b..5bb1546 100644
--- a/tramp-sudoedit.el
+++ b/tramp-sudoedit.el
@@ -1,6 +1,6 @@
 ;;; tramp-sudoedit.el --- Functions for accessing under root permissions  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
diff --git a/tramp-uu.el b/tramp-uu.el
index f368f72..5171b9d 100644
--- a/tramp-uu.el
+++ b/tramp-uu.el
@@ -1,6 +1,6 @@
 ;;; tramp-uu.el --- uuencode in Lisp  -*- lexical-binding:t -*-
 
-;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 ;; Author: Kai Großjohann <kai.grossjohann@gmx.net>
 ;; Maintainer: Michael Albinus <michael.albinus@gmx.de>
diff --git a/tramp.el b/tramp.el
index d254854..66efe96 100644
--- a/tramp.el
+++ b/tramp.el
@@ -1,6 +1,6 @@
 ;;; tramp.el --- Transparent Remote Access, Multiple Protocol  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2021 Free Software Foundation, Inc.
 
 ;; Author: Kai Großjohann <kai.grossjohann@gmx.net>
 ;;         Michael Albinus <michael.albinus@gmx.de>
@@ -259,9 +259,9 @@ pair of the form (KEY VALUE).  The following KEYs are 
defined:
     parameters to suppress diagnostic messages, in order not to
     tamper the process output.
 
-  * `tramp-direct-async-args'
-    An additional argument when a direct asynchronous process is
-    started.  Used so far only in the \"mock\" method of tramp-tests.el.
+  * `tramp-direct-async'
+    Whether the method supports direct asynchronous processes.
+    Until now, just \"ssh\"-based and \"adb\"-based methods do.
 
   * `tramp-copy-program'
     This specifies the name of the program to use for remotely copying
@@ -1755,7 +1755,8 @@ The outline level is equal to the verbosity of the Tramp 
message."
 Message is formatted with FMT-STRING as control string and the remaining
 ARGUMENTS to actually emit the message (if applicable)."
   (let ((inhibit-message t)
-       file-name-handler-alist message-log-max signal-hook-function)
+       create-lockfiles file-name-handler-alist message-log-max
+       signal-hook-function)
     (with-current-buffer (tramp-get-debug-buffer vec)
       (goto-char (point-max))
       (let ((point (point)))
@@ -1986,6 +1987,15 @@ the resulting error message."
 
 (put #'tramp-with-demoted-errors 'tramp-suppress-trace t)
 
+(defun tramp-test-message (fmt-string &rest arguments)
+  "Emit a Tramp message according `default-directory'."
+  (if (tramp-tramp-file-p default-directory)
+      (apply #'tramp-message
+            (tramp-dissect-file-name default-directory) 0 fmt-string arguments)
+    (apply #'message fmt-string arguments)))
+
+(put #'tramp-test-message 'tramp-suppress-trace t)
+
 ;; This function provides traces in case of errors not triggered by
 ;; Tramp functions.
 (defun tramp-signal-hook-function (error-symbol data)
@@ -3775,7 +3785,9 @@ User is always nil."
   (let ((v (tramp-dissect-file-name default-directory))
        (buffer (plist-get args :buffer))
        (stderr (plist-get args :stderr)))
-    (and ;; It has been indicated.
+    (and ;; The method supports it.
+         (tramp-get-method-parameter v 'tramp-direct-async)
+        ;; It has been indicated.
          (tramp-get-connection-property v "direct-async-process" nil)
         ;; There's no multi-hop.
         (or (not (tramp-multi-hop-p v))
@@ -3825,15 +3837,20 @@ It does not support `:stderr'."
                    (get-buffer-create buffer)
                  ;; BUFFER can be nil.  We use a temporary buffer.
                  (generate-new-buffer tramp-temp-buffer-name)))
-              ;; We use as environment the difference to toplevel
-              ;; `process-environment'.
               (env (mapcar
                     (lambda (elt)
-                      (unless
-                          (member
-                           elt (default-toplevel-value 'process-environment))
-                        (when (string-match-p "=" elt) elt)))
-                    process-environment))
+                      (when (string-match-p "=" elt) elt))
+                    tramp-remote-process-environment))
+              ;; We use as environment the difference to toplevel
+              ;; `process-environment'.
+              (env (dolist (elt process-environment env)
+                     (when
+                         (and
+                          (string-match-p "=" elt)
+                          (not
+                           (member
+                            elt (default-toplevel-value 
'process-environment))))
+                       (setq env (cons elt env)))))
               (env (setenv-internal
                     env "INSIDE_EMACS"
                     (concat (or (getenv "INSIDE_EMACS") emacs-version)
@@ -3855,8 +3872,6 @@ It does not support `:stderr'."
                  (tramp-get-method-parameter v 'tramp-login-args))
                 (async-args
                  (tramp-get-method-parameter v 'tramp-async-args))
-                (direct-async-args
-                 (tramp-get-method-parameter v 'tramp-direct-async-args))
                 ;; We don't create the temporary file.  In fact, it
                 ;; is just a prefix for the ControlPath option of
                 ;; ssh; the real temporary file has another name, and
@@ -3884,7 +3899,7 @@ It does not support `:stderr'."
                   ?h (or host "") ?u (or user "") ?p (or port "")
                   ?c options ?l "")
             ;; Add arguments for asynchronous processes.
-            login-args (append async-args direct-async-args login-args)
+            login-args (append async-args login-args)
             ;; Expand format spec.
             login-args
             (tramp-compat-flatten-tree
diff --git a/trampver.el b/trampver.el
index f4e470e..a7d4a01 100644
--- a/trampver.el
+++ b/trampver.el
@@ -1,13 +1,13 @@
 ;;; trampver.el --- Transparent Remote Access, Multiple Protocol  -*- 
lexical-binding:t -*-
 ;;; lisp/trampver.el.  Generated from trampver.el.in by configure.
 
-;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
 ;; Author: Kai Großjohann <kai.grossjohann@gmx.net>
 ;; Maintainer: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, processes
 ;; Package: tramp
-;; Version: 2.5.0
+;; Version: 2.5.0.1
 ;; Package-Requires: ((emacs "25.1"))
 ;; Package-Type: multi
 ;; URL: https://www.gnu.org/software/tramp/
@@ -40,7 +40,7 @@
 ;; ./configure" to change them.
 
 ;;;###tramp-autoload
-(defconst tramp-version "2.5.0"
+(defconst tramp-version "2.5.0.1"
   "This version of Tramp.")
 
 ;;;###tramp-autoload
@@ -76,7 +76,7 @@
 ;; Check for Emacs version.
 (let ((x   (if (not (string-lessp emacs-version "25.1"))
       "ok"
-    (format "Tramp 2.5.0 is not fit for %s"
+    (format "Tramp 2.5.0.1 is not fit for %s"
             (replace-regexp-in-string "\n" "" (emacs-version))))))
   (unless (string-equal "ok" x) (error "%s" x)))
 



reply via email to

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