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

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

[elpa] externals/tramp 4d71eeb 2/2: Tramp ELPA version 2.4.3.1 released


From: Michael Albinus
Subject: [elpa] externals/tramp 4d71eeb 2/2: Tramp ELPA version 2.4.3.1 released
Date: Tue, 28 Jan 2020 04:31:39 -0500 (EST)

branch: externals/tramp
commit 4d71eebe83fb76a690a25616589da07b3b336a2c
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Tramp ELPA version 2.4.3.1 released
---
 test/tramp-tests.el  | 341 +++++++++++++++++++--------------------------------
 texi/tramp.texi      |  12 +-
 texi/trampver.texi   |   4 +-
 tramp-adb.el         |  62 ++++++++--
 tramp-archive.el     |   2 +-
 tramp-cache.el       |  10 +-
 tramp-cmds.el        |   4 +-
 tramp-compat.el      |  28 +----
 tramp-ftp.el         |  18 +--
 tramp-gvfs.el        |   2 +-
 tramp-integration.el |   2 +-
 tramp-loaddefs.el    |   2 +-
 tramp-rclone.el      |   4 +-
 tramp-sh.el          | 210 +++++++++++++++++++++++--------
 tramp-smb.el         |   8 +-
 tramp-sudoedit.el    |  45 +++----
 tramp-uu.el          |   2 +-
 tramp.el             | 300 +++++++++++++++++++++++---------------------
 tramp.info           | 134 ++++++++++----------
 trampver.el          |   9 +-
 20 files changed, 619 insertions(+), 580 deletions(-)

diff --git a/test/tramp-tests.el b/test/tramp-tests.el
index 9cf466d..3c0179a 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-2019 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <address@hidden>
 
@@ -4248,7 +4248,8 @@ This tests also `make-symbolic-link', `file-truename' and 
`add-name-to-file'."
 
   (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
     (let ((default-directory tramp-test-temporary-file-directory)
-         (tmp-name (tramp--test-make-temp-name nil quoted))
+         (tmp-name1 (tramp--test-make-temp-name nil quoted))
+         (tmp-name2 (tramp--test-make-temp-name 'local quoted))
          kill-buffer-query-functions proc)
       (with-no-warnings (should-not (make-process)))
 
@@ -4278,13 +4279,13 @@ This tests also `make-symbolic-link', `file-truename' 
and `add-name-to-file'."
       ;; Simple process using a file.
       (unwind-protect
          (with-temp-buffer
-           (write-region "foo" nil tmp-name)
-           (should (file-exists-p tmp-name))
+           (write-region "foo" nil tmp-name1)
+           (should (file-exists-p tmp-name1))
            (setq proc
                  (with-no-warnings
                    (make-process
                     :name "test2" :buffer (current-buffer)
-                    :command `("cat" ,(file-name-nondirectory tmp-name))
+                    :command `("cat" ,(file-name-nondirectory tmp-name1))
                     :file-handler t)))
            (should (processp proc))
            ;; Read output.
@@ -4296,7 +4297,7 @@ This tests also `make-symbolic-link', `file-truename' and 
`add-name-to-file'."
        ;; Cleanup.
        (ignore-errors
          (delete-process proc)
-         (delete-file tmp-name)))
+         (delete-file tmp-name1)))
 
       ;; Process filter.
       (unwind-protect
@@ -4351,34 +4352,60 @@ This tests also `make-symbolic-link', `file-truename' 
and `add-name-to-file'."
        ;; Cleanup.
        (ignore-errors (delete-process proc)))
 
-      ;; Process with stderr.  tramp-adb.el doesn't support it (yet).
-      (unless (tramp--test-adb-p)
-       (let ((stderr (generate-new-buffer "*stderr*")))
-         (unwind-protect
+      ;; Process with stderr buffer.
+      (let ((stderr (generate-new-buffer "*stderr*")))
+       (unwind-protect
+           (with-temp-buffer
+             (setq proc
+                   (with-no-warnings
+                     (make-process
+                      :name "test5" :buffer (current-buffer)
+                      :command '("cat" "/")
+                      :stderr stderr
+                      :file-handler t)))
+             (should (processp proc))
+             ;; Read stderr.
+             (with-timeout (10 (tramp--test-timeout-handler))
+               (while (accept-process-output proc 0 nil t)))
+             (delete-process proc)
+             (with-current-buffer stderr
+               (should
+                (string-match "cat:.* Is a directory" (buffer-string)))))
+
+         ;; Cleanup.
+         (ignore-errors (delete-process proc))
+         (ignore-errors (kill-buffer stderr))))
+
+      ;; Process with stderr file.
+      (dolist (tmpfile `(,tmp-name1 ,tmp-name2))
+       (unwind-protect
+           (with-temp-buffer
+             (setq proc
+                   (with-no-warnings
+                     (make-process
+                      :name "test6" :buffer (current-buffer)
+                      :command '("cat" "/")
+                      :stderr tmpfile
+                      :file-handler t)))
+             (should (processp proc))
+             ;; Read stderr.
+             (with-timeout (10 (tramp--test-timeout-handler))
+               (while (accept-process-output proc nil nil t)))
+             (delete-process proc)
              (with-temp-buffer
-               (setq proc
-                     (with-no-warnings
-                       (make-process
-                        :name "test5" :buffer (current-buffer)
-                        :command '("cat" "/")
-                        :stderr stderr
-                        :file-handler t)))
-               (should (processp proc))
-               ;; Read stderr.
-               (with-current-buffer stderr
-                 (with-timeout (10 (tramp--test-timeout-handler))
-                   (while (= (point-min) (point-max))
-                     (while (accept-process-output proc 0 nil t))))
-                 (should
-                  (string-match "^cat:.* Is a directory" (buffer-string)))))
+               (insert-file-contents tmpfile)
+               (should
+                (string-match "cat:.* Is a directory" (buffer-string)))))
 
-           ;; Cleanup.
-           (ignore-errors (delete-process proc))
-           (ignore-errors (kill-buffer stderr))))))))
+         ;; Cleanup.
+         (ignore-errors (delete-process proc))
+         (ignore-errors (delete-file tmpfile)))))))
 
 (ert-deftest tramp-test31-interrupt-process ()
   "Check `interrupt-process'."
-  :tags '(:expensive-test)
+  ;; The test fails from time to time, w/o a reproducible pattern.  So
+  ;; we mark it as unstable.
+  :tags '(:expensive-test :unstable)
   (skip-unless (tramp--test-enabled))
   (skip-unless (tramp--test-sh-p))
   ;; Since Emacs 26.1.
@@ -4388,6 +4415,7 @@ This tests also `make-symbolic-link', `file-truename' and 
`add-name-to-file'."
   ;; order to establish the connection prior running an asynchronous
   ;; process.
   (let ((default-directory (file-truename tramp-test-temporary-file-directory))
+       (delete-exited-processes t)
        kill-buffer-query-functions proc)
     (unwind-protect
        (with-temp-buffer
@@ -4399,7 +4427,8 @@ This tests also `make-symbolic-link', `file-truename' and 
`add-name-to-file'."
          (should (interrupt-process proc))
          ;; Let the process accept the interrupt.
          (with-timeout (10 (tramp--test-timeout-handler))
-           (while (accept-process-output proc nil nil 0)))
+           (while (process-live-p proc)
+             (while (accept-process-output proc 0 nil t))))
          (should-not (process-live-p proc))
          ;; An interrupted process cannot be interrupted, again.
          (should-error
@@ -4409,14 +4438,23 @@ This tests also `make-symbolic-link', `file-truename' 
and `add-name-to-file'."
       ;; Cleanup.
       (ignore-errors (delete-process proc)))))
 
+(defun tramp--test-async-shell-command
+    (command output-buffer &optional error-buffer input)
+  "Like `async-shell-command', reading the output.
+INPUT, if non-nil, is a string sent to the process."
+  (let ((proc (async-shell-command command output-buffer error-buffer))
+       (delete-exited-processes t))
+    (when (stringp input)
+      (process-send-string proc input))
+    (with-timeout
+       ((if (getenv "EMACS_EMBA_CI") 30 10) (tramp--test-timeout-handler))
+      (while (or (accept-process-output proc nil nil t) (process-live-p 
proc))))
+    (accept-process-output proc nil nil t)))
+
 (defun tramp--test-shell-command-to-string-asynchronously (command)
   "Like `shell-command-to-string', but for asynchronous processes."
   (with-temp-buffer
-    (async-shell-command command (current-buffer))
-    (with-timeout
-        ((if (getenv "EMACS_EMBA_CI") 30 10) (tramp--test-timeout-handler))
-      (while (accept-process-output
-             (get-buffer-process (current-buffer)) nil nil t)))
+    (tramp--test-async-shell-command command (current-buffer))
     (buffer-substring-no-properties (point-min) (point-max))))
 
 (ert-deftest tramp-test32-shell-command ()
@@ -4435,89 +4473,67 @@ This tests also `make-symbolic-link', `file-truename' 
and `add-name-to-file'."
          (inhibit-message t)
          kill-buffer-query-functions)
 
-      ;; Test ordinary `shell-command'.
-      (unwind-protect
-         (with-temp-buffer
-           (write-region "foo" nil tmp-name)
-           (should (file-exists-p tmp-name))
-           (shell-command
-            (format "ls %s" (file-name-nondirectory tmp-name))
-            (current-buffer))
-           ;; `ls' could produce colorized output.
-           (goto-char (point-min))
-           (while
-               (re-search-forward tramp-display-escape-sequence-regexp nil t)
-             (replace-match "" nil nil))
-           (should
-            (string-equal
-             (format "%s\n" (file-name-nondirectory tmp-name))
-             (buffer-string))))
-
-       ;; Cleanup.
-       (ignore-errors (delete-file tmp-name)))
+      (dolist (this-shell-command
+              '(;; Synchronously.
+                shell-command
+                ;; Asynchronously.
+                tramp--test-async-shell-command))
 
-      ;; Test `shell-command' with error buffer.
-      (let ((stderr (generate-new-buffer "*stderr*")))
+       ;; Test ordinary `{async-}shell-command'.
        (unwind-protect
            (with-temp-buffer
-             (shell-command "error" (current-buffer) stderr)
-             (should (= (point-min) (point-max)))
+             (write-region "foo" nil tmp-name)
+             (should (file-exists-p tmp-name))
+             (funcall
+              this-shell-command
+              (format "ls %s" (file-name-nondirectory tmp-name))
+              (current-buffer))
+             ;; `ls' could produce colorized output.
+             (goto-char (point-min))
+             (while
+                 (re-search-forward tramp-display-escape-sequence-regexp nil t)
+               (replace-match "" nil nil))
              (should
-              (string-match
-               "error:.+not found"
-               (with-current-buffer stderr (buffer-string)))))
+              (string-equal
+               (format "%s\n" (file-name-nondirectory tmp-name))
+               (buffer-string))))
 
          ;; Cleanup.
-         (ignore-errors (kill-buffer stderr))))
+         (ignore-errors (delete-file tmp-name)))
 
-      ;; Test ordinary `async-shell-command'.
-      (unwind-protect
-         (with-temp-buffer
-           (write-region "foo" nil tmp-name)
-           (should (file-exists-p tmp-name))
-           (async-shell-command
-            (format "ls %s" (file-name-nondirectory tmp-name))
-            (current-buffer))
-           ;; Read output.
-           (with-timeout (10 (tramp--test-timeout-handler))
-             (while (accept-process-output
-                     (get-buffer-process (current-buffer)) nil nil t)))
-           ;; `ls' could produce colorized output.
-           (goto-char (point-min))
-           (while
-               (re-search-forward tramp-display-escape-sequence-regexp nil t)
-             (replace-match "" nil nil))
-           (should
-            (string-equal
-             (format "%s\n" (file-name-nondirectory tmp-name))
-             (buffer-string))))
+       ;; Test `{async-}shell-command' with error buffer.
+       (let ((stderr (generate-new-buffer "*stderr*")))
+         (unwind-protect
+             (with-temp-buffer
+               (funcall
+                this-shell-command
+                "echo foo >&2; echo bar" (current-buffer) stderr)
+               (should (string-equal "bar\n" (buffer-string)))
+               ;; Check stderr.
+               (with-current-buffer stderr
+                 (should (string-equal "foo\n" (buffer-string)))))
 
-       ;; Cleanup.
-       (ignore-errors (delete-file tmp-name)))
+           ;; Cleanup.
+           (ignore-errors (kill-buffer stderr)))))
 
       ;; Test sending string to `async-shell-command'.
       (unwind-protect
          (with-temp-buffer
            (write-region "foo" nil tmp-name)
            (should (file-exists-p tmp-name))
-           (async-shell-command "read line; ls $line" (current-buffer))
-           (process-send-string
-            (get-buffer-process (current-buffer))
+           (tramp--test-async-shell-command
+            "read line; ls $line" (current-buffer) nil
+            ;; String to be sent.
             (format "%s\n" (file-name-nondirectory tmp-name)))
-           ;; Read output.
-           (with-timeout (10 (tramp--test-timeout-handler))
-             (while (accept-process-output
-                     (get-buffer-process (current-buffer)) nil nil t)))
-           ;; `ls' could produce colorized output.
-           (goto-char (point-min))
-           (while
-               (re-search-forward tramp-display-escape-sequence-regexp nil t)
-             (replace-match "" nil nil))
-           ;; We cannot use `string-equal', because tramp-adb.el
-           ;; echoes also the sent string.
            (should
-            (string-match
-             (format "\\`%s" (regexp-quote (file-name-nondirectory tmp-name)))
+            (string-equal
+             ;; tramp-adb.el echoes, so we must add the string.
+             (if (tramp--test-adb-p)
+                 (format
+                  "%s\n%s\n"
+                  (file-name-nondirectory tmp-name)
+                  (file-name-nondirectory tmp-name))
+               (format "%s\n" (file-name-nondirectory tmp-name)))
              (buffer-string))))
 
        ;; Cleanup.
@@ -6001,116 +6017,8 @@ process sentinels.  They shall not disturb each other."
         (ignore-errors (cancel-timer timer))
         (ignore-errors (delete-directory tmp-name 'recursive))))))
 
-(ert-deftest tramp-test44-threads ()
-  "Check that Tramp cooperates with threads."
-  (skip-unless (tramp--test-enabled))
-  (skip-unless (featurep 'threads))
-  (skip-unless (= (length (with-no-warnings (all-threads))) 1))
-  (skip-unless (not (with-no-warnings (thread-last-error))))
-  ;; We need the thread features introduced in Emacs 27.
-  (skip-unless (bound-and-true-p main-thread))
-  ;; For the time being it works only in the feature branch.
-  (skip-unless
-   (string-equal
-    (bound-and-true-p emacs-repository-branch) "feature/tramp-thread-safe"))
-
-  (tramp--test-instrument-test-case 0
-  (with-no-warnings
-    (with-timeout (60 (tramp--test-timeout-handler))
-      ;; We cannot bind the variables dynamically; they are used in the 
threads.
-      (defvar tmp-name1 (tramp--test-make-temp-name))
-      (defvar tmp-name2 (tramp--test-make-temp-name))
-      (defvar tmp-mutex (make-mutex "mutex"))
-      (defvar tmp-condvar1 (make-condition-variable tmp-mutex "condvar1"))
-      (defvar tmp-condvar2 (make-condition-variable tmp-mutex "condvar2"))
-
-      ;; Rename simple file.
-      (unwind-protect
-         (let (tmp-thread1 tmp-thread2)
-           (write-region "foo" nil tmp-name1)
-           (should (file-exists-p tmp-name1))
-           (should-not (file-exists-p tmp-name2))
-
-           (should (mutexp tmp-mutex))
-           (should (condition-variable-p tmp-condvar1))
-           (should (condition-variable-p tmp-condvar2))
-
-           ;; This thread renames `tmp-name1' to `tmp-name2' twice.
-           (setq
-            tmp-thread1
-            (make-thread
-             (lambda ()
-               ;; Rename first time.
-               (rename-file tmp-name1 tmp-name2)
-               ;; Notify thread2.
-               (with-mutex (condition-mutex tmp-condvar2)
-                 (condition-notify tmp-condvar2 t))
-               ;; Rename second time, once we've got notification from thread2.
-               (with-mutex (condition-mutex tmp-condvar1)
-                 (condition-wait tmp-condvar1))
-               (rename-file tmp-name1 tmp-name2))
-             "thread1"))
-
-           (should (threadp tmp-thread1))
-           (should (thread-live-p tmp-thread1))
-
-           ;; This thread renames `tmp-name2' to `tmp-name1' twice.
-           (setq
-            tmp-thread2
-            (make-thread
-             (lambda ()
-               ;; Rename first time, once we've got notification from thread1.
-               (with-mutex (condition-mutex tmp-condvar2)
-                 (condition-wait tmp-condvar2))
-               (rename-file tmp-name2 tmp-name1)
-               ;; Notify thread1.
-               (with-mutex (condition-mutex tmp-condvar1)
-                 (condition-notify tmp-condvar1 t))
-               ;; Rename second time, once we've got notification from
-               ;; the main thread.
-               (with-mutex (condition-mutex tmp-condvar2)
-                 (condition-wait tmp-condvar2))
-               (rename-file tmp-name2 tmp-name1))
-             "thread2"))
-
-           (should (threadp tmp-thread2))
-           (should (thread-live-p tmp-thread2))
-           (should (= (length (all-threads)) 3))
-
-           ;; Wait for thread1.
-           (thread-join tmp-thread1)
-           ;; Checks.
-           (should-not (thread-live-p tmp-thread1))
-           (should (= (length (all-threads)) 2))
-           (should-not (thread-last-error))
-           (should (file-exists-p tmp-name2))
-           (should-not (file-exists-p tmp-name1))
-
-           ;; Notify thread2.
-           (with-mutex (condition-mutex tmp-condvar2)
-             (condition-notify tmp-condvar2 t))
-
-           ;; Wait for thread2.
-           (thread-join tmp-thread2)
-           ;; Checks.
-           (should-not (thread-live-p tmp-thread2))
-           (should (= (length (all-threads)) 1))
-           (should-not (thread-last-error))
-           (should (file-exists-p tmp-name1))
-           (should-not (file-exists-p tmp-name2)))
-
-       ;; Cleanup.
-       (ignore-errors (delete-file tmp-name1))
-       (ignore-errors (delete-file tmp-name2))
-       ;; We could have spurious threads still running; wait for them to die.
-       (while (cdr (all-threads))
-         (thread-signal (cadr (all-threads)) 'error nil)
-         (thread-yield))
-       ;; Cleanup errors.
-       (ignore-errors (thread-last-error 'cleanup)))))))
-
 ;; This test is inspired by Bug#29163.
-(ert-deftest tramp-test45-auto-load ()
+(ert-deftest tramp-test44-auto-load ()
   "Check that Tramp autoloads properly."
   ;; If we use another syntax but `default', Tramp is already loaded
   ;; due to the `tramp-change-syntax' call.
@@ -6135,7 +6043,7 @@ process sentinels.  They shall not disturb each other."
        (mapconcat #'shell-quote-argument load-path " -L ")
        (shell-quote-argument code)))))))
 
-(ert-deftest tramp-test45-delay-load ()
+(ert-deftest tramp-test44-delay-load ()
   "Check that Tramp is loaded lazily, only when needed."
   ;; The autoloaded Tramp objects are different since Emacs 26.1.  We
   ;; cannot test older Emacsen, therefore.
@@ -6168,7 +6076,7 @@ process sentinels.  They shall not disturb each other."
          (mapconcat #'shell-quote-argument load-path " -L ")
          (shell-quote-argument (format code tm)))))))))
 
-(ert-deftest tramp-test45-recursive-load ()
+(ert-deftest tramp-test44-recursive-load ()
   "Check that Tramp does not fail due to recursive load."
   (skip-unless (tramp--test-enabled))
 
@@ -6192,7 +6100,7 @@ process sentinels.  They shall not disturb each other."
          (mapconcat #'shell-quote-argument load-path " -L ")
          (shell-quote-argument code))))))))
 
-(ert-deftest tramp-test45-remote-load-path ()
+(ert-deftest tramp-test44-remote-load-path ()
   "Check that Tramp autoloads its packages with remote `load-path'."
   ;; The autoloaded Tramp objects are different since Emacs 26.1.  We
   ;; cannot test older Emacsen, therefore.
@@ -6221,7 +6129,7 @@ process sentinels.  They shall not disturb each other."
        (mapconcat #'shell-quote-argument load-path " -L ")
        (shell-quote-argument code)))))))
 
-(ert-deftest tramp-test46-unload ()
+(ert-deftest tramp-test45-unload ()
   "Check that Tramp and its subpackages unload completely.
 Since it unloads Tramp, it shall be the last test to run."
   :tags '(:expensive-test)
@@ -6302,10 +6210,9 @@ If INTERACTIVE is non-nil, the tests are run 
interactively."
 ;;   do not work properly for `nextcloud'.
 ;; * Fix `tramp-test29-start-file-process' and
 ;;   `tramp-test30-make-process' on MS Windows (`process-send-eof'?).
-;; * Implement `tramp-test31-interrupt-process' for `adb'.
+;; * Implement `tramp-test31-interrupt-process' for `adb'.  Fix `:unstable'.
 ;; * Fix Bug#16928 in `tramp-test43-asynchronous-requests'.  A remote
 ;;   file name operation cannot run in the timer.  Remove `:unstable' tag?
-;; * Fix `tramp-test44-threads'.
 
 (provide 'tramp-tests)
 ;;; tramp-tests.el ends here
diff --git a/texi/tramp.texi b/texi/tramp.texi
index 061d6cd..81ff200 100644
--- a/texi/tramp.texi
+++ b/texi/tramp.texi
@@ -12,7 +12,7 @@
 @footnotestyle end
 
 @copying
-Copyright @copyright{} 1999--2019 Free Software Foundation, Inc.
+Copyright @copyright{} 1999--2020 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -3799,7 +3799,11 @@ help the development team find the best solution and 
avoid unrelated
 detours.
 
 To exclude cache-related problems, flush all caches before running the
-test, @ref{Cleanup remote connections}.
+test, @ref{Cleanup remote connections}.  Alternatively, and often
+better for analysis, reproduce the problem in a clean Emacs session
+started with @command{emacs -Q}.  Then, @value{tramp} does not load
+the persistency file (@pxref{Connection caching}), and it does not use
+passwords from @file{auth-source.el} (@pxref{Password handling}).
 
 When including @value{tramp}'s messages in the bug report, increase
 the verbosity level to 6 (@pxref{Traces and Profiles, Traces}) in the
@@ -3840,8 +3844,8 @@ Where is the latest @value{tramp}?
 @item
 Which systems does it work on?
 
-The package works successfully on Emacs 24, Emacs 25, Emacs 26, and
-Emacs 27.
+The package works successfully on Emacs 24, Emacs 25, Emacs 26, Emacs
+27, and Emacs 28.
 
 While Unix and Unix-like systems are the primary remote targets,
 @value{tramp} has equal success connecting to other platforms, such as
diff --git a/texi/trampver.texi b/texi/trampver.texi
index be35101..2863a0c 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-2019 Free Software Foundation, Inc.
+@c Copyright (C) 2003--2020 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.4.3
+@set trampver 2.4.3.1
 @set tramp-bug-report-address tramp-devel@@gnu.org
 @set emacsver 24.4
 
diff --git a/tramp-adb.el b/tramp-adb.el
index 300def1..442ca88 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-2019 Free Software Foundation, Inc.
+;; Copyright (C) 2011-2020 Free Software Foundation, Inc.
 
 ;; Author: Jürgen Hötzel <address@hidden>
 ;; Keywords: comm, processes
@@ -725,8 +725,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
        (with-tramp-progress-reporter
            v 0 (format "Copying %s to %s" filename newname)
          (if (and t1 t2 (tramp-equal-remote filename newname))
-             (let ((l1 (tramp-compat-file-local-name filename))
-                   (l2 (tramp-compat-file-local-name newname)))
+             (let ((l1 (tramp-file-local-name filename))
+                   (l2 (tramp-file-local-name newname)))
                ;; We must also flush the cache of the directory,
                ;; because `file-attributes' reads the values from
                ;; there.
@@ -809,8 +809,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
          (if (and t1 t2
                   (tramp-equal-remote filename newname)
                   (not (file-directory-p filename)))
-             (let ((l1 (tramp-compat-file-local-name filename))
-                   (l2 (tramp-compat-file-local-name newname)))
+             (let ((l1 (tramp-file-local-name filename))
+                   (l2 (tramp-file-local-name newname)))
                ;; We must also flush the cache of the directory, because
                ;; `file-attributes' reads the values from there.
                (tramp-flush-file-properties v l1)
@@ -846,7 +846,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
        (setq infile (expand-file-name infile))
        (if (tramp-equal-remote default-directory infile)
            ;; INFILE is on the same remote host.
-           (setq input (with-parsed-tramp-file-name infile nil localname))
+           (setq input (tramp-file-local-name infile))
          ;; INFILE must be copied to remote host.
          (setq input (tramp-make-tramp-temp-file v)
                tmpinput (tramp-make-tramp-file-name v input))
@@ -877,8 +877,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
          (setcar (cdr destination) (expand-file-name (cadr destination)))
          (if (tramp-equal-remote default-directory (cadr destination))
              ;; stderr is on the same remote host.
-             (setq stderr (with-parsed-tramp-file-name
-                              (cadr destination) nil localname))
+             (setq stderr (tramp-file-local-name (cadr destination)))
            ;; stderr must be copied to remote host.  The temporary
            ;; file must be deleted after execution.
            (setq stderr (tramp-make-tramp-temp-file v)
@@ -936,6 +935,8 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
 ;; We use BUFFER also as connection buffer during setup.  Because of
 ;; this, its original contents must be saved, and restored once
 ;; connection has been setup.
+;; The complete STDERR buffer is available only when the process has
+;; terminated.
 (defun tramp-adb-handle-make-process (&rest args)
   "Like `make-process' for Tramp files."
   (when args
@@ -969,17 +970,29 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
          (signal 'wrong-type-argument (list #'functionp sentinel)))
        (unless (or (null stderr) (bufferp stderr) (stringp stderr))
          (signal 'wrong-type-argument (list #'stringp stderr)))
+       (when (and (stringp stderr) (tramp-tramp-file-p stderr)
+                  (not (tramp-equal-remote default-directory stderr)))
+         (signal 'file-error (list "Wrong stderr" stderr)))
 
        (let* ((buffer
                (if buffer
                    (get-buffer-create buffer)
                  ;; BUFFER can be nil.  We use a temporary buffer.
                  (generate-new-buffer tramp-temp-buffer-name)))
+              ;; STDERR can also be a file name.
+              (tmpstderr
+               (and stderr
+                    (if (and (stringp stderr) (tramp-tramp-file-p stderr))
+                        (tramp-unquote-file-local-name stderr)
+                      (tramp-make-tramp-temp-file v))))
+              (remote-tmpstderr
+               (and tmpstderr (tramp-make-tramp-file-name v tmpstderr)))
               (program (car command))
               (args (cdr command))
               (command
-               (format "cd %s && exec %s"
+               (format "cd %s && exec %s %s"
                        (tramp-shell-quote-argument localname)
+                       (if tmpstderr (format "2>'%s'" tmpstderr) "")
                        (mapconcat #'tramp-shell-quote-argument
                                   (cons program args) " ")))
               (tramp-process-connection-type
@@ -1029,6 +1042,18 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
                        (ignore-errors
                          (set-process-query-on-exit-flag p (null noquery))
                          (set-marker (process-mark p) (point)))
+                       ;; We must flush them here already; otherwise
+                       ;; `rename-file', `delete-file' or
+                       ;; `insert-file-contents' will fail.
+                       (tramp-flush-connection-property v "process-name")
+                       (tramp-flush-connection-property v "process-buffer")
+                       ;; Copy tmpstderr file.
+                       (when (and (stringp stderr)
+                                  (not (tramp-tramp-file-p stderr)))
+                         (add-function
+                          :after (process-sentinel p)
+                          (lambda (_proc _msg)
+                            (rename-file remote-tmpstderr stderr))))
                        ;; Read initial output.  Remove the first line,
                        ;; which is the command echo.
                        (while
@@ -1037,6 +1062,23 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
                              (not (re-search-forward "[\n]" nil t)))
                          (tramp-accept-process-output p 0))
                        (delete-region (point-min) (point))
+                       ;; Provide error buffer.  This shows only
+                       ;; initial error messages; messages arriving
+                       ;; later on will be inserted when the process
+                       ;; is deleted.  The temporary file will exist
+                       ;; until the process is deleted.
+                       (when (bufferp stderr)
+                         (with-current-buffer stderr
+                           (insert-file-contents-literally
+                            remote-tmpstderr 'visit))
+                         ;; Delete tmpstderr file.
+                         (add-function
+                          :after (process-sentinel p)
+                          (lambda (_proc _msg)
+                            (with-current-buffer stderr
+                              (insert-file-contents-literally
+                               remote-tmpstderr 'visit nil nil 'replace))
+                            (delete-file remote-tmpstderr))))
                        ;; Return process.
                        p))))
 
@@ -1062,7 +1104,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
          (read (current-buffer)))
        ":" 'omit)))
    ;; The equivalent to `exec-directory'.
-   `(,(tramp-compat-file-local-name default-directory))))
+   `(,(tramp-file-local-name (expand-file-name default-directory)))))
 
 (defun tramp-adb-get-device (vec)
   "Return full host name from VEC to be used in shell execution.
diff --git a/tramp-archive.el b/tramp-archive.el
index 1158b03..b9bf618 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-2019 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <address@hidden>
 ;; Keywords: comm, processes
diff --git a/tramp-cache.el b/tramp-cache.el
index 24d0e14..6a4930a 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-2019 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2005-2020 Free Software Foundation, Inc.
 
 ;; Author: Daniel Pittman <address@hidden>
 ;;         Michael Albinus <address@hidden>
@@ -411,9 +411,7 @@ used to cache connection properties of the local machine."
                       (prin1-to-string key))
                     (if (hash-table-p value)
                         (tramp-cache-print value)
-                      (if (or (bufferp value)
-                              ;; Mutexes have entered Emacs 26.1.
-                              (tramp-compat-funcall 'mutexp value))
+                      (if (bufferp value)
                           (prin1-to-string (prin1-to-string value))
                         (prin1-to-string value))))))
           (setq result (if result (concat result " " tmp) tmp))))
@@ -476,7 +474,7 @@ used to cache connection properties of the local machine."
                  tramp-persistency-file-name))
             (error "\n"))
           ";; Tramp connection history.  Don't change this file.\n"
-          ";; You can delete it, forcing Tramp to reapply the checks.\n\n"
+          ";; Run `M-x tramp-cleanup-all-connections' instead.\n\n"
           (with-output-to-string
             (pp (read (format "(%s)" (tramp-cache-print cache)))))))))))
 
@@ -516,7 +514,7 @@ for all methods.  Resulting data are derived from 
connection history."
           tramp-cache-read-persistent-data)
   (condition-case err
       (with-temp-buffer
-       (insert-file-contents tramp-persistency-file-name)
+       (insert-file-contents-literally tramp-persistency-file-name)
        (let ((list (read (current-buffer)))
              (tramp-verbose 0)
              element key item)
diff --git a/tramp-cmds.el b/tramp-cmds.el
index 607b025..b4dca23 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-2019 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <address@hidden>
 ;; Keywords: comm, processes
@@ -358,7 +358,7 @@ The remote connection identified by SOURCE is flushed by
 
   ;; Append local file name if none is specified.
   (when (string-equal (file-remote-p target) target)
-    (setq target (concat target (file-remote-p source 'localname))))
+    (setq target (concat target (tramp-file-local-name source))))
   ;; Make them directory names.
   (setq source (directory-file-name source)
        target (directory-file-name target))
diff --git a/tramp-compat.el b/tramp-compat.el
index 6c8a3f2..3f25afe 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-2019 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2020 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <address@hidden>
 ;; Keywords: comm, processes
@@ -41,6 +41,7 @@
 (require 'shell)
 (require 'subr-x)
 
+;; `temporary-file-directory' as function is introduced with Emacs 26.1.
 (declare-function tramp-handle-temporary-file-directory "tramp")
 
 ;; For not existing functions, obsolete functions, or functions with a
@@ -278,31 +279,6 @@ NAME is unquoted."
 (defconst tramp-compat-use-url-tramp-p (fboundp 'temporary-file-directory)
   "Whether to use url-tramp.el.")
 
-;; Threads have entered Emacs 26.1, `main-thread' in Emacs 27.1.  But
-;; then, they might not exist when Emacs is configured
-;; --without-threads.
-(defconst tramp-compat-main-thread (bound-and-true-p main-thread)
-  "The main thread of Emacs, if compiled --with-threads.")
-
-(defsubst tramp-compat-current-thread ()
-  "The current thread, or nil if compiled --without-threads."
-  (tramp-compat-funcall 'current-thread))
-
-(defsubst tramp-compat-thread-yield ()
-  "Yield the CPU to another thread."
-  (tramp-compat-funcall 'thread-yield))
-
-;; Mutexes have entered Emacs 26.1.  Once we use only Emacs 26+, we
-;; must check (mutexp mutex), because the other functions might still
-;; not exist when Emacs is configured --without-threads.
-(defmacro tramp-compat-with-mutex (mutex &rest body)
-  "Invoke BODY with MUTEX held, releasing MUTEX when done.
-This is the simplest safe way to acquire and release a mutex."
-  (declare (indent 1) (debug t))
-  `(if (fboundp 'with-mutex)
-       (with-mutex ,mutex ,@body)
-     ,@body))
-
 ;; `exec-path' is new in Emacs 27.1.
 (defalias 'tramp-compat-exec-path
   (if (fboundp 'exec-path)
diff --git a/tramp-ftp.el b/tramp-ftp.el
index 7e3dc76..95ae156 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-2019 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <address@hidden>
 ;; Keywords: comm, processes
@@ -33,7 +33,6 @@
 ;; Pacify byte-compiler.
 (eval-when-compile
   (require 'custom))
-(declare-function ange-ftp-ftp-process-buffer "ange-ftp")
 (defvar ange-ftp-ftp-name-arg)
 (defvar ange-ftp-ftp-name-res)
 (defvar ange-ftp-name-format)
@@ -128,16 +127,7 @@ pass to the OPERATION."
          ;; "ftp" method is used in the Tramp file name. So we unset
          ;; those values.
          (ange-ftp-ftp-name-arg "")
-         (ange-ftp-ftp-name-res nil)
-         (v (tramp-dissect-file-name
-             (apply #'tramp-file-name-for-operation operation args) t)))
-      (setf (tramp-file-name-method v) tramp-ftp-method)
-      ;; Set "process-name" for thread support.
-      (tramp-set-connection-property
-       v "process-name"
-       (ange-ftp-ftp-process-buffer
-       (tramp-file-name-host v) (tramp-file-name-user v)))
-
+         (ange-ftp-ftp-name-res nil))
       (cond
        ;; If argument is a symlink, `file-directory-p' and
        ;; `file-exists-p' call the traversed file recursively. So we
@@ -149,7 +139,9 @@ pass to the OPERATION."
        ;; "~/.netrc".
        ((memq operation '(file-directory-p file-exists-p))
        (if (apply #'ange-ftp-hook-function operation args)
-           (tramp-set-connection-property v "started" t)
+           (let ((v (tramp-dissect-file-name (car args) t)))
+             (setf (tramp-file-name-method v) tramp-ftp-method)
+             (tramp-set-connection-property v "started" t))
          nil))
 
        ;; If the second argument of `copy-file' or `rename-file' is a
diff --git a/tramp-gvfs.el b/tramp-gvfs.el
index 1b87e34..34a234c 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-2019 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <address@hidden>
 ;; Keywords: comm, processes
diff --git a/tramp-integration.el b/tramp-integration.el
index ad07563..7e4a9bf 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 Free Software Foundation, Inc.
+;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <address@hidden>
 ;; Keywords: comm, processes
diff --git a/tramp-loaddefs.el b/tramp-loaddefs.el
index cfa7d1a..3645a05 100644
--- a/tramp-loaddefs.el
+++ b/tramp-loaddefs.el
@@ -653,7 +653,7 @@ UU-encode the region between BEG and END.
 ;;;### (autoloads nil "trampver" "trampver.el" (0 0 0 0))
 ;;; Generated autoloads from trampver.el
 
-(defconst tramp-version "2.4.3" "\
+(defconst tramp-version "2.4.3.1" "\
 This version of Tramp.")
 
 (defconst tramp-bug-report-address "address@hidden" "\
diff --git a/tramp-rclone.el b/tramp-rclone.el
index 109d8c5..0d1ef0f 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-2019 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <address@hidden>
 ;; Keywords: comm, processes
@@ -564,7 +564,7 @@ connection if a previous connection has died for some 
reason."
                 ,(tramp-rclone-mount-point vec)
                 ;; This could be nil.
                 ,(tramp-get-method-parameter vec 'tramp-mount-args))))
-       (while (not (file-exists-p (tramp-make-tramp-file-name vec 'localname)))
+       (while (not (file-exists-p (tramp-make-tramp-file-name vec 'noloc)))
          (tramp-cleanup-connection vec 'keep-debug 'keep-password))
 
        ;; Mark it as connected.
diff --git a/tramp-sh.el b/tramp-sh.el
index 506c33d..661e344 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-2019 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
 
 ;; (copyright statements below in code to be updated with the above notice)
 
@@ -776,7 +776,7 @@ on the remote host.")
 (defconst tramp-perl-encode
   "%s -e '
 # This script contributed by Juanma Barranquero <address@hidden>.
-# Copyright (C) 2002-2019 Free Software Foundation, Inc.
+# Copyright (C) 2002-2020 Free Software Foundation, Inc.
 use strict;
 
 my %%trans = do {
@@ -815,7 +815,7 @@ This string is passed to `format', so percent characters 
need to be doubled.")
 (defconst tramp-perl-decode
   "%s -e '
 # This script contributed by Juanma Barranquero <address@hidden>.
-# Copyright (C) 2002-2019 Free Software Foundation, Inc.
+# Copyright (C) 2002-2020 Free Software Foundation, Inc.
 use strict;
 
 my %%trans = do {
@@ -866,8 +866,12 @@ Escape sequence %s is replaced with name of Perl binary.")
   "Perl program to use for decoding a file.
 Escape sequence %s is replaced with name of Perl binary.")
 
+(defconst tramp-hexdump-encode "%h -v -e '16/1 \" %%02x\" \"\\n\"'"
+  "`hexdump' program to use for encoding a file.
+This string is passed to `format', so percent characters need to be doubled.")
+
 (defconst tramp-awk-encode
-  "od -v -t x1 -A n | busybox awk '\\
+  "%a '\\
 BEGIN {
   b64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"
   b16 = \"0123456789abcdef\"
@@ -897,11 +901,25 @@ END {
   }
   printf tail
 }'"
-  "Awk program to use for encoding a file.
+  "`awk' program to use for encoding a file.
+This string is passed to `format', so percent characters need to be doubled.")
+
+(defconst tramp-hexdump-awk-encode
+  (format "%s | %s" tramp-hexdump-encode tramp-awk-encode)
+  "`hexdump' / `awk' pipe to use for encoding a file.
+This string is passed to `format', so percent characters need to be doubled.")
+
+(defconst tramp-od-encode "%o -v -t x1 -A n"
+  "`od' program to use for encoding a file.
+This string is passed to `format', so percent characters need to be doubled.")
+
+(defconst tramp-od-awk-encode
+  (format "%s | %s" tramp-od-encode tramp-awk-encode)
+  "`od' / `awk' pipe to use for encoding a file.
 This string is passed to `format', so percent characters need to be doubled.")
 
 (defconst tramp-awk-decode
-  "busybox awk '\\
+  "%a '\\
 BEGIN {
   b64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"
 }
@@ -926,12 +944,6 @@ BEGIN {
   "Awk program to use for decoding a file.
 This string is passed to `format', so percent characters need to be doubled.")
 
-(defconst tramp-awk-coding-test
-  "test -c /dev/zero && \
-od -v -t x1 -A n </dev/null && \
-busybox awk '{}' </dev/null"
-  "Test command for checking `tramp-awk-encode' and `tramp-awk-decode'.")
-
 (defconst tramp-vc-registered-read-file-names
   "echo \"(\"
 while read file; do
@@ -1051,9 +1063,7 @@ component is used as the target of the symlink."
       (let ((non-essential t))
        (when (and (tramp-tramp-file-p target)
                   (tramp-file-name-equal-p v (tramp-dissect-file-name target)))
-         (setq target
-               (tramp-file-name-localname
-                (tramp-dissect-file-name (expand-file-name target))))))
+         (setq target (tramp-file-local-name (expand-file-name target)))))
 
       ;; If TARGET is still remote, quote it.
       (if (tramp-tramp-file-p target)
@@ -2171,8 +2181,8 @@ the uid and gid from FILENAME."
                            v 'file-error
                            "Unknown operation `%s', must be `copy' or `rename'"
                            op))))
-            (localname1 (tramp-compat-file-local-name filename))
-            (localname2 (tramp-compat-file-local-name newname))
+            (localname1 (tramp-file-local-name filename))
+            (localname2 (tramp-file-local-name newname))
             (prefix (file-remote-p (if t1 filename newname)))
              cmd-result)
        (when (and (eq op 'copy) (file-directory-p filename))
@@ -2796,8 +2806,11 @@ the result will be a local, non-Tramp, file name."
 ;; We use BUFFER also as connection buffer during setup. Because of
 ;; this, its original contents must be saved, and restored once
 ;; connection has been setup.
+;; The complete STDERR buffer is available only when the process has
+;; terminated.
 (defun tramp-sh-handle-make-process (&rest args)
-  "Like `make-process' for Tramp files."
+  "Like `make-process' for Tramp files.
+STDERR can also be a file name."
   (when args
     (with-parsed-tramp-file-name (expand-file-name default-directory) nil
       (let ((name (plist-get args :name))
@@ -2829,14 +2842,23 @@ the result will be a local, non-Tramp, file name."
          (signal 'wrong-type-argument (list #'functionp sentinel)))
        (unless (or (null stderr) (bufferp stderr) (stringp stderr))
          (signal 'wrong-type-argument (list #'stringp stderr)))
+       (when (and (stringp stderr) (tramp-tramp-file-p stderr)
+                  (not (tramp-equal-remote default-directory stderr)))
+         (signal 'file-error (list "Wrong stderr" stderr)))
 
        (let* ((buffer
                (if buffer
                    (get-buffer-create buffer)
                  ;; BUFFER can be nil.  We use a temporary buffer.
                  (generate-new-buffer tramp-temp-buffer-name)))
-              (stderr (and stderr (get-buffer-create stderr)))
-              (tmpstderr (and stderr (tramp-make-tramp-temp-file v)))
+              ;; STDERR can also be a file name.
+              (tmpstderr
+               (and stderr
+                    (if (and (stringp stderr) (tramp-tramp-file-p stderr))
+                        (tramp-unquote-file-local-name stderr)
+                      (tramp-make-tramp-temp-file v))))
+              (remote-tmpstderr
+               (and tmpstderr (tramp-make-tramp-file-name v tmpstderr)))
               (program (car command))
               (args (cdr command))
               ;; When PROGRAM matches "*sh", and the first arg is
@@ -2965,21 +2987,35 @@ the result will be a local, non-Tramp, file name."
                      (ignore-errors
                        (set-process-query-on-exit-flag p (null noquery))
                        (set-marker (process-mark p) (point)))
+                     ;; We must flush them here already; otherwise
+                     ;; `rename-file', `delete-file' or
+                     ;; `insert-file-contents' will fail.
+                     (tramp-flush-connection-property v "process-name")
+                     (tramp-flush-connection-property v "process-buffer")
+                     ;; Copy tmpstderr file.
+                     (when (and (stringp stderr)
+                                (not (tramp-tramp-file-p stderr)))
+                       (add-function
+                        :after (process-sentinel p)
+                        (lambda (_proc _msg)
+                          (rename-file remote-tmpstderr stderr))))
                      ;; Provide error buffer.  This shows only
                      ;; initial error messages; messages arriving
-                     ;; later on shall be inserted by `auto-revert'.
-                     ;; The temporary file will still be existing.
-                     ;; TODO: Write a sentinel, which deletes the
-                     ;; temporary file.
-                     (when tmpstderr
-                       ;; We must flush them here already; otherwise
-                       ;; `insert-file-contents' will fail.
-                       (tramp-flush-connection-property v "process-name")
-                       (tramp-flush-connection-property v "process-buffer")
+                     ;; later on will be inserted when the process is
+                     ;; deleted.  The temporary file will exist until
+                     ;; the process is deleted.
+                     (when (bufferp stderr)
                        (with-current-buffer stderr
-                         (insert-file-contents
-                          (tramp-make-tramp-file-name v tmpstderr) 'visit)
-                         (auto-revert-mode)))
+                         (insert-file-contents-literally
+                          remote-tmpstderr 'visit))
+                       ;; Delete tmpstderr file.
+                       (add-function
+                        :after (process-sentinel p)
+                        (lambda (_proc _msg)
+                          (with-current-buffer stderr
+                            (insert-file-contents-literally
+                             remote-tmpstderr 'visit nil nil 'replace))
+                          (delete-file remote-tmpstderr))))
                      ;; Return process.
                      p)))
 
@@ -3028,7 +3064,7 @@ the result will be a local, non-Tramp, file name."
        (setq infile (expand-file-name infile))
        (if (tramp-equal-remote default-directory infile)
            ;; INFILE is on the same remote host.
-           (setq input (with-parsed-tramp-file-name infile nil localname))
+           (setq input (tramp-file-local-name infile))
          ;; INFILE must be copied to remote host.
          (setq input (tramp-make-tramp-temp-file v)
                tmpinput (tramp-make-tramp-file-name v input 'nohop))
@@ -3059,8 +3095,7 @@ the result will be a local, non-Tramp, file name."
          (setcar (cdr destination) (expand-file-name (cadr destination)))
          (if (tramp-equal-remote default-directory (cadr destination))
              ;; stderr is on the same remote host.
-             (setq stderr (with-parsed-tramp-file-name
-                              (cadr destination) nil localname))
+             (setq stderr (tramp-file-local-name (cadr destination)))
            ;; stderr must be copied to remote host.  The temporary
            ;; file must be deleted after execution.
            (setq stderr (tramp-make-tramp-temp-file v)
@@ -3122,7 +3157,7 @@ the result will be a local, non-Tramp, file name."
   (append
    (tramp-get-remote-path (tramp-dissect-file-name default-directory))
    ;; The equivalent to `exec-directory'.
-   `(,(tramp-compat-file-local-name default-directory))))
+   `(,(tramp-file-local-name (expand-file-name default-directory)))))
 
 (defun tramp-sh-handle-file-local-copy (filename)
   "Like `file-local-copy' for Tramp files."
@@ -3995,8 +4030,7 @@ variable PATH."
       (setq tmpfile
            (tramp-make-tramp-file-name vec (tramp-make-tramp-temp-file vec)))
       (write-region command nil tmpfile)
-      (tramp-send-command
-       vec (format ". %s" (tramp-compat-file-local-name tmpfile)))
+      (tramp-send-command vec (format ". %s" (tramp-file-local-name tmpfile)))
       (delete-file tmpfile))))
 
 ;; ------------------------------------------------------------
@@ -4383,7 +4417,7 @@ and end of region, and are expected to replace the region 
contents
 with the encoded or decoded results, respectively.")
 
 (defconst tramp-remote-coding-commands
-  `((b64 "base64" "base64 -d -i")
+  '((b64 "base64" "base64 -d -i")
     ;; "-i" is more robust with older base64 from GNU coreutils.
     ;; However, I don't know whether all base64 versions do supports
     ;; this option.
@@ -4394,8 +4428,9 @@ with the encoded or decoded results, respectively.")
     (b64 "recode data..base64" "recode base64..data")
     (b64 tramp-perl-encode-with-module tramp-perl-decode-with-module)
     (b64 tramp-perl-encode tramp-perl-decode)
-    ;; This is painful slow, so we put it on the end.
-    (b64 tramp-awk-encode tramp-awk-decode ,tramp-awk-coding-test)
+    ;; These are painfully slow, so we put them on the end.
+    (b64 tramp-hexdump-awk-encode tramp-awk-decode)
+    (b64 tramp-od-awk-encode tramp-awk-decode)
     (uu  "uuencode xxx" "uudecode -o /dev/stdout" "test -c /dev/stdout")
     (uu  "uuencode xxx" "uudecode -o -")
     (uu  "uuencode xxx" "uudecode -p")
@@ -4421,6 +4456,8 @@ Perl or Shell implementation for this functionality.  This
 program will be transferred to the remote host, and it is
 available as shell function with the same name.  A \"%t\" format
 specifier in the variable value denotes a temporary file.
+\"%a\", \"%h\" and \"%o\" format specifiers are replaced by the
+respective `awk', `hexdump' and `od' commands.
 
 The optional TEST command can be used for further tests, whether
 ENCODING and DECODING are applicable.")
@@ -4471,11 +4508,6 @@ Goes through the list `tramp-local-coding-commands' and
                     vec 5 "Checking remote test command `%s'" rem-test)
                    (unless (tramp-send-command-and-check vec rem-test t)
                      (throw 'wont-work-remote nil)))
-                 ;; Check if remote perl exists when necessary.
-                 (when (and (symbolp rem-enc)
-                            (string-match-p "perl" (symbol-name rem-enc))
-                            (not (tramp-get-remote-perl vec)))
-                   (throw 'wont-work-remote nil))
                  ;; Check if remote encoding and decoding commands can be
                  ;; called remotely with null input and output.  This makes
                  ;; sure there are no syntax errors and the command is really
@@ -4485,10 +4517,36 @@ Goes through the list `tramp-local-coding-commands' and
                  ;; redirecting "mimencode" output to /dev/null, then as root
                  ;; it might change the permissions of /dev/null!
                  (unless (stringp rem-enc)
-                   (let ((name (symbol-name rem-enc)))
+                   (let ((name (symbol-name rem-enc))
+                         (value (symbol-value rem-enc)))
+                     ;; Check if remote perl exists when necessary.
+                     (and (string-match-p "perl" name)
+                          (not (tramp-get-remote-perl vec))
+                          (throw 'wont-work-remote nil))
+                     ;; Check if remote awk exists when necessary.
+                     (and (string-match-p "\\(^\\|[^%]\\)%a" value)
+                          (not (tramp-get-remote-awk vec))
+                          (throw 'wont-work-remote nil))
+                     ;; Check if remote hexdump exists when necessary.
+                     (and (string-match-p "\\(^\\|[^%]\\)%h" value)
+                          (not (tramp-get-remote-hexdump vec))
+                          (throw 'wont-work-remote nil))
+                     ;; Check if remote od exists when necessary.
+                     (and (string-match-p "\\(^\\|[^%]\\)%o" value)
+                          (not (tramp-get-remote-od vec))
+                          (throw 'wont-work-remote nil))
                      (while (string-match "-" name)
                        (setq name (replace-match "_" nil t name)))
-                     (tramp-maybe-send-script vec (symbol-value rem-enc) name)
+                     (when (string-match-p "\\(^\\|[^%]\\)%[aho]" value)
+                       (setq value
+                             (format-spec
+                              value
+                              (format-spec-make
+                               ?a (tramp-get-remote-awk vec)
+                               ?h (tramp-get-remote-hexdump vec)
+                               ?o (tramp-get-remote-od vec)))
+                             value (replace-regexp-in-string "%" "%%" value)))
+                     (tramp-maybe-send-script vec value name)
                      (setq rem-enc name)))
                  (tramp-message
                   vec 5
@@ -4503,6 +4561,15 @@ Goes through the list `tramp-local-coding-commands' and
                          tmpfile)
                      (while (string-match "-" name)
                        (setq name (replace-match "_" nil t name)))
+                     (when (string-match-p "\\(^\\|[^%]\\)%[aho]" value)
+                       (setq value
+                             (format-spec
+                              value
+                              (format-spec-make
+                               ?a (tramp-get-remote-awk vec)
+                               ?h (tramp-get-remote-hexdump vec)
+                               ?o (tramp-get-remote-od vec)))
+                             value (replace-regexp-in-string "%" "%%" value)))
                      (when (string-match-p "\\(^\\|[^%]\\)%t" value)
                        (setq tmpfile
                              (make-temp-name
@@ -4513,7 +4580,7 @@ Goes through the list `tramp-local-coding-commands' and
                              (format-spec
                               value
                               (format-spec-make
-                               ?t (tramp-compat-file-local-name tmpfile)))))
+                               ?t (tramp-file-local-name tmpfile)))))
                      (tramp-maybe-send-script vec value name)
                      (setq rem-dec name)))
                  (tramp-message
@@ -4796,7 +4863,7 @@ If there is just some editing, retry it after 5 seconds."
         vec 5 "Cannot timeout session, trying it again in %s seconds." 5)
        (run-at-time 5 nil 'tramp-timeout-session vec))
     (tramp-message
-     vec 3 "Timeout session %s" (tramp-make-tramp-file-name vec 'localname))
+     vec 3 "Timeout session %s" (tramp-make-tramp-file-name vec 'noloc))
     (tramp-cleanup-connection vec 'keep-debug)))
 
 (defun tramp-maybe-open-connection (vec)
@@ -5594,7 +5661,7 @@ This command is returned only if 
`delete-by-moving-to-trash' is non-nil."
           "%s -t %s %s"
           result
           (format-time-string "%Y%m%d%H%M.%S")
-          (tramp-compat-file-local-name tmpfile))))
+          (tramp-file-local-name tmpfile))))
        (delete-file tmpfile))
       result)))
 
@@ -5769,6 +5836,47 @@ ID-FORMAT valid values are `string' and `integer'."
        tramp-unknown-id-string)
        (t res)))))
 
+(defun tramp-get-remote-busybox (vec)
+  "Determine remote `busybox' command."
+  (with-tramp-connection-property vec "busybox"
+    (tramp-message vec 5 "Finding a suitable `busybox' command")
+    (tramp-find-executable vec "busybox" (tramp-get-remote-path vec))))
+
+(defun tramp-get-remote-awk (vec)
+  "Determine remote `awk' command."
+  (with-tramp-connection-property vec "awk"
+    (tramp-message vec 5 "Finding a suitable `awk' command")
+    (or (tramp-find-executable vec "awk" (tramp-get-remote-path vec))
+       (let* ((busybox (tramp-get-remote-busybox vec))
+              (command (format "%s %s" busybox "awk")))
+         (and busybox
+              (tramp-send-command-and-check
+               vec (concat command " {} </dev/null"))
+              command)))))
+
+(defun tramp-get-remote-hexdump (vec)
+  "Determine remote `hexdump' command."
+  (with-tramp-connection-property vec "hexdump"
+    (tramp-message vec 5 "Finding a suitable `hexdump' command")
+    (or (tramp-find-executable vec "hexdump" (tramp-get-remote-path vec))
+       (let* ((busybox (tramp-get-remote-busybox vec))
+              (command (format "%s %s" busybox "hexdump")))
+         (and busybox
+              (tramp-send-command-and-check vec (concat command " </dev/null"))
+              command)))))
+
+(defun tramp-get-remote-od (vec)
+  "Determine remote `od' command."
+  (with-tramp-connection-property vec "od"
+    (tramp-message vec 5 "Finding a suitable `od' command")
+    (or (tramp-find-executable vec "od" (tramp-get-remote-path vec))
+       (let* ((busybox (tramp-get-remote-busybox vec))
+              (command (format "%s %s" busybox "od")))
+         (and busybox
+              (tramp-send-command-and-check
+               vec (concat command " -A n </dev/null"))
+              command)))))
+
 (defun tramp-get-env-with-u-option (vec)
   "Check, whether the remote `env' command supports the -u option."
   (with-tramp-connection-property vec "env-u-option"
diff --git a/tramp-smb.el b/tramp-smb.el
index 1a4b63d..d233af1 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-2019 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <address@hidden>
 ;; Keywords: comm, processes
@@ -1188,9 +1188,7 @@ component is used as the target of the symlink."
       (let ((non-essential t))
        (when (and (tramp-tramp-file-p target)
                   (tramp-file-name-equal-p v (tramp-dissect-file-name target)))
-         (setq target
-               (tramp-file-name-localname
-                (tramp-dissect-file-name (expand-file-name target))))))
+         (setq target (tramp-file-local-name (expand-file-name target)))))
 
       ;; If TARGET is still remote, quote it.
       (if (tramp-tramp-file-p target)
@@ -1244,7 +1242,7 @@ component is used as the target of the symlink."
        (setq infile (expand-file-name infile))
        (if (tramp-equal-remote default-directory infile)
            ;; INFILE is on the same remote host.
-           (setq input (with-parsed-tramp-file-name infile nil localname))
+           (setq input (tramp-file-local-name infile))
          ;; INFILE must be copied to remote host.
          (setq input (tramp-make-tramp-temp-file v)
                tmpinput (tramp-make-tramp-file-name v input))
diff --git a/tramp-sudoedit.el b/tramp-sudoedit.el
index 2a588f7..e5590b8 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-2019 Free Software Foundation, Inc.
+;; Copyright (C) 2018-2020 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <address@hidden>
 ;; Keywords: comm, processes
@@ -265,10 +265,8 @@ absolute file names."
              v 0 (format "%s %s to %s" msg-operation filename newname)
            (unless (tramp-sudoedit-send-command
                     v sudoedit-operation
-                    (tramp-compat-file-name-unquote
-                     (tramp-compat-file-local-name filename))
-                    (tramp-compat-file-name-unquote
-                     (tramp-compat-file-local-name newname)))
+                    (tramp-unquote-file-local-name filename)
+                    (tramp-unquote-file-local-name newname))
              (tramp-error
               v 'file-error
               "Error %s `%s' `%s'" msg-operation filename newname))))
@@ -508,21 +506,21 @@ the result will be a local, non-Tramp, file name."
       (tramp-message v 5 "file system info: %s" localname)
       (when (tramp-sudoedit-send-command
             v "df" "--block-size=1" "--output=size,used,avail"
-            (tramp-compat-file-name-unquote localname)))
-      (with-current-buffer (tramp-get-connection-buffer v)
-       (goto-char (point-min))
-       (forward-line)
-       (when (looking-at
-              (eval-when-compile
-                (concat "[[:space:]]*\\([[:digit:]]+\\)"
-                        "[[:space:]]+\\([[:digit:]]+\\)"
-                        "[[:space:]]+\\([[:digit:]]+\\)")))
-         (list (string-to-number (match-string 1))
-               ;; The second value is the used size.  We need the
-               ;; free size.
-               (- (string-to-number (match-string 1))
-                  (string-to-number (match-string 2)))
-               (string-to-number (match-string 3))))))))
+            (tramp-compat-file-name-unquote localname))
+       (with-current-buffer (tramp-get-connection-buffer v)
+         (goto-char (point-min))
+         (forward-line)
+         (when (looking-at
+                (eval-when-compile
+                  (concat "[[:space:]]*\\([[:digit:]]+\\)"
+                          "[[:space:]]+\\([[:digit:]]+\\)"
+                          "[[:space:]]+\\([[:digit:]]+\\)")))
+           (list (string-to-number (match-string 1))
+                 ;; The second value is the used size.  We need the
+                 ;; free size.
+                 (- (string-to-number (match-string 1))
+                    (string-to-number (match-string 2)))
+                 (string-to-number (match-string 3)))))))))
 
 (defun tramp-sudoedit-handle-set-file-times (filename &optional time)
   "Like `set-file-times' for Tramp files."
@@ -615,9 +613,7 @@ component is used as the target of the symlink."
       (let ((non-essential t))
        (when (and (tramp-tramp-file-p target)
                   (tramp-file-name-equal-p v (tramp-dissect-file-name target)))
-         (setq target
-               (tramp-file-name-localname
-                (tramp-dissect-file-name (expand-file-name target))))))
+         (setq target (tramp-file-local-name (expand-file-name target)))))
 
       ;; If TARGET is still remote, quote it.
       (if (tramp-tramp-file-p target)
@@ -715,8 +711,7 @@ ID-FORMAT valid values are `string' and `integer'."
        (format "%d:%d"
               (or uid (tramp-sudoedit-get-remote-uid v 'integer))
               (or gid (tramp-sudoedit-get-remote-gid v 'integer)))
-       (tramp-compat-file-name-unquote
-       (tramp-compat-file-local-name filename)))))
+       (tramp-unquote-file-local-name filename))))
 
 (defun tramp-sudoedit-handle-write-region
   (start end filename &optional append visit lockname mustbenew)
diff --git a/tramp-uu.el b/tramp-uu.el
index c12a4eb..6a044e5 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-2019 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2020 Free Software Foundation, Inc.
 
 ;; Author: Kai Großjohann <address@hidden>
 ;; Maintainer: Michael Albinus <address@hidden>
diff --git a/tramp.el b/tramp.el
index 79cc042..22b1ffb 100644
--- a/tramp.el
+++ b/tramp.el
@@ -1,13 +1,13 @@
 ;;; tramp.el --- Transparent Remote Access, Multiple Protocol  -*- 
lexical-binding:t -*-
 
-;; Copyright (C) 1998-2019 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2020 Free Software Foundation, Inc.
 
 ;; Author: Kai Großjohann <address@hidden>
 ;;         Michael Albinus <address@hidden>
 ;; Maintainer: Michael Albinus <address@hidden>
 ;; Keywords: comm, processes
 ;; Package: tramp
-;; Version: 2.4.3
+;; Version: 2.4.3.1
 ;; Package-Requires: ((emacs "24.4"))
 ;; Package-Type: multi
 ;; URL: https://savannah.gnu.org/projects/tramp
@@ -1033,7 +1033,7 @@ initial value is overwritten by the car of 
`tramp-file-name-structure'.")
 
 ;;;###autoload
 (defcustom tramp-ignored-file-name-regexp nil
-  "Regular expression matching file names that are not under Tramp’s control."
+  "Regular expression matching file names that are not under Tramp's control."
   :version "27.1"
   :type '(choice (const nil) regexp))
 
@@ -1329,6 +1329,29 @@ entry does not exist, return nil."
        (string-match-p tramp-file-name-regexp name)
        t))
 
+;; This function bypasses the file name handler approach.  It is NOT
+;; recommended to use it in any package if not absolutely necessary.
+;; However, it is more performant than `file-local-name', and might be
+;; useful where performance matters, like in operations over a bulk
+;; list of file names.
+(defun tramp-file-local-name (name)
+  "Return the local name component of NAME.
+This function removes from NAME the specification of the remote
+host and the method of accessing the host, leaving only the part
+that identifies NAME locally on the remote system.  If NAME does
+not match `tramp-file-name-regexp', just `file-local-name' is
+called.  The returned file name can be used directly as argument
+of `process-file', `start-file-process', or `shell-command'."
+  (or (and (tramp-tramp-file-p name)
+           (string-match (nth 0 tramp-file-name-structure) name)
+           (match-string (nth 4 tramp-file-name-structure) name))
+      (tramp-compat-file-local-name name)))
+
+;; The localname can be quoted with "/:".  Extract this.
+(defun tramp-unquote-file-local-name (name)
+  "Return unquoted localname of NAME."
+  (tramp-compat-file-name-unquote (tramp-file-local-name name)))
+
 (defun tramp-find-method (method user host)
   "Return the right method string to use depending on USER and HOST.
 This is METHOD, if non-nil.  Otherwise, do a lookup in
@@ -1574,7 +1597,7 @@ necessary only.  This function will be used in file name 
completion."
                  tramp-prefix-ipv6-format host tramp-postfix-ipv6-format)
               host)
             tramp-postfix-host-format))
-         (when localname localname)))
+         localname))
 
 (defun tramp-get-buffer (vec &optional dont-create)
   "Get the connection buffer to be used for VEC.
@@ -1630,7 +1653,7 @@ version, the function does nothing."
   "Set connection-local variables in the current buffer.
 If connection-local variables are not supported by this Emacs
 version, the function does nothing."
-  (when (file-remote-p default-directory)
+  (when (tramp-tramp-file-p default-directory)
     ;; `hack-connection-local-variables-apply' exists since Emacs 26.1.
     (tramp-compat-funcall
      'hack-connection-local-variables-apply
@@ -1719,10 +1742,6 @@ ARGUMENTS to actually emit the message (if applicable)."
     (let ((now (current-time)))
       (insert (format-time-string "%T." now))
       (insert (format "%06d " (nth 2 now))))
-    ;; Threads.
-    (unless (or (null tramp-compat-main-thread)
-               (eq (tramp-compat-current-thread) tramp-compat-main-thread))
-      (insert (format "%s " (tramp-compat-current-thread))))
     ;; Calling Tramp function.  We suppress compat and trace functions
     ;; from being displayed.
     (let ((btn 1) btf fn)
@@ -2303,24 +2322,10 @@ preventing reentrant calls of Tramp.")
 Together with `tramp-locked', this implements a locking mechanism
 preventing reentrant calls of Tramp.")
 
-;; Mutexes have entered Emacs 26.1.
-(defvar tramp-mutex (tramp-compat-funcall 'make-mutex "tramp")
-  "Global mutex for Tramp threads.")
-
-(defun tramp-get-mutex (vec)
-  "Return the mutex locking Tramp threads for VEC."
-  (let ((p (and (tramp-connectable-p vec)
-               (tramp-get-connection-process vec))))
-    (if p
-      (with-tramp-connection-property p "mutex"
-       (tramp-compat-funcall 'make-mutex (process-name p)))
-      tramp-mutex)))
-
 ;; Main function.
 (defun tramp-file-name-handler (operation &rest args)
   "Invoke Tramp file name handler for OPERATION and ARGS.
-Fall back to normal file name handler if no Tramp file name handler exists.
-If Emacs is compiled --with-threads, the body is protected by a mutex."
+Fall back to normal file name handler if no Tramp file name handler exists."
   (let ((filename (apply #'tramp-file-name-for-operation operation args))
        ;; `file-remote-p' is called for everything, even for symbolic
        ;; links which look remote.  We don't want to get an error.
@@ -2329,103 +2334,88 @@ If Emacs is compiled --with-threads, the body is 
protected by a mutex."
        (save-match-data
           (setq filename (tramp-replace-environment-variables filename))
           (with-parsed-tramp-file-name filename nil
-           ;; Give other threads a chance.
-           (tramp-compat-thread-yield)
-           ;; The mutex allows concurrent run of operations.  It
-           ;; guarantees, that the threads are not mixed.
-           (tramp-compat-with-mutex (tramp-get-mutex v)
-             (let ((current-connection tramp-current-connection)
-                   (foreign
-                    (tramp-find-foreign-file-name-handler filename operation))
-                   (signal-hook-function #'tramp-signal-hook-function)
-                   result)
-               ;; Set `tramp-current-connection'.
-               (unless
-                   (tramp-file-name-equal-p v (car tramp-current-connection))
-                 (setq tramp-current-connection (list v)))
-
-               ;; Call the backend function.
-               (unwind-protect
-                   (if foreign
-                       (let ((sf (symbol-function foreign))
-                             p)
-                         ;; Some packages set the default directory
-                         ;; to a remote path, before respective Tramp
-                         ;; packages are already loaded.  This
-                         ;; results in recursive loading.  Therefore,
-                         ;; we load the Tramp packages locally.
-                         (when (autoloadp sf)
-                            ;; FIXME: Not clear why we need these bindings 
here.
-                            ;; The explanation above is not convincing and
-                            ;; the bug#9114 for which it was added doesn't
-                            ;; clarify the core of the problem.
-                           (let ((default-directory
-                                   (tramp-compat-temporary-file-directory))
-                                 file-name-handler-alist)
-                             (autoload-do-load sf foreign)))
-                         ;; (tramp-message
-                         ;;  v 4 "Running `%s'..." (cons operation args))
-                         ;; Switch process thread.
-                         (when (and tramp-mutex
-                                    (tramp-connectable-p v)
-                                    (setq p (tramp-get-connection-process v)))
-                           (tramp-compat-funcall
-                            'set-process-thread
-                            p (tramp-compat-current-thread)))
-                         ;; If `non-essential' is non-nil, Tramp
-                         ;; shall not open a new connection.
-                         ;; If Tramp detects that it shouldn't
-                         ;; continue to work, it throws the
-                         ;; `suppress' event.  This could happen for
-                         ;; example, when Tramp tries to open the
-                         ;; same connection twice in a short time
-                         ;; frame.
-                         ;; In both cases, we try the default handler
-                         ;; then.
-                         (setq result
-                               (catch 'non-essential
-                                 (catch 'suppress
-                                   (when (and tramp-locked (not tramp-locker))
-                                     (setq tramp-locked nil)
-                                     (tramp-error
-                                      v 'file-error
-                                      "Forbidden reentrant call of Tramp"))
-                                   (let ((tl tramp-locked))
-                                     (setq tramp-locked t)
-                                     (unwind-protect
-                                         (let ((tramp-locker t))
-                                           (apply foreign operation args))
-                                       (setq tramp-locked tl))))))
-                         ;; (tramp-message
-                         ;;  v 4 "Running `%s'...`%s'" (cons operation args) 
result)
-                         (cond
-                          ((eq result 'non-essential)
+            (let ((current-connection tramp-current-connection)
+                 (foreign
+                  (tramp-find-foreign-file-name-handler filename operation))
+                 (signal-hook-function #'tramp-signal-hook-function)
+                 result)
+             ;; Set `tramp-current-connection'.
+             (unless
+                 (tramp-file-name-equal-p v (car tramp-current-connection))
+               (setq tramp-current-connection (list v)))
+
+             ;; Call the backend function.
+             (unwind-protect
+                 (if foreign
+                     (let ((sf (symbol-function foreign)))
+                       ;; Some packages set the default directory to
+                       ;; a remote path, before respective Tramp
+                       ;; packages are already loaded.  This results
+                       ;; in recursive loading.  Therefore, we load
+                       ;; the Tramp packages locally.
+                       (when (autoloadp sf)
+                          ;; FIXME: Not clear why we need these bindings here.
+                          ;; The explanation above is not convincing and
+                          ;; the bug#9114 for which it was added doesn't
+                          ;; clarify the core of the problem.
+                         (let ((default-directory
+                                 (tramp-compat-temporary-file-directory))
+                               file-name-handler-alist)
+                           (autoload-do-load sf foreign)))
+                        ;; (tramp-message
+                        ;;  v 4 "Running `%s'..." (cons operation args))
+                        ;; If `non-essential' is non-nil, Tramp shall
+                       ;; not open a new connection.
+                       ;; If Tramp detects that it shouldn't continue
+                       ;; to work, it throws the `suppress' event.
+                       ;; This could happen for example, when Tramp
+                       ;; tries to open the same connection twice in
+                       ;; a short time frame.
+                       ;; In both cases, we try the default handler then.
+                       (setq result
+                             (catch 'non-essential
+                               (catch 'suppress
+                                 (when (and tramp-locked (not tramp-locker))
+                                   (setq tramp-locked nil)
+                                   (tramp-error
+                                    v 'file-error
+                                    "Forbidden reentrant call of Tramp"))
+                                 (let ((tl tramp-locked))
+                                   (setq tramp-locked t)
+                                   (unwind-protect
+                                       (let ((tramp-locker t))
+                                         (apply foreign operation args))
+                                     (setq tramp-locked tl))))))
+                        ;; (tramp-message
+                        ;;  v 4 "Running `%s'...`%s'" (cons operation args) 
result)
+                       (cond
+                        ((eq result 'non-essential)
+                         (tramp-message
+                          v 5 "Non-essential received in operation %s"
+                          (cons operation args))
+                         (tramp-run-real-handler operation args))
+                        ((eq result 'suppress)
+                         (let (tramp-message-show-message)
                            (tramp-message
-                            v 5 "Non-essential received in operation %s"
+                            v 1 "Suppress received in operation %s"
                             (cons operation args))
-                           (tramp-run-real-handler operation args))
-                          ((eq result 'suppress)
-                           (let (tramp-message-show-message)
-                             (tramp-message
-                              v 1 "Suppress received in operation %s"
-                              (cons operation args))
-                             (tramp-cleanup-connection v t)
-                             (tramp-run-real-handler operation args)))
-                          (t result)))
-
-                     ;; Nothing to do for us.  However, since we are
-                     ;; in `tramp-mode', we must suppress the volume
-                     ;; letter on MS Windows.
-                     (setq result (tramp-run-real-handler operation args))
-                     (if (stringp result)
-                         (tramp-drop-volume-letter result)
-                       result))
-
-                 ;; Reset `tramp-current-connection'.
-                 (unless
-                     (tramp-file-name-equal-p
-                      (car current-connection) (car tramp-current-connection))
-                   (setq tramp-current-connection current-connection)))))))
+                           (tramp-cleanup-connection v t)
+                           (tramp-run-real-handler operation args)))
+                        (t result)))
+
+                   ;; Nothing to do for us.  However, since we are in
+                   ;; `tramp-mode', we must suppress the volume
+                   ;; letter on MS Windows.
+                   (setq result (tramp-run-real-handler operation args))
+                   (if (stringp result)
+                       (tramp-drop-volume-letter result)
+                     result))
+
+               ;; Reset `tramp-current-connection'.
+               (unless
+                   (tramp-file-name-equal-p
+                    (car current-connection) (car tramp-current-connection))
+                 (setq tramp-current-connection current-connection))))))
 
       ;; When `tramp-mode' is not enabled, or the file name is quoted,
       ;; we don't do anything.
@@ -2879,7 +2869,7 @@ User is always nil."
   (let ((default-directory (tramp-compat-temporary-file-directory)))
     (when (file-readable-p filename)
       (with-temp-buffer
-       (insert-file-contents filename)
+       (insert-file-contents-literally filename)
        (goto-char (point-min))
         (cl-loop while (not (eobp)) collect (funcall function))))))
 
@@ -3262,7 +3252,7 @@ User is always nil."
                  ;; lower case letters.  This avoids us to create a
                  ;; temporary file.
                  (while (and (string-match-p
-                              "[a-z]" (tramp-compat-file-local-name candidate))
+                              "[a-z]" (tramp-file-local-name candidate))
                              (not (file-exists-p candidate)))
                    (setq candidate
                          (directory-file-name
@@ -3272,8 +3262,7 @@ User is always nil."
                  ;; to Emacs 26+ like `file-name-case-insensitive-p',
                  ;; so there is no compatibility problem calling it.
                  (unless
-                     (string-match-p
-                      "[a-z]" (tramp-compat-file-local-name candidate))
+                     (string-match-p "[a-z]" (tramp-file-local-name candidate))
                    (setq tmpfile
                          (let ((default-directory
                                  (file-name-directory filename)))
@@ -3286,7 +3275,7 @@ User is always nil."
                      (file-exists-p
                       (concat
                        (file-remote-p candidate)
-                       (upcase (tramp-compat-file-local-name candidate))))
+                       (upcase (tramp-file-local-name candidate))))
                    ;; Cleanup.
                    (when tmpfile (delete-file tmpfile)))))))))))
 
@@ -3428,7 +3417,7 @@ User is always nil."
               (tramp-error
                v1 'file-error
                "Maximum number (%d) of symlinks exceeded" numchase-limit)))
-          (tramp-compat-file-local-name (directory-file-name result)))))))))
+          (tramp-file-local-name (directory-file-name result)))))))))
 
 (defun tramp-handle-file-writable-p (filename)
   "Like `file-writable-p' for Tramp files."
@@ -3660,6 +3649,7 @@ support symbolic links."
   (let* ((asynchronous (string-match-p "[ \t]*&[ \t]*\\'" command))
         (command (substring command 0 asynchronous))
         current-buffer-p
+        (output-buffer-p output-buffer)
         (output-buffer
          (cond
           ((bufferp output-buffer) output-buffer)
@@ -3677,6 +3667,7 @@ support symbolic links."
           ((stringp error-buffer) (get-buffer-create error-buffer))))
         (bname (buffer-name output-buffer))
         (p (get-buffer-process output-buffer))
+        (dir default-directory)
         buffer)
 
     ;; The following code is taken from `shell-command', slightly
@@ -3713,7 +3704,11 @@ support symbolic links."
          (rename-uniquely))
         (setq output-buffer (get-buffer-create bname)))))
 
-    (setq buffer (if (and (not asynchronous) error-buffer)
+    (unless output-buffer-p
+      (with-current-buffer output-buffer
+       (setq default-directory dir)))
+
+    (setq buffer (if error-buffer
                     (with-parsed-tramp-file-name default-directory nil
                       (list output-buffer
                             (tramp-make-tramp-file-name
@@ -3741,21 +3736,37 @@ support symbolic links."
              ;; Run the process.
              (setq p (start-file-process-shell-command
                       (buffer-name output-buffer) buffer command))
-           ;; Display output.
-           (with-current-buffer output-buffer
-             (display-buffer output-buffer '(nil (allow-no-window . t)))
-             (setq mode-line-process '(":%s"))
-             (shell-mode)
-             (set-process-sentinel p #'shell-command-sentinel)
-             (set-process-filter p #'comint-output-filter))))
+           ;; Insert error messages if they were separated.
+           (when (consp buffer)
+             (with-current-buffer error-buffer
+               (insert-file-contents-literally (cadr buffer))))
+           (if (process-live-p p)
+             ;; Display output.
+             (with-current-buffer output-buffer
+               (display-buffer output-buffer '(nil (allow-no-window . t)))
+               (setq mode-line-process '(":%s"))
+               (shell-mode)
+               (set-process-filter p #'comint-output-filter)
+               (set-process-sentinel p #'shell-command-sentinel)
+               (when (consp buffer)
+                 (add-function
+                  :after (process-sentinel p)
+                  (lambda (_proc _string)
+                    (with-current-buffer error-buffer
+                      (insert-file-contents-literally
+                       (cadr buffer) nil nil nil 'replace))
+                    (delete-file (cadr buffer))))))
+
+             (when (consp buffer)
+               (delete-file (cadr buffer))))))
 
       (prog1
          ;; Run the process.
          (process-file-shell-command command nil buffer nil)
        ;; Insert error messages if they were separated.
-       (when (listp buffer)
+       (when (consp buffer)
          (with-current-buffer error-buffer
-           (insert-file-contents (cadr buffer)))
+           (insert-file-contents-literally (cadr buffer)))
          (delete-file (cadr buffer)))
        (if current-buffer-p
            ;; This is like exchange-point-and-mark, but doesn't
@@ -3770,13 +3781,16 @@ support symbolic links."
            (display-message-or-buffer output-buffer)))))))
 
 (defun tramp-handle-start-file-process (name buffer program &rest args)
-  "Like `start-file-process' for Tramp files."
+  "Like `start-file-process' for Tramp files.
+BUFFER might be a list, in this case STDERR is separated."
   ;; `make-process' knows the `:file-handler' argument since Emacs 27.1 only.
   (tramp-file-name-handler
    'make-process
    :name name
-   :buffer buffer
+   :buffer (if (consp buffer) (car buffer) buffer)
    :command (and program (cons program args))
+   ;; `shell-command' adds an errfile to `buffer'.
+   :stderr (when (consp buffer) (cadr buffer))
    :noquery nil
    :file-handler t))
 
@@ -3813,10 +3827,10 @@ support symbolic links."
        filename))))
 
 (defconst tramp-time-dont-know '(0 0 0 1000)
-  "An invalid time value, used as \"Don’t know\" value.")
+  "An invalid time value, used as \"Don't know\" value.")
 
 (defconst tramp-time-doesnt-exist '(-1 65535)
-  "An invalid time value, used as \"Doesn’t exist\" value.")
+  "An invalid time value, used as \"Doesn't exist\" value.")
 
 (defun tramp-handle-set-visited-file-modtime (&optional time-list)
   "Like `set-visited-file-modtime' for Tramp files."
@@ -4377,7 +4391,7 @@ would yield t.  On the other hand, the following check 
results in nil:
   (tramp-equal-remote \"/sudo::/etc\" \"/su::/etc\")
 
 If both files are local, the function returns t."
-  (or (and (null (file-remote-p file1)) (null (file-remote-p file2)))
+  (or (and (null (tramp-tramp-file-p file1)) (null (tramp-tramp-file-p file2)))
       (and (tramp-tramp-file-p file1) (tramp-tramp-file-p file2)
           (string-equal (file-remote-p file1) (file-remote-p file2)))))
 
@@ -4647,7 +4661,7 @@ This handles also chrooted environments, which are not 
regarded as local."
           (tramp-make-tramp-file-name
            vec (or (tramp-get-method-parameter vec 'tramp-tmpdir) "/tmp"))))
       (or (and (file-directory-p dir) (file-writable-p dir)
-              (tramp-compat-file-local-name dir))
+              (tramp-file-local-name dir))
          (tramp-error vec 'file-error "Directory %s not accessible" dir))
       dir)))
 
@@ -4670,7 +4684,7 @@ Return the local name of the temporary file."
        (set-file-modes result #o0700)))
 
     ;; Return the local part.
-    (with-parsed-tramp-file-name result nil localname)))
+    (tramp-file-local-name result)))
 
 (defun tramp-delete-temp-file-function ()
   "Remove temporary files related to current buffer."
@@ -4697,7 +4711,7 @@ this file, if that variable is non-nil."
 
   (let ((system-type
         (if (and (stringp tramp-auto-save-directory)
-                 (file-remote-p tramp-auto-save-directory))
+                 (tramp-tramp-file-p tramp-auto-save-directory))
             'not-windows
           system-type))
        (auto-save-file-name-transforms
diff --git a/tramp.info b/tramp.info
index 3e66ced..3100407 100644
--- a/tramp.info
+++ b/tramp.info
@@ -1,6 +1,6 @@
 This is tramp.info, produced by makeinfo version 6.6 from tramp.texi.
 
-Copyright © 1999–2019 Free Software Foundation, Inc.
+Copyright © 1999–2020 Free Software Foundation, Inc.
 
      Permission is granted to copy, distribute and/or modify this
      document under the terms of the GNU Free Documentation License,
@@ -21,10 +21,10 @@ END-INFO-DIR-ENTRY
 
 File: tramp.info,  Node: Top,  Next: Overview,  Prev: (dir),  Up: (dir)
 
-TRAMP 2.4.3 User Manual
-***********************
+TRAMP 2.4.3.1 User Manual
+*************************
 
-This file documents TRAMP 2.4.3, a remote file editing package for
+This file documents TRAMP 2.4.3.1, a remote file editing package for
 Emacs.
 
    TRAMP stands for “Transparent Remote (file) Access, Multiple
@@ -42,7 +42,7 @@ and ‘rcp’ or other work-alike programs, such as ‘ssh’/‘scp’.
 <address@hidden>, and archived at the TRAMP Mail Archive
 (https://lists.gnu.org/r/tramp-devel/).
 
-   Copyright © 1999–2019 Free Software Foundation, Inc.
+   Copyright © 1999–2020 Free Software Foundation, Inc.
 
      Permission is granted to copy, distribute and/or modify this
      document under the terms of the GNU Free Documentation License,
@@ -2815,7 +2815,11 @@ help the development team find the best solution and 
avoid unrelated
 detours.
 
    To exclude cache-related problems, flush all caches before running
-the test, *note Cleanup remote connections::.
+the test, *note Cleanup remote connections::.  Alternatively, and often
+better for analysis, reproduce the problem in a clean Emacs session
+started with ‘emacs -Q’.  Then, TRAMP does not load the persistency file
+(*note Connection caching::), and it does not use passwords from
+‘auth-source.el’ (*note Password handling::).
 
    When including TRAMP’s messages in the bug report, increase the
 verbosity level to 6 (*note Traces: Traces and Profiles.) in the
@@ -2848,8 +2852,8 @@ File: tramp.info,  Node: Frequently Asked Questions,  
Next: Files directories an
 
    • Which systems does it work on?
 
-     The package works successfully on Emacs 24, Emacs 25, Emacs 26, and
-     Emacs 27.
+     The package works successfully on Emacs 24, Emacs 25, Emacs 26,
+     Emacs 27, and Emacs 28.
 
      While Unix and Unix-like systems are the primary remote targets,
      TRAMP has equal success connecting to other platforms, such as MS
@@ -3603,7 +3607,7 @@ Appendix A GNU Free Documentation License
                      Version 1.3, 3 November 2008
 
      Copyright © 2000, 2001, 2002, 2007, 2008, 2009 Free Software Foundation, 
Inc.
-     <http://fsf.org/>
+     <https://fsf.org/>
 
      Everyone is permitted to copy and distribute verbatim copies
      of this license document, but changing it is not allowed.
@@ -4000,7 +4004,7 @@ Appendix A GNU Free Documentation License
      the GNU Free Documentation License from time to time.  Such new
      versions will be similar in spirit to the present version, but may
      differ in detail to address new problems or concerns.  See
-     <http://www.gnu.org/copyleft/>.
+     <https://www.gnu.org/licenses/>.
 
      Each version of the License is given a distinguishing version
      number.  If the Document specifies that a particular numbered
@@ -4573,61 +4577,61 @@ Concept Index
 
 Tag Table:
 Node: Top933
-Node: Overview5415
-Node: Obtaining TRAMP10749
-Node: Quick Start Guide13196
-Ref: Quick Start Guide: File name syntax13973
-Ref: Quick Start Guide: ssh and plink methods15075
-Ref: Quick Start Guide: su, sudo and sg methods15619
-Ref: Quick Start Guide: ssh, plink, su, sudo and sg methods16183
-Ref: Quick Start Guide: sudoedit method16713
-Ref: Quick Start Guide: smb method17124
-Ref: Quick Start Guide: GVFS-based methods17455
-Ref: Quick Start Guide: GNOME Online Accounts based methods17851
-Ref: Quick Start Guide: Android18393
-Ref: Quick Start Guide: rclone method18625
-Node: Configuration18952
-Node: Connection types21424
-Node: Inline methods22838
-Node: External methods27800
-Node: GVFS-based methods38438
-Node: Default Method41707
-Node: Default User44724
-Node: Default Host46253
-Node: Multi-hops47385
-Node: Firewalls51577
-Node: Customizing Methods53034
-Node: Customizing Completion55374
-Node: Password handling58864
-Ref: Using an authentication file59334
-Ref: Caching passwords60836
-Node: Connection caching61354
-Node: Predefined connection information62284
-Node: Remote programs66158
-Node: Remote shell setup69079
-Node: Android shell setup78695
-Node: Auto-save and Backup81082
-Node: Windows setup hints84157
-Node: Usage85777
-Node: File name syntax87130
-Node: Change file name syntax89137
-Node: File name completion90568
-Node: Ad-hoc multi-hops93723
-Node: Remote processes95789
-Ref: Running a debugger on a remote host104547
-Node: Cleanup remote connections106517
-Node: Renaming remote files108218
-Node: Archive file names112437
-Node: Bug Reports116802
-Node: Frequently Asked Questions119184
-Node: Files directories and localnames143070
-Node: Localname deconstruction143506
-Node: External packages144159
-Node: Traces and Profiles146204
-Node: GNU Free Documentation License148173
-Node: Function Index173544
-Node: Variable Index176422
-Node: Concept Index184031
+Node: Overview5421
+Node: Obtaining TRAMP10755
+Node: Quick Start Guide13202
+Ref: Quick Start Guide: File name syntax13979
+Ref: Quick Start Guide: ssh and plink methods15081
+Ref: Quick Start Guide: su, sudo and sg methods15625
+Ref: Quick Start Guide: ssh, plink, su, sudo and sg methods16189
+Ref: Quick Start Guide: sudoedit method16719
+Ref: Quick Start Guide: smb method17130
+Ref: Quick Start Guide: GVFS-based methods17461
+Ref: Quick Start Guide: GNOME Online Accounts based methods17857
+Ref: Quick Start Guide: Android18399
+Ref: Quick Start Guide: rclone method18631
+Node: Configuration18958
+Node: Connection types21430
+Node: Inline methods22844
+Node: External methods27806
+Node: GVFS-based methods38444
+Node: Default Method41713
+Node: Default User44730
+Node: Default Host46259
+Node: Multi-hops47391
+Node: Firewalls51583
+Node: Customizing Methods53040
+Node: Customizing Completion55380
+Node: Password handling58870
+Ref: Using an authentication file59340
+Ref: Caching passwords60842
+Node: Connection caching61360
+Node: Predefined connection information62290
+Node: Remote programs66164
+Node: Remote shell setup69085
+Node: Android shell setup78701
+Node: Auto-save and Backup81088
+Node: Windows setup hints84163
+Node: Usage85783
+Node: File name syntax87136
+Node: Change file name syntax89143
+Node: File name completion90574
+Node: Ad-hoc multi-hops93729
+Node: Remote processes95795
+Ref: Running a debugger on a remote host104553
+Node: Cleanup remote connections106523
+Node: Renaming remote files108224
+Node: Archive file names112443
+Node: Bug Reports116808
+Node: Frequently Asked Questions119476
+Node: Files directories and localnames143372
+Node: Localname deconstruction143808
+Node: External packages144461
+Node: Traces and Profiles146506
+Node: GNU Free Documentation License148475
+Node: Function Index173848
+Node: Variable Index176726
+Node: Concept Index184335
 
 End Tag Table
 
diff --git a/trampver.el b/trampver.el
index 9c04b61..fe166d4 100644
--- a/trampver.el
+++ b/trampver.el
@@ -1,7 +1,7 @@
 ;;; trampver.el --- Transparent Remote Access, Multiple Protocol  -*- 
lexical-binding:t -*-
 ;;; lisp/trampver.el.  Generated from trampver.el.in by configure.
 
-;; Copyright (C) 2003-2019 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2020 Free Software Foundation, Inc.
 
 ;; Author: Kai Großjohann <address@hidden>
 ;; Maintainer: Michael Albinus <address@hidden>
@@ -39,7 +39,7 @@
 (defvar inhibit-message)
 
 ;;;###tramp-autoload
-(defconst tramp-version "2.4.3"
+(defconst tramp-version "2.4.3.1"
   "This version of Tramp.")
 
 ;;;###tramp-autoload
@@ -73,7 +73,7 @@
 ;; Check for Emacs version.
 (let ((x   (if (not (string-lessp emacs-version "24.4"))
       "ok"
-    (format "Tramp 2.4.3 is not fit for %s"
+    (format "Tramp 2.4.3.1 is not fit for %s"
             (replace-regexp-in-string "\n" "" (emacs-version))))))
   (unless (string-equal "ok" x) (error "%s" x)))
 
@@ -92,7 +92,8 @@
         ("2.2.13.25.1" . "25.1") ("2.2.13.25.2" . "25.2")
         ("2.2.13.25.2" . "25.3")
          ("2.3.3" . "26.1") ("2.3.3.26.1" . "26.1") ("2.3.5.26.2" . "26.2")
-         ("2.3.5.26.3" . "26.3")))
+         ("2.3.5.26.3" . "26.3")
+         ("2.4.3.27.1" . "27.1")))
 
 (add-hook 'tramp-unload-hook
          (lambda ()



reply via email to

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