emacs-devel
[Top][All Lists]
Advanced

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

Re: Patch of shell-command-to-string in simple for tramp support


From: Michael Albinus
Subject: Re: Patch of shell-command-to-string in simple for tramp support
Date: Thu, 25 Jan 2018 14:08:21 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Shuguang Sun <address@hidden> writes:

> Hi,

Hi Shuguang,

> The shell-command-to-string calls shell-file-name directly and it
> doesn't work in the case of local Windows and remoter Unix. I borrow
> the some code from shell.el and make a patch to simple.el.

I believe it is wrong to make `shell-command-to-string' Tramp-aware. We
have `shell-command', which runs a (Tramp) file name handler if
needed. The proper change should be:

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/simple.el b/lisp/simple.el
index e51bc132a6..44f738f07e 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3844,7 +3844,7 @@ shell-command-to-string
   (with-output-to-string
     (with-current-buffer
       standard-output
-      (process-file shell-file-name nil t nil shell-command-switch command))))
+      (shell-command command t))))
 
 (defun process-file (program &optional infile buffer display &rest args)
   "Process files synchronously in a separate process.
--8<---------------cut here---------------end--------------->8---

Could you, pls, test it in your environment?

> Best Regards,
> Shuguang

Best regards, Michael.



reply via email to

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