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: Stefan Monnier
Subject: Re: Patch of shell-command-to-string in simple for tramp support
Date: Thu, 25 Jan 2018 09:12:03 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

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




reply via email to

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