# HG changeset patch # User Richard M. Stallman # Date 783669057 0 # Node ID 1286985b5a26947b7d7e463e89fdda1370b07af2 # Parent 7641fc43ca940802f8bc193871f12a4462896a45 (shell-command-switch): New variable. (shell-command, shell-command-on-region): Use new variable. diff -r 7641fc43ca94 -r 1286985b5a26 lisp/simple.el --- a/lisp/simple.el Tue Nov 01 05:49:25 1994 +0000 +++ b/lisp/simple.el Tue Nov 01 05:50:57 1994 +0000 @@ -667,6 +667,9 @@ (defvar shell-command-history nil "History list for some commands that read shell commands.") +(defvar shell-command-switch "-c" + "Switch used to have the shell execute its command line argument.") + (defun shell-command (command &optional output-buffer) "Execute string COMMAND in inferior shell; display output, if any. If COMMAND ends in ampersand, execute it asynchronously. @@ -691,7 +694,7 @@ ;; non-interactively. Besides, if someone wants their other ;; aliases for shell commands then they can still have them. (call-process shell-file-name nil t nil - "-c" command) + shell-command-switch command) ;; This is like exchange-point-and-mark, but doesn't activate the mark. ;; It is cleaner to avoid activation, even though the command ;; loop would deactivate the mark because we inserted text. @@ -722,7 +725,8 @@ (display-buffer buffer) (setq default-directory directory) (setq proc (start-process "Shell" buffer - shell-file-name "-c" command)) + shell-file-name + shell-command-switch command)) (setq mode-line-process '(":%s")) (set-process-sentinel proc 'shell-command-sentinel) (set-process-filter proc 'shell-command-filter) @@ -800,7 +804,7 @@ ;; unless called interactively. (and interactive (push-mark)) (call-process-region start end shell-file-name t t nil - "-c" command) + shell-command-switch command) (let ((shell-buffer (get-buffer "*Shell Command Output*"))) (and shell-buffer (not (eq shell-buffer (current-buffer))) (kill-buffer shell-buffer))) @@ -820,7 +824,7 @@ (delete-region (point-min) start) (call-process-region (point-min) (point-max) shell-file-name t t nil - "-c" command) + shell-command-switch command) (setq success t)) ;; Clear the output buffer, then run the command with output there. (save-excursion @@ -829,7 +833,7 @@ (erase-buffer)) (call-process-region start end shell-file-name nil buffer nil - "-c" command) + shell-command-switch command) (setq success t)) ;; Report the amount of output. (let ((lines (save-excursion