summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2007-07-24 20:49:18 +0000
committerMichael Albinus <michael.albinus@gmx.de>2007-07-24 20:49:18 +0000
commit8fa9f0b5ed4c0bfb03560cad96563ef1be34b8d1 (patch)
tree68227cd0b4886e07a02837745a67385268a5a1cc /lisp/subr.el
parent1920f1c3867d8f3e844093d42f5652400cf45377 (diff)
downloademacs-8fa9f0b5ed4c0bfb03560cad96563ef1be34b8d1.tar.gz
* subr.el (start-file-process-shell-command)
(process-file-shell-command): New defuns. * progmodes/compile.el (compilation-start): Apply `start-file-process-shell-command'.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index c4816f5d134..ce36cf9637b 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2310,6 +2310,15 @@ Wildcards and redirection are handled as usual in the shell.
(start-process name buffer shell-file-name shell-command-switch
(mapconcat 'identity args " ")))))
+(defun start-file-process-shell-command (name buffer &rest args)
+ "Start a program in a subprocess. Return the process object for it.
+Similar to `start-process-shell-command', but calls `start-file-process'."
+ (start-file-process
+ name buffer
+ (if (file-remote-p default-directory) "/bin/sh" shell-file-name)
+ (if (file-remote-p default-directory) "-c" shell-command-switch)
+ (mapconcat 'identity args " ")))
+
(defun call-process-shell-command (command &optional infile buffer display
&rest args)
"Execute the shell command COMMAND synchronously in separate process.
@@ -2341,6 +2350,16 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you quit again."
infile buffer display
shell-command-switch
(mapconcat 'identity (cons command args) " ")))))
+
+(defun process-file-shell-command (command &optional infile buffer display
+ &rest args)
+ "Process files synchronously in a separate process.
+Similar to `call-process-shell-command', but calls `process-file'."
+ (process-file
+ (if (file-remote-p default-directory) "/bin/sh" shell-file-name)
+ infile buffer display
+ (if (file-remote-p default-directory) "-c" shell-command-switch)
+ (mapconcat 'identity (cons command args) " ")))
;;;; Lisp macros to do various things temporarily.