Re: Is quotes in tramp-find-inline-compress needed in MS-Windows?

2018-02-02 Thread Chris Zheng

Hi Michael,

On Sat, 03 Feb 2018 04:35:05 +0800,
Michael Albinus wrote:
> 
> Chris Zheng  writes:
> 
> 
> Hi Chris,
> 
> 
> Well, this is indeed an error! Thanks for reporting.
> 
> 
> What about 
> 
> M-& echo xyzzy | "gzip" | "gzip" "-d" RET
> 
> This would easy to implement. Sorry that I don't test myself; I do not
> run MS Windows anywhere.

M-& echo xyzzy | "gzip" | "gzip" "-d" RET
⇒ Success.

Thanks,

Chris

> Best regards, Michael.

___
Tramp-devel mailing list
Tramp-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/tramp-devel


Re: Is quotes in tramp-find-inline-compress needed in MS-Windows?

2018-02-02 Thread Michael Albinus
Chris Zheng  writes:

> Hi Michael,

Hi Chris,

>> This would easy to implement. Sorry that I don't test myself; I do not
>> run MS Windows anywhere.
>
> M-& echo xyzzy | "gzip" | "gzip" "-d" RET
> ⇒ Success.

Thanks for the test. I've committed the appended patch to
branch-2-3-stable in the Tramp repository, you might apply it locally.

Emacs 26.1 is already frozen in the repository, only patches for
resolving newly introduced errors are accepted these days. So the fix
must wait for Emacs 26.2.

> Thanks,
>
> Chris

Best regards, Michael.

diff --git a/lisp/tramp-sh.el b/lisp/tramp-sh.el
index eede716..66e2f17 100644
--- a/lisp/tramp-sh.el
+++ b/lisp/tramp-sh.el
@@ -4475,13 +4475,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
___
Tramp-devel mailing list
Tramp-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/tramp-devel


Re: Is quotes in tramp-find-inline-compress needed in MS-Windows?

2018-02-02 Thread Michael Albinus
Chris Zheng  writes:

> Hello Michael,

Hi Chris,

> I thought about this command, and the results are
>
> M-& echo xyzzy | "gzip" | "gzip -d" RET
> ⇒ Not a command error for "gzip -d".

Well, this is indeed an error! Thanks for reporting.

> M-& echo xyzzy | "gzip" | "gzip" -d RET
> ⇒ Success.
>
> So the best approach is to quote only the program name. Thank you for
> the reply and the clarification of backslashes. 

What about 

M-& echo xyzzy | "gzip" | "gzip" "-d" RET

This would easy to implement. Sorry that I don't test myself; I do not
run MS Windows anywhere.

> Best wishes,
>
> Chris

Best regards, Michael.

___
Tramp-devel mailing list
Tramp-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/tramp-devel


Re: Is quotes in tramp-find-inline-compress needed in MS-Windows?

2018-02-02 Thread Chris Zheng

Hello Michael,

On Sat, 03 Feb 2018 05:29:40 +0800,
Michael Albinus wrote:
> 
> Hi Chris,
> 
> Thanks for the test. I've committed the appended patch to
> branch-2-3-stable in the Tramp repository, you might apply it locally.
> 
> Emacs 26.1 is already frozen in the repository, only patches for
> resolving newly introduced errors are accepted these days. So the fix
> must wait for Emacs 26.2.

Thank you for making Tramp better for MS-Windows users.

Regards,

Chris

> Best regards, Michael.

___
Tramp-devel mailing list
Tramp-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/tramp-devel