]> git.eshelyaron.com Git - emacs.git/commitdiff
(shell-command-to-string): Make the buffer current
authorRichard M. Stallman <rms@gnu.org>
Tue, 24 Sep 1996 23:54:08 +0000 (23:54 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 24 Sep 1996 23:54:08 +0000 (23:54 +0000)
since output goes in current buffer.  Use shell-command-switch.

lisp/simple.el

index 718b0b8ef3fdee8b076d6ca759a40c7c3f9f94d5..fe5c4cd3218583c2bdeba8916c448a905e51682c 100644 (file)
@@ -945,7 +945,9 @@ In either case, the output is inserted after point (leaving mark after it)."
 (defun shell-command-to-string (command)
   "Execute shell command COMMAND and return its output as a string."
   (with-output-to-string
-    (call-process shell-file-name nil t nil "-c" command)))
+    (with-current-buffer
+      standard-output
+      (call-process shell-file-name nil t nil shell-command-switch command))))
 \f
 (defconst universal-argument-map
   (let ((map (make-sparse-keymap)))