]> git.eshelyaron.com Git - emacs.git/commitdiff
Cleanups for Tramp out-of-band methods on MS Windows
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 9 May 2021 13:37:37 +0000 (15:37 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 9 May 2021 13:37:37 +0000 (15:37 +0200)
* doc/misc/tramp.texi (Frequently Asked Questions):
tramp-use-ssh-controlmaster-options is nil on MS Windows.

* lisp/net/tramp.el (tramp-unquote-shell-quote-argument): Revert previous
change, it worked (not as expected but) properly.

* test/lisp/net/tramp-tests.el (tramp-test17-dired-with-wildcards):
Don't skip on MS Windows.
(tramp--test-windows-nt-and-scp-p): Remove.
(tramp--test-special-characters): Skip for out-of-band methods on
MS Windows, sometimes.

doc/misc/tramp.texi
lisp/net/tramp.el
test/lisp/net/tramp-tests.el

index 47beb90e6c619568cdf64b4996b622d47c971f39..e5a0bb9a8b6c9cb9724a58bfacf67aa53da38d9a 100644 (file)
@@ -2166,7 +2166,7 @@ commands for those hosts, the property @t{"posix"} should be set to
 
 The default value of this property is @code{t} (not specified in
 @code{tramp-methods}).  If the remote host runs native MS Windows,
-this propery has no effect.
+this property has no effect.
 
 @item @t{"mount-point"}
 
@@ -4504,9 +4504,9 @@ Note how @samp{%r}, @samp{%h} and @samp{%p} must be encoded as
 @samp{%%r}, @samp{%%h} and @samp{%%p}.
 
 @vindex tramp-use-ssh-controlmaster-options
-If the @file{~/.ssh/config} is configured appropriately for the above
-behavior, then any changes to @command{ssh} can be suppressed with
-this @code{nil} setting:
+If the @file{~/.ssh/config} file is configured appropriately for the
+above behavior, then any changes to @command{ssh} can be suppressed
+with this @code{nil} setting:
 
 @lisp
 (customize-set-variable 'tramp-use-ssh-controlmaster-options nil)
@@ -4518,6 +4518,10 @@ This should also be set to @code{nil} if you use the
 @option{ProxyCommand} or @option{ProxyJump} options in your
 @command{ssh} configuration.
 
+On MS Windows, @code{tramp-use-ssh-controlmaster-options} is set to
+@code{nil} by default, because the MS Windows and MSYS2
+implementations of @command{OpenSSH} do not support this option properly.
+
 
 @item
 On multi-hop connections, @value{tramp} does not use @command{ssh}
index 5d62a1fb3d1fceadca6185f6aae37c145ed5bf80..9fec151422140637a022026cd9ce60ce087c3605 100644 (file)
@@ -5476,12 +5476,8 @@ T1 and T2 are time values (as returned by `current-time' for example)."
   "Remove quotation prefix \"/:\" from string S, and quote it then for shell.
 Suppress `shell-file-name'.  This is needed on w32 systems, which
 would use a wrong quoting for local file names.  See `w32-shell-name'."
-  (if (eq system-type 'windows-nt)
-      (let ((result (tramp-compat-file-name-unquote s)))
-       (setq result (tramp-compat-string-replace "\"" "\"\"" result))
-       (concat "\"" result "\""))
-    (let (shell-file-name)
-      (shell-quote-argument (tramp-compat-file-name-unquote s)))))
+  (let (shell-file-name)
+    (shell-quote-argument (tramp-compat-file-name-unquote s))))
 
 ;; Currently (as of Emacs 20.5), the function `shell-quote-argument'
 ;; does not deal well with newline characters.  Newline is replaced by
index 03915d7a3fc3b30fcc21832696ce9611cdfe6400..52480bac7ec8c1c09c232556a1fa164af7142933 100644 (file)
@@ -3094,7 +3094,6 @@ This tests also `file-directory-p' and `file-accessible-directory-p'."
   (skip-unless (tramp--test-enabled))
   (skip-unless (tramp--test-sh-p))
   (skip-unless (not (tramp--test-rsync-p)))
-  (skip-unless (not (tramp--test-windows-nt-and-scp-p)))
   ;; Wildcards are not supported in tramp-crypt.el.
   (skip-unless (not (tramp--test-crypt-p)))
   ;; Since Emacs 26.1.
@@ -5842,13 +5841,6 @@ This does not support utf8 based file transfer."
   (and (eq system-type 'windows-nt)
        (tramp-method-out-of-band-p tramp-test-vec 1)))
 
-(defun tramp--test-windows-nt-and-scp-p ()
-  "Check, whether the locale host runs MS Windows, and scpx? is used.
-This does not support utf8 based file transfer."
-  (and (eq system-type 'windows-nt)
-       (string-match-p
-       "^scpx?" (file-remote-p tramp-test-temporary-file-directory 'method))))
-
 (defun tramp--test-windows-nt-or-smb-p ()
   "Check, whether the locale or remote host runs MS Windows.
 This requires restrictions of file name syntax."
@@ -6072,10 +6064,9 @@ This requires restrictions of file name syntax."
                 "\tfoo bar baz\t")
                (t " foo\tbar baz\t"))
          "@foo@bar@baz@"
-         (unless (tramp--test-windows-nt-and-scp-p)
-           "$foo$bar$$baz$")
+         (unless (tramp--test-windows-nt-and-out-of-band-p) "$foo$bar$$baz$")
          "-foo-bar-baz-"
-         "%foo%bar%baz%"
+         (unless (tramp--test-windows-nt-and-out-of-band-p) "%foo%bar%baz%")
          "&foo&bar&baz&"
          (unless (or (tramp--test-ftp-p)
                      (tramp--test-gvfs-p)
@@ -6089,7 +6080,7 @@ This requires restrictions of file name syntax."
              "'foo'bar'baz'"
            "'foo\"bar'baz\"")
          "#foo~bar#baz~"
-         (unless (tramp--test-windows-nt-and-scp-p)
+         (unless (tramp--test-windows-nt-and-out-of-band-p)
            (if (or (tramp--test-gvfs-p) (tramp--test-windows-nt-or-smb-p))
                "!foo!bar!baz!"
              "!foo|bar!baz|"))