diff options
| author | Michael Albinus | 2007-07-24 20:49:18 +0000 |
|---|---|---|
| committer | Michael Albinus | 2007-07-24 20:49:18 +0000 |
| commit | a9e11582737063ec28d95516a1b5f778145d6368 (patch) | |
| tree | 9c1e872074399e747c08227b05929ca1f4000471 | |
| parent | 6dbe7eb4e28fc1bf2e687eb565c060f8c255b65e (diff) | |
| download | emacs-a9e11582737063ec28d95516a1b5f778145d6368.tar.gz emacs-a9e11582737063ec28d95516a1b5f778145d6368.zip | |
* subr.el (start-file-process-shell-command)
(process-file-shell-command): New defuns.
* progmodes/compile.el (compilation-start): Apply
`start-file-process-shell-command'.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/progmodes/compile.el | 27 | ||||
| -rw-r--r-- | lisp/subr.el | 19 |
3 files changed, 36 insertions, 18 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d0ab7c803ae..0ab088d420b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2007-07-24 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * subr.el (start-file-process-shell-command) | ||
| 4 | (process-file-shell-command): New defuns. | ||
| 5 | |||
| 6 | * progmodes/compile.el (compilation-start): Apply | ||
| 7 | `start-file-process-shell-command'. | ||
| 8 | |||
| 1 | 2007-07-24 Alexandre Julliard <julliard@winehq.org> | 9 | 2007-07-24 Alexandre Julliard <julliard@winehq.org> |
| 2 | 10 | ||
| 3 | * vc-git.el (vc-git-checkout, vc-directory-exclusion-list): Fix | 11 | * vc-git.el (vc-git-checkout, vc-directory-exclusion-list): Fix |
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 0c57e6f55b1..ec34dd61e96 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -1101,8 +1101,7 @@ Returns the compilation buffer created." | |||
| 1101 | (unless (getenv "EMACS") | 1101 | (unless (getenv "EMACS") |
| 1102 | (list "EMACS=t")) | 1102 | (list "EMACS=t")) |
| 1103 | (list "INSIDE_EMACS=t") | 1103 | (list "INSIDE_EMACS=t") |
| 1104 | (copy-sequence process-environment))) | 1104 | (copy-sequence process-environment)))) |
| 1105 | (start-process (symbol-function 'start-process))) | ||
| 1106 | (set (make-local-variable 'compilation-arguments) | 1105 | (set (make-local-variable 'compilation-arguments) |
| 1107 | (list command mode name-function highlight-regexp)) | 1106 | (list command mode name-function highlight-regexp)) |
| 1108 | (set (make-local-variable 'revert-buffer-function) | 1107 | (set (make-local-variable 'revert-buffer-function) |
| @@ -1123,22 +1122,14 @@ Returns the compilation buffer created." | |||
| 1123 | ;; comint uses `start-file-process'. | 1122 | ;; comint uses `start-file-process'. |
| 1124 | (get-buffer-process | 1123 | (get-buffer-process |
| 1125 | (with-no-warnings | 1124 | (with-no-warnings |
| 1126 | (comint-exec outbuf (downcase mode-name) | 1125 | (comint-exec |
| 1127 | shell-file-name nil `("-c" ,command)))) | 1126 | outbuf (downcase mode-name) |
| 1128 | ;; Redefine temporarily `start-process' in order to | 1127 | (if (file-remote-p default-directory) |
| 1129 | ;; handle remote compilation. | 1128 | "/bin/sh" |
| 1130 | (fset 'start-process | 1129 | shell-file-name) |
| 1131 | (lambda (name buffer program &rest program-args) | 1130 | `("-c" ,command)))) |
| 1132 | (apply | 1131 | (start-file-process-shell-command (downcase mode-name) |
| 1133 | (if (file-remote-p default-directory) | 1132 | outbuf command)))) |
| 1134 | 'start-file-process | ||
| 1135 | start-process) | ||
| 1136 | name buffer program program-args))) | ||
| 1137 | (unwind-protect | ||
| 1138 | (start-process-shell-command (downcase mode-name) | ||
| 1139 | outbuf command) | ||
| 1140 | ;; Unwindform: Reset original definition of `start-process'. | ||
| 1141 | (fset 'start-process start-process))))) | ||
| 1142 | ;; Make the buffer's mode line show process state. | 1133 | ;; Make the buffer's mode line show process state. |
| 1143 | (setq mode-line-process '(":%s")) | 1134 | (setq mode-line-process '(":%s")) |
| 1144 | (set-process-sentinel proc 'compilation-sentinel) | 1135 | (set-process-sentinel proc 'compilation-sentinel) |
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. | |||
| 2310 | (start-process name buffer shell-file-name shell-command-switch | 2310 | (start-process name buffer shell-file-name shell-command-switch |
| 2311 | (mapconcat 'identity args " "))))) | 2311 | (mapconcat 'identity args " "))))) |
| 2312 | 2312 | ||
| 2313 | (defun start-file-process-shell-command (name buffer &rest args) | ||
| 2314 | "Start a program in a subprocess. Return the process object for it. | ||
| 2315 | Similar to `start-process-shell-command', but calls `start-file-process'." | ||
| 2316 | (start-file-process | ||
| 2317 | name buffer | ||
| 2318 | (if (file-remote-p default-directory) "/bin/sh" shell-file-name) | ||
| 2319 | (if (file-remote-p default-directory) "-c" shell-command-switch) | ||
| 2320 | (mapconcat 'identity args " "))) | ||
| 2321 | |||
| 2313 | (defun call-process-shell-command (command &optional infile buffer display | 2322 | (defun call-process-shell-command (command &optional infile buffer display |
| 2314 | &rest args) | 2323 | &rest args) |
| 2315 | "Execute the shell command COMMAND synchronously in separate process. | 2324 | "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." | |||
| 2341 | infile buffer display | 2350 | infile buffer display |
| 2342 | shell-command-switch | 2351 | shell-command-switch |
| 2343 | (mapconcat 'identity (cons command args) " "))))) | 2352 | (mapconcat 'identity (cons command args) " "))))) |
| 2353 | |||
| 2354 | (defun process-file-shell-command (command &optional infile buffer display | ||
| 2355 | &rest args) | ||
| 2356 | "Process files synchronously in a separate process. | ||
| 2357 | Similar to `call-process-shell-command', but calls `process-file'." | ||
| 2358 | (process-file | ||
| 2359 | (if (file-remote-p default-directory) "/bin/sh" shell-file-name) | ||
| 2360 | infile buffer display | ||
| 2361 | (if (file-remote-p default-directory) "-c" shell-command-switch) | ||
| 2362 | (mapconcat 'identity (cons command args) " "))) | ||
| 2344 | 2363 | ||
| 2345 | ;;;; Lisp macros to do various things temporarily. | 2364 | ;;;; Lisp macros to do various things temporarily. |
| 2346 | 2365 | ||