emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-26 e8912d5: Sync with Tramp 2.3.4-pre


From: Michael Albinus
Subject: [Emacs-diffs] emacs-26 e8912d5: Sync with Tramp 2.3.4-pre
Date: Tue, 29 May 2018 03:57:56 -0400 (EDT)

branch: emacs-26
commit e8912d5be9180e661273706782473919368a0b67
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Sync with Tramp 2.3.4-pre
    
    * doc/misc/trampver.texi: Change version to "2.3.4-pre
    
    * lisp/net/tramp.el (tramp-mode, tramp-verbose)
    (tramp-backup-directory-alist, tramp-auto-save-directory)
    (tramp-encoding-shell, tramp-encoding-command-switch)
    (tramp-encoding-command-interactive, tramp-default-method)
    (tramp-default-method-alist, tramp-default-user)
    (tramp-default-user-alist, tramp-default-host)
    (tramp-default-host-alist, tramp-default-proxies-alist)
    (tramp-save-ad-hoc-proxies, tramp-restricted-shell-hosts-alist)
    (tramp-local-end-of-line, tramp-rsh-end-of-line)
    (tramp-login-prompt-regexp, tramp-shell-prompt-pattern)
    (tramp-password-prompt-regexp, tramp-wrong-passwd-regexp)
    (tramp-yesno-prompt-regexp, tramp-yn-prompt-regexp)
    (tramp-terminal-prompt-regexp)
    (tramp-operation-not-permitted-regexp, tramp-copy-failed-regexp)
    (tramp-process-alive-regexp, tramp-chunksize)
    (tramp-process-connection-type, tramp-connection-timeout)
    (tramp-connection-min-time-diff)
    (tramp-completion-reread-directory-timeout):
    * lisp/net/tramp-adb.el (tramp-adb-program)
    (tramp-adb-connect-if-not-connected, tramp-adb-prompt):
    * lisp/net/tramp-cache.el (tramp-connection-properties)
    (tramp-persistency-file-name):
    * lisp/net/tramp-gvfs.el (tramp-gvfs-methods)
    (tramp-gvfs-zeroconf-domain, tramp-bluez-discover-devices-timeout):
    * lisp/net/tramp-sh.el (tramp-inline-compress-start-size)
    (tramp-copy-size-limit, tramp-terminal-type)
    (tramp-histfile-override, tramp-use-ssh-controlmaster-options)
    (tramp-remote-path, tramp-remote-process-environment)
    (tramp-sh-extra-args):
    * lisp/net/tramp-smb.el (tramp-smb-program, tramp-smb-acl-program)
    (tramp-smb-conf, tramp-smb-winexe-program)
    (tramp-smb-winexe-shell-command)
    (tramp-smb-winexe-shell-command-switch):
    Dont't require 'tramp.  (Bug#31558)
    
    * lisp/net/tramp.el (tramp-accept-process-output):
    * lisp/net/tramp-adb.el (tramp-adb-handle-start-file-process):
    * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band)
    (tramp-sh-handle-start-file-process):
    * lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory)
    (tramp-smb-handle-file-acl, tramp-smb-handle-process-file)
    (tramp-smb-handle-set-file-acl)
    (tramp-smb-handle-start-file-process): Suppress timers.
    
    * lisp/net/tramp-adb.el (tramp-adb-handle-write-region):
    * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region):
    * lisp/net/tramp-sh.el (tramp-sh-handle-write-region):
    * lisp/net/tramp-smb.el (tramp-smb-handle-write-region):
    Write proper message.
    
    * lisp/net/tramp-cmds.el (tramp-change-syntax):
    Use `customize-set-variable'.
    
    * lisp/net/tramp-sh.el (tramp-open-connection-setup-interactive-shell):
    Ensure proper EOL handling for Darwin.
    (tramp-find-inline-compress): Improve command quoting for w32.
    Reported by Chris Zheng <address@hidden>.
    (tramp-open-connection-setup-interactive-shell): Wrap both echo
    calls in parentheses, in order to avoid double prompt.
    
    * lisp/net/tramp-smb.el (tramp-smb-errors):
    Add "NT_STATUS_RESOURCE_NAME_NOT_FOUND".
    
    * lisp/net/tramp.el (tramp-default-user-alist)
    (tramp-default-host-alist): Fix docstring.
    (tramp-dissect-file-name): Adapt docstring.  (Bug#30904)
    (tramp-make-tramp-file-name): Check, that method is
    not empty.  (Bug#30038)
    (tramp-message-show-message): Change default.
    
    * lisp/net/trampver.el: Change version to "2.3.4-pre".
    
    * test/lisp/net/tramp-tests.el (ert-x): Require it.
    (tramp-test10-write-region): Extend test.
    (tramp--test-emacs27-p, tramp--test-windows-nt): New defuns.
    (tramp-test11-copy-file, tramp-test12-rename-file)
    (tramp-test21-file-links, tramp-test24-file-acl)
    (tramp-test25-file-selinux, tramp--test-check-files): Use them.
    (tramp-test21-file-links): Do not call `make-symbolic-link' on w32.
    Fix file name quoting test.
    (tramp-test32-environment-variables-and-port-numbers):
    Adapt check for systems which do not support "echo -n".  (Bug#29712)
    (tramp-test36-find-backup-file-name): Call also
    `convert-standard-filename' due to w32.
    (tramp-test41-asynchronous-requests):
    Use $REMOTE_PARALLEL_PROCESSES.  Flush cache prior file operations.
    (tramp-test42-auto-load, tramp-test42-delay-load)
    (tramp-test42-recursive-load, tramp-test42-remote-load-path):
    Quote command due to w32.
---
 doc/misc/trampver.texi       |   2 +-
 lisp/net/tramp-adb.el        |  30 +++++----
 lisp/net/tramp-cache.el      |   6 +-
 lisp/net/tramp-cmds.el       |   2 +-
 lisp/net/tramp-gvfs.el       |  14 ++--
 lisp/net/tramp-sh.el         |  58 ++++++++---------
 lisp/net/tramp-smb.el        |  50 ++++++++------
 lisp/net/tramp.el            | 131 +++++++++++++++----------------------
 lisp/net/trampver.el         |   6 +-
 test/lisp/net/tramp-tests.el | 151 +++++++++++++++++++++++++++++++------------
 10 files changed, 254 insertions(+), 196 deletions(-)

diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi
index f81593f..68619dc 100644
--- a/doc/misc/trampver.texi
+++ b/doc/misc/trampver.texi
@@ -8,7 +8,7 @@
 @c In the Tramp GIT, the version number is auto-frobbed from
 @c configure.ac, so you should edit that file and run
 @c "autoconf && ./configure" to change the version number.
address@hidden trampver 2.3.3.26.1
address@hidden trampver 2.3.4-pre
 
 @c Other flags from configuration
 @set instprefix /usr/local
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 0395eb4..58f748b 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -40,8 +40,7 @@
   "Name of the Android Debug Bridge program."
   :group 'tramp
   :version "24.4"
-  :type 'string
-  :require 'tramp)
+  :type 'string)
 
 ;;;###tramp-autoload
 (defcustom tramp-adb-connect-if-not-connected nil
@@ -49,8 +48,7 @@
 It is used for TCP/IP devices."
   :group 'tramp
   :version "25.1"
-  :type 'boolean
-  :require 'tramp)
+  :type 'boolean)
 
 ;;;###tramp-autoload
 (defconst tramp-adb-method "adb"
@@ -62,8 +60,7 @@ It is used for TCP/IP devices."
   "Regexp used as prompt in almquist shell."
   :type 'string
   :version "24.4"
-  :group 'tramp
-  :require 'tramp)
+  :group 'tramp)
 
 (defconst tramp-adb-ls-date-regexp
   
"[[:space:]][0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9][[:space:]][0-9][0-9]:[0-9][0-9][[:space:]]"
@@ -689,13 +686,22 @@ But handle the case, if the \"test\" command is not 
available."
              (tramp-error v 'file-error "Cannot write: `%s'" filename))
          (delete-file tmpfile)))
 
-      (when (or (eq visit t) (stringp visit))
-       (set-visited-file-modtime))
-
       (unless (equal curbuf (current-buffer))
        (tramp-error
         v 'file-error
-        "Buffer has changed from `%s' to `%s'" curbuf (current-buffer))))))
+        "Buffer has changed from `%s' to `%s'" curbuf (current-buffer)))
+
+      ;; Set file modification time.
+      (when (or (eq visit t) (stringp visit))
+       (set-visited-file-modtime
+        (tramp-compat-file-attribute-modification-time
+         (file-attributes filename))))
+
+      ;; The end.
+      (when (and (null noninteractive)
+                (or (eq visit t) (null visit) (stringp visit)))
+       (tramp-message v 0 "Wrote %s" filename))
+      (run-hooks 'tramp-handle-write-region-hook))))
 
 (defun tramp-adb-handle-set-file-modes (filename mode)
   "Like `set-file-modes' for Tramp files."
@@ -1046,7 +1052,9 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
            (or (null program) tramp-process-connection-type))
           (bmp (and (buffer-live-p buffer) (buffer-modified-p buffer)))
           (name1 name)
-          (i 0))
+          (i 0)
+          ;; We do not want to run timers.
+          timer-list timer-idle-list)
 
       (while (get-process name1)
        ;; NAME must be unique as process name.
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index b95d293..1db93ea 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -73,16 +73,14 @@ details see the info pages."
   :version "24.4"
   :type '(repeat (list (choice :tag "File Name regexp" regexp (const nil))
                       (choice :tag "        Property" string)
-                      (choice :tag "           Value" sexp)))
-  :require 'tramp)
+                      (choice :tag "           Value" sexp))))
 
 ;;;###tramp-autoload
 (defcustom tramp-persistency-file-name
   (expand-file-name (locate-user-emacs-file "tramp"))
   "File which keeps connection history for Tramp connections."
   :group 'tramp
-  :type 'file
-  :require 'tramp)
+  :type 'file)
 
 (defvar tramp-cache-data-changed nil
   "Whether persistent cache data have been changed.")
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index ef9aca7..7adac13 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -49,7 +49,7 @@ SYNTAX can be one of the symbols `default' (default),
      (unless (string-equal input "")
        (list (intern input)))))
   (when syntax
-    (custom-set-variables `(tramp-syntax ',syntax))))
+    (customize-set-variable 'tramp-syntax syntax)))
 
 (defun tramp-list-tramp-buffers ()
   "Return a list of all Tramp connection buffers."
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index f370abb..39962de 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -69,7 +69,7 @@
 ;;   'car
 ;;   (dbus-call-method
 ;;    :session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker
-;;    tramp-gvfs-interface-mounttracker "listMountableInfo")))
+;;    tramp-gvfs-interface-mounttracker "ListMountableInfo")))
 
 ;; Note that all other connection methods are not tested, beside the
 ;; ones offered for customization in `tramp-gvfs-methods'.  If you
@@ -122,8 +122,7 @@
                         (const "obex")
                         (const "sftp")
                         (const "smb")
-                        (const "synce")))
-  :require 'tramp)
+                        (const "synce"))))
 
 ;; Add defaults for `tramp-default-user-alist' and `tramp-default-host-alist'.
 ;;;###tramp-autoload
@@ -141,8 +140,7 @@
   "Zeroconf domain to be used for discovering services, like host names."
   :group 'tramp
   :version "23.2"
-  :type 'string
-  :require 'tramp)
+  :type 'string)
 
 ;; Add the methods to `tramp-methods', in order to allow minibuffer
 ;; completion.
@@ -393,8 +391,7 @@ completion, nil means to use always cached values for 
discovered
 devices."
   :group 'tramp
   :version "23.2"
-  :type '(choice (const nil) integer)
-  :require 'tramp)
+  :type '(choice (const nil) integer))
 
 (defvar tramp-bluez-discovery nil
   "Indicator for a running bluetooth device discovery.
@@ -1270,7 +1267,8 @@ file-notify events."
        (file-attributes filename))))
 
     ;; The end.
-    (when (or (eq visit t) (null visit) (stringp visit))
+    (when (and (null noninteractive)
+              (or (eq visit t) (null visit) (stringp visit)))
       (tramp-message v 0 "Wrote %s" filename))
     (run-hooks 'tramp-handle-write-region-hook)))
 
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 9b74da6..02fb864 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -47,8 +47,7 @@ When inline transfer, compress transferred data of file
 whose size is this value or above (up to `tramp-copy-size-limit').
 If it is nil, no compression at all will be applied."
   :group 'tramp
-  :type '(choice (const nil) integer)
-  :require 'tramp)
+  :type '(choice (const nil) integer))
 
 ;;;###tramp-autoload
 (defcustom tramp-copy-size-limit 10240
@@ -56,8 +55,7 @@ If it is nil, no compression at all will be applied."
 out-of-the-band copy.
 If it is nil, out-of-the-band copy will be used without a check."
   :group 'tramp
-  :type '(choice (const nil) integer)
-  :require 'tramp)
+  :type '(choice (const nil) integer))
 
 ;;;###tramp-autoload
 (defcustom tramp-terminal-type "dumb"
@@ -66,8 +64,7 @@ Because Tramp wants to parse the output of the remote shell, 
it is easily
 confused by ANSI color escape sequences and suchlike.  Often, shell init
 files conditionalize this setup based on the TERM environment variable."
   :group 'tramp
-  :type 'string
-  :require 'tramp)
+  :type 'string)
 
 ;;;###tramp-autoload
 (defcustom tramp-histfile-override "~/.tramp_history"
@@ -84,8 +81,7 @@ the default storage location, e.g. \"$HOME/.sh_history\"."
   :version "25.2"
   :type '(choice (const :tag "Do not override HISTFILE" nil)
                  (const :tag "Unset HISTFILE" t)
-                 (string :tag "Redirect to a file"))
-  :require 'tramp)
+                 (string :tag "Redirect to a file")))
 
 ;;;###tramp-autoload
 (defconst tramp-display-escape-sequence-regexp "\e[[;0-9]+m"
@@ -119,8 +115,7 @@ detected as prompt when being sent on echoing hosts, 
therefore.")
   "Whether to use `tramp-ssh-controlmaster-options'."
   :group 'tramp
   :version "24.4"
-  :type 'boolean
-  :require 'tramp)
+  :type 'boolean)
 
 (defvar tramp-ssh-controlmaster-options nil
   "Which ssh Control* arguments to use.
@@ -528,8 +523,7 @@ the list by the special value `tramp-own-remote-path'."
   :type '(repeat (choice
                  (const :tag "Default Directories" tramp-default-remote-path)
                  (const :tag "Private Directories" tramp-own-remote-path)
-                 (string :tag "Directory")))
-  :require 'tramp)
+                 (string :tag "Directory"))))
 
 ;;;###tramp-autoload
 (defcustom tramp-remote-process-environment
@@ -553,8 +547,7 @@ The INSIDE_EMACS environment variable will automatically be 
set
 based on the TRAMP and Emacs versions, and should not be set here."
   :group 'tramp
   :version "26.1"
-  :type '(repeat string)
-  :require 'tramp)
+  :type '(repeat string))
 
 ;;;###tramp-autoload
 (defcustom tramp-sh-extra-args '(("/bash\\'" . "-norc -noprofile"))
@@ -567,8 +560,7 @@ This variable is only used when Tramp needs to start up 
another shell
 for tilde expansion.  The extra arguments should typically prevent the
 shell from reading its init file."
   :group 'tramp
-  :type '(alist :key-type regexp :value-type string)
-  :require 'tramp)
+  :type '(alist :key-type regexp :value-type string))
 
 (defconst tramp-actions-before-shell
   '((tramp-login-prompt-regexp tramp-action-login)
@@ -2481,7 +2473,9 @@ The method used must be an out-of-band method."
              ;; The default directory must be remote.
              (let ((default-directory
                      (file-name-directory (if t1 filename newname)))
-                   (process-environment (copy-sequence process-environment)))
+                   (process-environment (copy-sequence process-environment))
+                   ;; We do not want to run timers.
+                   timer-list timer-idle-list)
                ;; Set the transfer process properties.
                (tramp-set-connection-property
                 v "process-name" (buffer-name (current-buffer)))
@@ -2908,7 +2902,9 @@ the result will be a local, non-Tramp, file name."
           ;; We do not want to raise an error when
           ;; `start-file-process' has been started several times in
           ;; `eshell' and friends.
-          (tramp-current-connection nil)
+          tramp-current-connection
+          ;; We do not want to run timers.
+          timer-list timer-idle-list
           p)
 
       (while (get-process name1)
@@ -3420,7 +3416,8 @@ the result will be a local, non-Tramp, file name."
        ;; Set the ownership.
         (when need-chown
           (tramp-set-file-uid-gid filename uid gid))
-       (when (or (eq visit t) (null visit) (stringp visit))
+       (when (and (null noninteractive)
+                  (or (eq visit t) (null visit) (stringp visit)))
          (tramp-message v 0 "Wrote %s" filename))
        (run-hooks 'tramp-handle-write-region-hook)))))
 
@@ -4103,7 +4100,10 @@ process to set up.  VEC specifies the connection."
     (with-current-buffer (process-buffer proc)
       ;; Use MULE to select the right EOL convention for communicating
       ;; with the process.
-      (let ((cs (or (and (memq 'utf-8 (coding-system-list))
+      (let ((cs (or (and (memq 'utf-8-hfs (coding-system-list))
+                        (string-match "^Darwin" uname)
+                        (cons 'utf-8-hfs 'utf-8-hfs))
+                   (and (memq 'utf-8 (coding-system-list))
                         (string-match "utf-?8" (tramp-get-remote-locale vec))
                         (cons 'utf-8 'utf-8))
                    (process-coding-system proc)
@@ -4115,16 +4115,11 @@ process to set up.  VEC specifies the connection."
              cs-encode
              (coding-system-change-eol-conversion
               cs-encode (if (string-match "^Darwin" uname) 'mac 'unix)))
-       (tramp-send-command vec "echo foo ; echo bar" t)
+       (tramp-send-command vec "(echo foo ; echo bar)" t)
        (goto-char (point-min))
        (when (search-forward "\r" nil t)
          (setq cs-decode (coding-system-change-eol-conversion cs-decode 'dos)))
-       ;; Special setting for macOS.
-       (when (and (string-match "^Darwin" uname)
-                  (memq 'utf-8-hfs (coding-system-list)))
-         (setq cs-decode 'utf-8-hfs
-               cs-encode 'utf-8-hfs))
-       (set-buffer-process-coding-system cs-decode cs-encode)
+       (set-process-coding-system proc cs-decode cs-encode)
        (tramp-message
         vec 5 "Setting coding system to `%s' and `%s'" cs-decode cs-encode)))
 
@@ -4470,13 +4465,14 @@ Goes through the list `tramp-inline-compress-commands'."
              (zerop
               (tramp-call-local-coding-command
                (format
+                "echo %s | %s | %s" magic
                 ;; Windows shells need the program file name after
                 ;; the pipe symbol be quoted if they use forward
                 ;; slashes as directory separators.
-                (if (memq system-type '(windows-nt))
-                    "echo %s | \"%s\" | \"%s\""
-                  "echo %s | %s | %s")
-                magic compress decompress)
+                (mapconcat
+                 'shell-quote-argument (split-string compress) " ")
+                (mapconcat
+                 'shell-quote-argument (split-string decompress) " "))
                nil nil))
            (throw 'next nil))
          (tramp-message
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 59db6ee6..7e96142 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -66,16 +66,14 @@
 (defcustom tramp-smb-program "smbclient"
   "Name of SMB client to run."
   :group 'tramp
-  :type 'string
-  :require 'tramp)
+  :type 'string)
 
 ;;;###tramp-autoload
 (defcustom tramp-smb-acl-program "smbcacls"
   "Name of SMB acls to run."
   :group 'tramp
   :type 'string
-  :version "24.4"
-  :require 'tramp)
+  :version "24.4")
 
 ;;;###tramp-autoload
 (defcustom tramp-smb-conf "/dev/null"
@@ -83,8 +81,7 @@
 If it is nil, no smb.conf will be added to the `tramp-smb-program'
 call, letting the SMB client use the default one."
   :group 'tramp
-  :type '(choice (const nil) (file :must-match t))
-  :require 'tramp)
+  :type '(choice (const nil) (file :must-match t)))
 
 (defvar tramp-smb-version nil
   "Version string of the SMB client.")
@@ -151,6 +148,7 @@ call, letting the SMB client use the default one."
         "NT_STATUS_OBJECT_NAME_NOT_FOUND"
         "NT_STATUS_OBJECT_PATH_SYNTAX_BAD"
         "NT_STATUS_PASSWORD_MUST_CHANGE"
+        "NT_STATUS_RESOURCE_NAME_NOT_FOUND"
         "NT_STATUS_SHARING_VIOLATION"
         "NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE"
         "NT_STATUS_UNSUCCESSFUL"
@@ -295,8 +293,7 @@ If it isn't found in the local $PATH, the absolute path of 
winexe
 shall be given.  This is needed for remote processes."
   :group 'tramp
   :type 'string
-  :version "24.3"
-  :require 'tramp)
+  :version "24.3")
 
 ;;;###tramp-autoload
 (defcustom tramp-smb-winexe-shell-command "powershell.exe"
@@ -304,8 +301,7 @@ shall be given.  This is needed for remote processes."
 This must be Powershell V2 compatible."
   :group 'tramp
   :type 'string
-  :version "24.3"
-  :require 'tramp)
+  :version "24.3")
 
 ;;;###tramp-autoload
 (defcustom tramp-smb-winexe-shell-command-switch "-file -"
@@ -313,8 +309,7 @@ This must be Powershell V2 compatible."
 This can be used to disable echo etc."
   :group 'tramp
   :type 'string
-  :version "24.3"
-  :require 'tramp)
+  :version "24.3")
 
 ;; It must be a `defsubst' in order to push the whole code into
 ;; tramp-loaddefs.el.  Otherwise, there would be recursive autoloading.
@@ -464,7 +459,9 @@ pass to the OPERATION."
                               (expand-file-name
                                tramp-temp-name-prefix
                                (tramp-compat-temporary-file-directory))))
-                  (args      (list (concat "//" host "/" share) "-E")))
+                  (args      (list (concat "//" host "/" share) "-E"))
+                  ;; We do not want to run timers.
+                  timer-list timer-idle-list)
 
              (if (not (zerop (length user)))
                  (setq args (append args (list "-U" user)))
@@ -752,7 +749,9 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are 
completely ignored."
        (let* ((share     (tramp-smb-get-share v))
               (localname (replace-regexp-in-string
                           "\\\\" "/" (tramp-smb-get-localname v)))
-              (args      (list (concat "//" host "/" share) "-E")))
+                (args      (list (concat "//" host "/" share) "-E"))
+                ;; We do not want to run timers.
+                timer-list timer-idle-list)
 
          (if (not (zerop (length user)))
              (setq args (append args (list "-U" user)))
@@ -1235,6 +1234,8 @@ component is used as the target of the symlink."
     (let* ((name (file-name-nondirectory program))
           (name1 name)
           (i 0)
+          ;; We do not want to run timers.
+          timer-list timer-idle-list
           input tmpinput outbuf command ret)
 
       ;; Determine input.
@@ -1417,7 +1418,9 @@ component is used as the target of the symlink."
                           "\\\\" "/" (tramp-smb-get-localname v)))
               (args      (list (concat "//" host "/" share) "-E" "-S"
                                (replace-regexp-in-string
-                                "\n" "," acl-string))))
+                                "\n" "," acl-string)))
+              ;; We do not want to run timers.
+              timer-list timer-idle-list)
 
          (if (not (zerop (length user)))
              (setq args (append args (list "-U" user)))
@@ -1497,7 +1500,9 @@ component is used as the target of the symlink."
           (command (mapconcat 'identity (cons program args) " "))
           (bmp (and (buffer-live-p buffer) (buffer-modified-p buffer)))
           (name1 name)
-          (i 0))
+          (i 0)
+          ;; We do not want to run timers.
+          timer-list timer-idle-list)
       (unwind-protect
          (save-excursion
            (save-restriction
@@ -1589,9 +1594,18 @@ errors for shares like \"C$/\", which are common in 
Microsoft Windows."
        (tramp-error
         v 'file-error
         "Buffer has changed from `%s' to `%s'" curbuf (current-buffer)))
-      (when (eq visit t)
-       (set-visited-file-modtime)))))
 
+      ;; Set file modification time.
+      (when (or (eq visit t) (stringp visit))
+       (set-visited-file-modtime
+        (tramp-compat-file-attribute-modification-time
+         (file-attributes filename))))
+
+      ;; The end.
+      (when (and (null noninteractive)
+                (or (eq visit t) (null visit) (stringp visit)))
+       (tramp-message v 0 "Wrote %s" filename))
+      (run-hooks 'tramp-handle-write-region-hook))))
 
 ;; Internal file name functions.
 
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index c4839e7..59f4cea 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -79,8 +79,7 @@
   "Whether Tramp is enabled.
 If it is set to nil, all remote file names are used literally."
   :group 'tramp
-  :type 'boolean
-  :require 'tramp)
+  :type 'boolean)
 
 (defcustom tramp-verbose 3
   "Verbosity level for Tramp messages.
@@ -98,8 +97,7 @@ Any level x includes messages for all levels 1 .. x-1.  The 
levels are
  9  test commands
 10  traces (huge)."
   :group 'tramp
-  :type 'integer
-  :require 'tramp)
+  :type 'integer)
 
 (defcustom tramp-backup-directory-alist nil
   "Alist of filename patterns and backup directory names.
@@ -114,8 +112,7 @@ gives the same backup policy for Tramp files on their hosts 
like the
 policy for local files."
   :group 'tramp
   :type '(repeat (cons (regexp :tag "Regexp matching filename")
-                      (directory :tag "Backup directory name")))
-  :require 'tramp)
+                      (directory :tag "Backup directory name"))))
 
 (defcustom tramp-auto-save-directory nil
   "Put auto-save files in this directory, if set.
@@ -123,8 +120,7 @@ The idea is to use a local directory so that auto-saving is 
faster.
 This setting has precedence over `auto-save-file-name-transforms'."
   :group 'tramp
   :type '(choice (const :tag "Use default" nil)
-                (directory :tag "Auto save directory name"))
-  :require 'tramp)
+                (directory :tag "Auto save directory name")))
 
 (defcustom tramp-encoding-shell
   (or (tramp-compat-funcall 'w32-shell-name) "/bin/sh")
@@ -148,16 +144,14 @@ Note that this variable is not used for remote commands.  
There are
 mechanisms in tramp.el which automatically determine the right shell to
 use for the remote host."
   :group 'tramp
-  :type '(file :must-match t)
-  :require 'tramp)
+  :type '(file :must-match t))
 
 (defcustom tramp-encoding-command-switch
   (if (tramp-compat-funcall 'w32-shell-dos-semantics) "/c" "-c")
   "Use this switch together with `tramp-encoding-shell' for local commands.
 See the variable `tramp-encoding-shell' for more information."
   :group 'tramp
-  :type 'string
-  :require 'tramp)
+  :type 'string)
 
 (defcustom tramp-encoding-command-interactive
   (unless (tramp-compat-funcall 'w32-shell-dos-semantics) "-i")
@@ -165,8 +159,7 @@ See the variable `tramp-encoding-shell' for more 
information."
 See the variable `tramp-encoding-shell' for more information."
   :version "24.1"
   :group 'tramp
-  :type '(choice (const nil) string)
-  :require 'tramp)
+  :type '(choice (const nil) string))
 
 ;;;###tramp-autoload
 (defvar tramp-methods nil
@@ -309,8 +302,7 @@ useful only in combination with 
`tramp-default-proxies-alist'.")
 See `tramp-methods' for possibilities.
 Also see `tramp-default-method-alist'."
   :group 'tramp
-  :type 'string
-  :require 'tramp)
+  :type 'string)
 
 ;;;###tramp-autoload
 (defcustom tramp-default-method-alist nil
@@ -328,8 +320,7 @@ See `tramp-methods' for a list of possibilities for METHOD."
   :group 'tramp
   :type '(repeat (list (choice :tag "Host regexp" regexp sexp)
                       (choice :tag "User regexp" regexp sexp)
-                      (choice :tag "Method name" string (const nil))))
-  :require 'tramp)
+                      (choice :tag "Method name" string (const nil)))))
 
 (defconst tramp-default-method-marker "-"
   "Marker for default method in remote file names.")
@@ -341,15 +332,14 @@ It is nil by default; otherwise settings in configuration 
files like
 
 This variable is regarded as obsolete, and will be removed soon."
   :group 'tramp
-  :type '(choice (const nil) string)
-  :require 'tramp)
+  :type '(choice (const nil) string))
 
 ;;;###tramp-autoload
 (defcustom tramp-default-user-alist nil
   "Default user to use for specific method/host pairs.
 This is an alist of items (METHOD HOST USER).  The first matching item
 specifies the user to use for a file name which does not specify a
-user.  METHOD and USER are regular expressions or nil, which is
+user.  METHOD and HOST are regular expressions or nil, which is
 interpreted as a regular expression which always matches.  If no entry
 matches, the variable `tramp-default-user' takes effect.
 
@@ -358,22 +348,20 @@ empty string for the method name."
   :group 'tramp
   :type '(repeat (list (choice :tag "Method regexp" regexp sexp)
                       (choice :tag "  Host regexp" regexp sexp)
-                      (choice :tag "    User name" string (const nil))))
-  :require 'tramp)
+                      (choice :tag "    User name" string (const nil)))))
 
 (defcustom tramp-default-host (system-name)
   "Default host to use for transferring files.
 Useful for su and sudo methods mostly."
   :group 'tramp
-  :type 'string
-  :require 'tramp)
+  :type 'string)
 
 ;;;###tramp-autoload
 (defcustom tramp-default-host-alist nil
   "Default host to use for specific method/user pairs.
 This is an alist of items (METHOD USER HOST).  The first matching item
 specifies the host to use for a file name which does not specify a
-host.  METHOD and HOST are regular expressions or nil, which is
+host.  METHOD and USER are regular expressions or nil, which is
 interpreted as a regular expression which always matches.  If no entry
 matches, the variable `tramp-default-host' takes effect.
 
@@ -383,8 +371,7 @@ empty string for the method name."
   :version "24.4"
   :type '(repeat (list (choice :tag "Method regexp" regexp sexp)
                       (choice :tag "  User regexp" regexp sexp)
-                      (choice :tag "    Host name" string (const nil))))
-  :require 'tramp)
+                      (choice :tag "    Host name" string (const nil)))))
 
 (defcustom tramp-default-proxies-alist nil
   "Route to be followed for specific host/user pairs.
@@ -403,15 +390,13 @@ interpreted as a regular expression which always matches."
   :group 'tramp
   :type '(repeat (list (choice :tag "Host regexp" regexp sexp)
                       (choice :tag "User regexp" regexp sexp)
-                      (choice :tag " Proxy name" string (const nil))))
-  :require 'tramp)
+                      (choice :tag " Proxy name" string (const nil)))))
 
 (defcustom tramp-save-ad-hoc-proxies nil
   "Whether to save ad-hoc proxies persistently."
   :group 'tramp
   :version "24.3"
-  :type 'boolean
-  :require 'tramp)
+  :type 'boolean)
 
 (defcustom tramp-restricted-shell-hosts-alist
   (when (memq system-type '(windows-nt))
@@ -423,8 +408,7 @@ proxies only, see `tramp-default-proxies-alist'.  If the 
local
 host runs a registered shell, it shall be added to this list, too."
   :version "24.3"
   :group 'tramp
-  :type '(repeat (regexp :tag "Host regexp"))
-  :require 'tramp)
+  :type '(repeat (regexp :tag "Host regexp")))
 
 ;;;###tramp-autoload
 (defconst tramp-local-host-regexp
@@ -485,16 +469,14 @@ the remote shell.")
   "String used for end of line in local processes."
   :version "24.1"
   :group 'tramp
-  :type 'string
-  :require 'tramp)
+  :type 'string)
 
 (defcustom tramp-rsh-end-of-line "\n"
   "String used for end of line in rsh connections.
 I don't think this ever needs to be changed, so please tell me about it
 if you need to change this."
   :group 'tramp
-  :type 'string
-  :require 'tramp)
+  :type 'string)
 
 (defcustom tramp-login-prompt-regexp
   ".*\\(user\\|login\\)\\( .*\\)?: *"
@@ -503,8 +485,7 @@ The regexp should match at end of buffer.
 
 Sometimes the prompt is reported to look like \"login as:\"."
   :group 'tramp
-  :type 'regexp
-  :require 'tramp)
+  :type 'regexp)
 
 (defcustom tramp-shell-prompt-pattern
   ;; Allow a prompt to start right after a ^M since it indeed would be
@@ -526,8 +507,7 @@ which should work well in many cases.
 This regexp must match both `tramp-initial-end-of-output' and
 `tramp-end-of-output'."
   :group 'tramp
-  :type 'regexp
-  :require 'tramp)
+  :type 'regexp)
 
 (defcustom tramp-password-prompt-regexp
   (format "^.*\\(%s\\).*:address@hidden *"
@@ -540,8 +520,7 @@ The regexp should match at end of buffer.
 The `sudo' program appears to insert a `^@' character into the prompt."
   :version "24.4"
   :group 'tramp
-  :type 'regexp
-  :require 'tramp)
+  :type 'regexp)
 
 (defcustom tramp-wrong-passwd-regexp
   (concat "^.*"
@@ -566,8 +545,7 @@ The `sudo' program appears to insert a `^@' character into 
the prompt."
   "Regexp matching a `login failed' message.
 The regexp should match at end of buffer."
   :group 'tramp
-  :type 'regexp
-  :require 'tramp)
+  :type 'regexp)
 
 (defcustom tramp-yesno-prompt-regexp
   (concat
@@ -578,8 +556,7 @@ The confirmation should be done with yes or no.
 The regexp should match at end of buffer.
 See also `tramp-yn-prompt-regexp'."
   :group 'tramp
-  :type 'regexp
-  :require 'tramp)
+  :type 'regexp)
 
 (defcustom tramp-yn-prompt-regexp
   (concat
@@ -592,8 +569,7 @@ The confirmation should be done with y or n.
 The regexp should match at end of buffer.
 See also `tramp-yesno-prompt-regexp'."
   :group 'tramp
-  :type 'regexp
-  :require 'tramp)
+  :type 'regexp)
 
 (defcustom tramp-terminal-prompt-regexp
   (concat "\\("
@@ -605,8 +581,7 @@ See also `tramp-yesno-prompt-regexp'."
 The regexp should match at end of buffer.
 The answer will be provided by `tramp-action-terminal', which see."
   :group 'tramp
-  :type 'regexp
-  :require 'tramp)
+  :type 'regexp)
 
 (defcustom tramp-operation-not-permitted-regexp
   (concat "\\(" "preserving times.*" "\\|" "set mode" "\\)" ":\\s-*"
@@ -615,8 +590,7 @@ The answer will be provided by `tramp-action-terminal', 
which see."
 Copying has been performed successfully already, so this message can
 be ignored safely."
   :group 'tramp
-  :type 'regexp
-  :require 'tramp)
+  :type 'regexp)
 
 (defcustom tramp-copy-failed-regexp
   (concat "\\(.+: "
@@ -628,8 +602,7 @@ be ignored safely."
           "\\)\\s-*")
   "Regular expression matching copy problems in (s)cp operations."
   :group 'tramp
-  :type 'regexp
-  :require 'tramp)
+  :type 'regexp)
 
 (defcustom tramp-process-alive-regexp
   ""
@@ -639,8 +612,7 @@ check regularly the status of the associated process.
 The answer will be provided by `tramp-action-process-alive',
 `tramp-action-out-of-band', which see."
   :group 'tramp
-  :type 'regexp
-  :require 'tramp)
+  :type 'regexp)
 
 (defconst tramp-temp-name-prefix "tramp."
   "Prefix to use for temporary files.
@@ -1127,8 +1099,7 @@ in the third line of the code.
 Please raise a bug report via \"M-x tramp-bug\" if your system needs
 this variable to be set as well."
   :group 'tramp
-  :type '(choice (const nil) integer)
-  :require 'tramp)
+  :type '(choice (const nil) integer))
 
 ;; Logging in to a remote host normally requires obtaining a pty.  But
 ;; Emacs on macOS has process-connection-type set to nil by default,
@@ -1139,8 +1110,7 @@ this variable to be set as well."
 Tramp binds `process-connection-type' to the value given here before
 opening a connection to a remote host."
   :group 'tramp
-  :type '(choice (const nil) (const t) (const pty))
-  :require 'tramp)
+  :type '(choice (const nil) (const t) (const pty)))
 
 (defcustom tramp-connection-timeout 60
   "Defines the max time to wait for establishing a connection (in seconds).
@@ -1149,8 +1119,7 @@ This can be overwritten for different connection types in 
`tramp-methods'.
 The timeout does not include the time reading a password."
   :group 'tramp
   :version "24.4"
-  :type 'integer
-  :require 'tramp)
+  :type 'integer)
 
 (defcustom tramp-connection-min-time-diff 5
   "Defines seconds between two consecutive connection attempts.
@@ -1164,8 +1133,7 @@ in a short time frame.  In those cases it is recommended 
to
 let-bind this variable."
   :group 'tramp
   :version "24.4"
-  :type '(choice (const nil) integer)
-  :require 'tramp)
+  :type '(choice (const nil) integer))
 
 (defcustom tramp-completion-reread-directory-timeout 10
   "Defines seconds since last remote command before rereading a directory.
@@ -1177,8 +1145,7 @@ have been gone since last remote command execution.  A 
value of t
 would require an immediate reread during filename completion, nil
 means to use always cached values for the directory contents."
   :group 'tramp
-  :type '(choice (const nil) (const t) integer)
-  :require 'tramp)
+  :type '(choice (const nil) (const t) integer))
 
 ;;; Internal Variables:
 
@@ -1353,11 +1320,13 @@ This is HOST, if non-nil. Otherwise, it is 
`tramp-default-host'."
       tramp-default-host))
 
 (defun tramp-dissect-file-name (name &optional nodefault)
-  "Return a `tramp-file-name' structure.
-The structure consists of remote method, remote user, remote host,
-localname (file name on remote host) and hop.  If NODEFAULT is
-non-nil, the file name parts are not expanded to their default
-values."
+  "Return a `tramp-file-name' structure of NAME, a remote file name.
+The structure consists of method, user, domain, host, port,
+localname (file name on remote host), and hop.
+
+Unless NODEFAULT is non-nil, method, user and host are expanded
+to their default values. For the other file name parts, no
+default values are used."
   (save-match-data
     (unless (tramp-tramp-file-p name)
       (tramp-compat-user-error nil "Not a Tramp file name: \"%s\"" name))
@@ -1405,9 +1374,10 @@ values."
     (method user domain host port localname &optional hop)
   "Constructs a Tramp file name from METHOD, USER, HOST and LOCALNAME.
 When not nil, optional DOMAIN, PORT and HOP are used."
+  (when (zerop (length method))
+    (signal 'wrong-type-argument (list 'stringp method)))
   (concat tramp-prefix-format hop
-         (unless (or (zerop (length method))
-                      (zerop (length tramp-postfix-method-format)))
+         (unless (zerop (length tramp-postfix-method-format))
            (concat method tramp-postfix-method-format))
          user
          (unless (zerop (length domain))
@@ -1614,10 +1584,11 @@ ARGUMENTS to actually emit the message (if applicable)."
     ;; The message.
     (insert (apply #'format-message fmt-string arguments))))
 
-(defvar tramp-message-show-message t
+(defvar tramp-message-show-message (null noninteractive)
   "Show Tramp message in the minibuffer.
-This variable is used to disable messages from `tramp-error'.
-The messages are visible anyway, because an error is raised.")
+This variable is used to suppress progress reporter output, and
+to disable messages from `tramp-error'.  Those messages are
+visible anyway, because an error is raised.")
 
 (defsubst tramp-message (vec-or-proc level fmt-string &rest arguments)
   "Emit a message depending on verbosity level.
@@ -3823,7 +3794,9 @@ connection buffer."
 This is needed in order to hide `last-coding-system-used', which is set
 for process communication also."
   (with-current-buffer (process-buffer proc)
-    (let (buffer-read-only last-coding-system-used)
+    (let (buffer-read-only last-coding-system-used
+         ;; We do not want to run timers.
+         timer-list timer-idle-list)
       ;; Under Windows XP, `accept-process-output' doesn't return
       ;; sometimes.  So we add an additional timeout.  JUST-THIS-ONE
       ;; is set due to Bug#12145.  It is an integer, in order to avoid
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index 1a77278..2549841 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -7,7 +7,7 @@
 ;; Maintainer: Michael Albinus <address@hidden>
 ;; Keywords: comm, processes
 ;; Package: tramp
-;; Version: 2.3.3.26.1
+;; Version: 2.3.4-pre
 
 ;; This file is part of GNU Emacs.
 
@@ -33,7 +33,7 @@
 ;; should be changed only there.
 
 ;;;###tramp-autoload
-(defconst tramp-version "2.3.3.26.1"
+(defconst tramp-version "2.3.4-pre"
   "This version of Tramp.")
 
 ;;;###tramp-autoload
@@ -55,7 +55,7 @@
 ;; Check for Emacs version.
 (let ((x (if (>= emacs-major-version 24)
     "ok"
-  (format "Tramp 2.3.3.26.1 is not fit for %s"
+  (format "Tramp 2.3.4-pre is not fit for %s"
          (when (string-match "^.*$" (emacs-version))
            (match-string 0 (emacs-version)))))))
   (unless (string-match "\\`ok\\'" x) (error "%s" x)))
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 996a31d..d2cbebd 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -33,12 +33,17 @@
 ;; remote host, set this environment variable to "/dev/null" or
 ;; whatever is appropriate on your system.
 
+;; For slow remote connections, `tramp-test41-asynchronous-requests'
+;; might be too heavy.  Setting $REMOTE_PARALLEL_PROCESSES to a proper
+;; value less than 10 could help.
+
 ;; A whole test run can be performed calling the command `tramp-test-all'.
 
 ;;; Code:
 
 (require 'dired)
 (require 'ert)
+(require 'ert-x)
 (require 'tramp)
 (require 'vc)
 (require 'vc-bzr)
@@ -1862,6 +1867,23 @@ This checks also `file-name-as-directory', 
`file-name-directory',
              (insert-file-contents tmp-name)
              (should (string-equal (buffer-string) "34")))
 
+           ;; Check message.
+           ;; Macro `ert-with-message-capture' was introduced in Emacs 26.1.
+           (with-no-warnings (when (symbol-plist 'ert-with-message-capture)
+             (let ((tramp-message-show-message t))
+               (dolist (noninteractive '(nil t))
+                 (dolist (visit '(nil t "string" no-message))
+                   (ert-with-message-capture tramp--test-messages
+                     (write-region "foo" nil tmp-name nil visit)
+                     ;; We must check the last line.  There could be
+                     ;; other messages from the progress reporter.
+                     (should
+                      (string-match
+                       (if (and (null noninteractive)
+                                (or (eq visit t) (null visit) (stringp visit)))
+                           (format "^Wrote %s\n\\'" tmp-name) "^\\'")
+                       tramp--test-messages))))))))
+
            ;; Do not overwrite if excluded.
            (cl-letf (((symbol-function 'y-or-n-p) (lambda (_prompt) t)))
              (write-region "foo" nil tmp-name nil nil nil 'mustbenew))
@@ -1882,9 +1904,9 @@ This checks also `file-name-as-directory', 
`file-name-directory',
   "Check `copy-file'."
   (skip-unless (tramp--test-enabled))
 
-  ;; TODO: The quoted case does not work.  Copy local file to remote.
-  ;;(dolist (quoted (if tramp--test-expensive-test '(nil t) '(nil)))
-  (let (quoted)
+  ;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579.
+  (dolist (quoted (if (and tramp--test-expensive-test (tramp--test-emacs27-p))
+                     '(nil t) '(nil)))
     (let ((tmp-name1 (tramp--test-make-temp-name nil quoted))
          (tmp-name2 (tramp--test-make-temp-name nil quoted))
          (tmp-name3 (tramp--test-make-temp-name 'local quoted)))
@@ -1984,9 +2006,9 @@ This checks also `file-name-as-directory', 
`file-name-directory',
   "Check `rename-file'."
   (skip-unless (tramp--test-enabled))
 
-  ;; TODO: The quoted case does not work.
-  ;;(dolist (quoted (if tramp--test-expensive-test '(nil t) '(nil)))
-  (let (quoted)
+  ;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579.
+  (dolist (quoted (if (and tramp--test-expensive-test (tramp--test-emacs27-p))
+                     '(nil t) '(nil)))
     (let ((tmp-name1 (tramp--test-make-temp-name nil quoted))
          (tmp-name2 (tramp--test-make-temp-name nil quoted))
          (tmp-name3 (tramp--test-make-temp-name 'local quoted)))
@@ -2718,9 +2740,11 @@ This tests also `make-symbolic-link', `file-truename' 
and `add-name-to-file'."
              (file-symlink-p tmp-name2)))
            ;; `tmp-name3' is a local file name.  Therefore, the link
            ;; target remains unchanged, even if quoted.
-           (make-symbolic-link tmp-name1 tmp-name3)
-           (should
-            (string-equal tmp-name1 (file-symlink-p tmp-name3)))
+           ;; `make-symbolic-link' might not be permitted on w32 systems.
+           (unless (tramp--test-windows-nt)
+             (make-symbolic-link tmp-name1 tmp-name3)
+             (should
+              (string-equal tmp-name1 (file-symlink-p tmp-name3))))
            ;; Check directory as newname.
            (make-directory tmp-name4)
            (should-error
@@ -2810,7 +2834,11 @@ This tests also `make-symbolic-link', `file-truename' 
and `add-name-to-file'."
            ;; Symbolic links could look like a remote file name.
            ;; They must be quoted then.
            (delete-file tmp-name2)
-           (make-symbolic-link "/penguin:motd:" tmp-name2)
+           (make-symbolic-link
+            (funcall
+             (if quoted 'tramp-compat-file-name-unquote 'identity)
+             "/penguin:motd:")
+            tmp-name2)
            (should (file-symlink-p tmp-name2))
            (should
             (string-equal
@@ -2818,15 +2846,20 @@ This tests also `make-symbolic-link', `file-truename' 
and `add-name-to-file'."
              (tramp-compat-file-name-quote
               (concat (file-remote-p tmp-name2) "/penguin:motd:"))))
            ;; `tmp-name3' is a local file name.
-           (make-symbolic-link tmp-name1 tmp-name3)
-           (should (file-symlink-p tmp-name3))
-            (should-not (string-equal tmp-name3 (file-truename tmp-name3)))
-           ;; `file-truename' returns a quoted file name for `tmp-name3'.
-           ;; We must unquote it.
-           (should
-            (string-equal
-             (file-truename tmp-name1)
-             (tramp-compat-file-name-unquote (file-truename tmp-name3)))))
+           ;; `make-symbolic-link' might not be permitted on w32 systems.
+           (unless (tramp--test-windows-nt)
+             (make-symbolic-link tmp-name1 tmp-name3)
+             (should (file-symlink-p tmp-name3))
+              (should-not (string-equal tmp-name3 (file-truename tmp-name3)))
+             ;; `file-truename' returns a quoted file name for `tmp-name3'.
+             ;; We must unquote it.
+             (should
+              (string-equal
+               (funcall
+                (if (tramp--test-emacs27-p)
+                    'tramp-compat-file-name-unquote 'identity)
+                (file-truename tmp-name1))
+               (tramp-compat-file-name-unquote (file-truename tmp-name3))))))
 
        ;; Cleanup.
        (ignore-errors
@@ -2951,9 +2984,9 @@ This tests also `make-symbolic-link', `file-truename' and 
`add-name-to-file'."
   (skip-unless (tramp--test-enabled))
   (skip-unless (file-acl tramp-test-temporary-file-directory))
 
-  ;; TODO: The quoted case does not work.  Copy local file to remote.
-  ;;(dolist (quoted (if tramp--test-expensive-test '(nil t) '(nil)))
-  (let (quoted)
+  ;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579.
+  (dolist (quoted (if (and tramp--test-expensive-test (tramp--test-emacs27-p))
+                     '(nil t) '(nil)))
     (let ((tmp-name1 (tramp--test-make-temp-name nil quoted))
          (tmp-name2 (tramp--test-make-temp-name nil quoted))
          (tmp-name3 (tramp--test-make-temp-name 'local quoted)))
@@ -3029,9 +3062,9 @@ This tests also `make-symbolic-link', `file-truename' and 
`add-name-to-file'."
    (not (equal (file-selinux-context tramp-test-temporary-file-directory)
               '(nil nil nil nil))))
 
-  ;; TODO: The quoted case does not work.  Copy local file to remote.
-  ;;(dolist (quoted (if tramp--test-expensive-test '(nil t) '(nil)))
-  (let (quoted)
+  ;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579.
+  (dolist (quoted (if (and tramp--test-expensive-test (tramp--test-emacs27-p))
+                     '(nil t) '(nil)))
     (let ((tmp-name1 (tramp--test-make-temp-name nil quoted))
          (tmp-name2 (tramp--test-make-temp-name nil quoted))
          (tmp-name3 (tramp--test-make-temp-name 'local quoted)))
@@ -3911,9 +3944,14 @@ This tests also `make-symbolic-link', `file-truename' 
and `add-name-to-file'."
                (expand-file-name
                 (format
                  "%s~"
-                 ;; This is taken from `make-backup-file-name-1'.
+                 ;; This is taken from `make-backup-file-name-1'.  We
+                 ;; call `convert-standard-filename', because on MS
+                 ;; Windows the (local) colons must be replaced by
+                 ;; exclamation marks.
                  (subst-char-in-string
-                  ?/ ?! (replace-regexp-in-string "!" "!!" tmp-name1)))
+                  ?/ ?!
+                  (replace-regexp-in-string
+                   "!" "!!" (convert-standard-filename tmp-name1))))
                 tmp-name2)))))
            ;; The backup directory is created.
            (should (file-directory-p tmp-name2)))
@@ -3934,9 +3972,14 @@ This tests also `make-symbolic-link', `file-truename' 
and `add-name-to-file'."
                (expand-file-name
                 (format
                  "%s~"
-                 ;; This is taken from `make-backup-file-name-1'.
+                 ;; This is taken from `make-backup-file-name-1'.  We
+                 ;; call `convert-standard-filename', because on MS
+                 ;; Windows the (local) colons must be replaced by
+                 ;; exclamation marks.
                  (subst-char-in-string
-                  ?/ ?! (replace-regexp-in-string "!" "!!" tmp-name1)))
+                  ?/ ?!
+                  (replace-regexp-in-string
+                   "!" "!!" (convert-standard-filename tmp-name1))))
                 tmp-name2)))))
            ;; The backup directory is created.
            (should (file-directory-p tmp-name2)))
@@ -3958,9 +4001,14 @@ This tests also `make-symbolic-link', `file-truename' 
and `add-name-to-file'."
                (expand-file-name
                 (format
                  "%s~"
-                 ;; This is taken from `make-backup-file-name-1'.
+                 ;; This is taken from `make-backup-file-name-1'.  We
+                 ;; call `convert-standard-filename', because on MS
+                 ;; Windows the (local) colons must be replaced by
+                 ;; exclamation marks.
                  (subst-char-in-string
-                  ?/ ?! (replace-regexp-in-string "!" "!!" tmp-name1)))
+                  ?/ ?!
+                  (replace-regexp-in-string
+                   "!" "!!" (convert-standard-filename tmp-name1))))
                 tmp-name2)))))
            ;; The backup directory is created.
            (should (file-directory-p tmp-name2)))
@@ -4011,6 +4059,12 @@ Some semantics has been changed for there, w/o new 
functions or
 variables, so we check the Emacs version directly."
   (>= emacs-major-version 26))
 
+(defun tramp--test-emacs27-p ()
+  "Check for Emacs version >= 27.1.
+Some semantics has been changed for there, w/o new functions or
+variables, so we check the Emacs version directly."
+  (>= emacs-major-version 27))
+
 (defun tramp--test-adb-p ()
   "Check, whether the remote host runs Android.
 This requires restrictions of file name syntax."
@@ -4061,6 +4115,10 @@ This does not support special file names."
    (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory)
    'tramp-sh-file-name-handler))
 
+(defun tramp--test-windows-nt ()
+  "Check, whether the locale host runs MS Windows."
+  (eq system-type 'windows-nt))
+
 (defun tramp--test-windows-nt-and-batch ()
   "Check, whether the locale host runs MS Windows in batch mode.
 This does not support special characters."
@@ -4082,9 +4140,9 @@ This requires restrictions of file name syntax."
 
 (defun tramp--test-check-files (&rest files)
   "Run a simple but comprehensive test over every file in FILES."
-  ;; TODO: The quoted case does not work.
-  ;;(dolist (quoted (if tramp--test-expensive-test '(nil t) '(nil)))
-  (let (quoted)
+  ;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579.
+  (dolist (quoted (if (and tramp--test-expensive-test (tramp--test-emacs27-p))
+                     '(nil t) '(nil)))
     ;; We must use `file-truename' for the temporary directory,
     ;; because it could be located on a symlinked directory.  This
     ;; would let the test fail.
@@ -4493,8 +4551,13 @@ process sentinels.  They shall not disturb each other."
            (inhibit-message t)
           ;; Do not run delayed timers.
           (timer-max-repeats 0)
-          ;; Number of asynchronous processes for test.
-           (number-proc 10)
+          ;; Number of asynchronous processes for test.  Tests on
+          ;; some machines handle less parallel processes.
+           (number-proc
+            (or
+             (ignore-errors
+               (string-to-number (getenv "REMOTE_PARALLEL_PROCESSES")))
+             10))
            ;; On hydra, timings are bad.
            (timer-repeat
             (cond
@@ -4558,11 +4621,13 @@ process sentinels.  They shall not disturb each other."
                    (with-current-buffer (process-buffer proc)
                      (insert string))
                    (unless (zerop (length string))
+                    (dired-uncache (process-get proc 'foo))
                      (should (file-attributes (process-get proc 'foo))))))
                 ;; Add process sentinel.
                 (set-process-sentinel
                  proc
                  (lambda (proc _state)
+                  (dired-uncache (process-get proc 'foo))
                    (should-not (file-attributes (process-get proc 'foo)))))))
 
             ;; Send a string.  Use a random order of the buffers.  Mix
@@ -4576,6 +4641,7 @@ process sentinels.  They shall not disturb each other."
                        (file (process-get proc 'foo))
                        (count (process-get proc 'bar)))
                   ;; Regular operation prior process action.
+                 (dired-uncache file)
                   (if (= count 0)
                       (should-not (file-attributes file))
                     (should (file-attributes file)))
@@ -4585,6 +4651,7 @@ process sentinels.  They shall not disturb each other."
                   ;; Give the watchdog a chance.
                   (read-event nil nil 0.01)
                   ;; Regular operation post process action.
+                 (dired-uncache file)
                   (if (= count 2)
                       (should-not (file-attributes file))
                     (should (file-attributes file)))
@@ -4625,7 +4692,8 @@ process sentinels.  They shall not disturb each other."
       (shell-command-to-string
        (format
        "%s -batch -Q -L %s --eval %s"
-       (expand-file-name invocation-name invocation-directory)
+       (shell-quote-argument
+        (expand-file-name invocation-name invocation-directory))
        (mapconcat 'shell-quote-argument load-path " -L ")
        (shell-quote-argument code)))))))
 
@@ -4657,7 +4725,8 @@ process sentinels.  They shall not disturb each other."
        (shell-command-to-string
         (format
          "%s -batch -Q -L %s --eval %s"
-         (expand-file-name invocation-name invocation-directory)
+         (shell-quote-argument
+          (expand-file-name invocation-name invocation-directory))
          (mapconcat 'shell-quote-argument load-path " -L ")
          (shell-quote-argument (format code tm)))))))))
 
@@ -4680,7 +4749,8 @@ process sentinels.  They shall not disturb each other."
        (shell-command-to-string
         (format
          "%s -batch -Q -L %s --eval %s"
-         (expand-file-name invocation-name invocation-directory)
+         (shell-quote-argument
+          (expand-file-name invocation-name invocation-directory))
          (mapconcat 'shell-quote-argument load-path " -L ")
          (shell-quote-argument code))))))))
 
@@ -4707,7 +4777,8 @@ process sentinels.  They shall not disturb each other."
       (shell-command-to-string
        (format
        "%s -batch -Q -L %s -l tramp-sh --eval %s"
-       (expand-file-name invocation-name invocation-directory)
+       (shell-quote-argument
+        (expand-file-name invocation-name invocation-directory))
        (mapconcat 'shell-quote-argument load-path " -L ")
        (shell-quote-argument code)))))))
 



reply via email to

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