all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Shuguang Sun <shuguang@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Patch of shell-command-to-string in simple for tramp support
Date: Thu, 25 Jan 2018 14:08:21 +0100	[thread overview]
Message-ID: <87efme5bne.fsf@gmx.de> (raw)
In-Reply-To: <CACspjXcSqjCj_H4WTH8J0Fs6foP5FX5AwX+CkmxZ2TAQ-fXZhw@mail.gmail.com> (Shuguang Sun's message of "Thu, 25 Jan 2018 20:11:08 +0800")

Shuguang Sun <shuguang@gmail.com> 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	other threads:[~2018-01-25 13:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-25 12:11 Patch of shell-command-to-string in simple for tramp support Shuguang Sun
2018-01-25 13:08 ` Michael Albinus [this message]
2018-01-25 14:11   ` Shuguang Sun
2018-01-25 14:31     ` Michael Albinus
2018-01-25 14:12   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87efme5bne.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=emacs-devel@gnu.org \
    --cc=shuguang@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.