all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: Patch of shell-command-to-string in simple for tramp support
Date: Thu, 25 Jan 2018 09:12:03 -0500	[thread overview]
Message-ID: <jwv4lnayqyk.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: 87efme5bne.fsf@gmx.de

> @@ -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.

shell-command does a *lot* more than run shell-file-name with
shell-command-switch and for the purpose of shell-command-to-string

Could you give more details about why you think using process-file here
is wrong?

BTW, I have my own reservations w.r.t shell-command-to-string: a quick
grep for that function shows that the vast majority of its users don't
actually need a shell, so it would make sense to provide some other
function:

    (defun YOUNAMEIT-to-string (program &rest args)
      "Execute PROGRAM with arguments ARGS and return its output as a string."
      (with-output-to-string
        (with-current-buffer
          standard-output
          (apply #'process-file program nil t nil args))))



        Stefan




      parent reply	other threads:[~2018-01-25 14:12 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
2018-01-25 14:11   ` Shuguang Sun
2018-01-25 14:31     ` Michael Albinus
2018-01-25 14:12   ` Stefan Monnier [this message]

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=jwv4lnayqyk.fsf-monnier+gmane.emacs.devel@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /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.