diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2007-07-11 19:38:21 +0000 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2007-07-11 19:38:21 +0000 |
commit | db8af973954fda8e7204929b6efbd82f41ca05f8 (patch) | |
tree | 0943f2db5411dde05d43882c509a41a4e0510d9f /lisp/progmodes/compile.el | |
parent | 82c4728d3b54cd752853c9a24c3bd7a1f507b68b (diff) | |
download | emacs-db8af973954fda8e7204929b6efbd82f41ca05f8.tar.gz emacs-db8af973954fda8e7204929b6efbd82f41ca05f8.tar.bz2 emacs-db8af973954fda8e7204929b6efbd82f41ca05f8.zip |
* progmodes/compile.el (compilation-start): `start-process' must
still be redefined when calling `start-process-shell-command'.
* progmodes/gud.el (gud-file-name): When `default-directory' is a
remote file name, prepend its remote part to the filename.
(gud-common-init): When `default-directory' is a remote file name,
make the filename relative to it.
Based on a patch by Nick Roberts <nickrob@snap.net.nz>.
Diffstat (limited to 'lisp/progmodes/compile.el')
-rw-r--r-- | lisp/progmodes/compile.el | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 31fd7741a25..94def936fb9 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1098,7 +1098,8 @@ Returns the compilation buffer created." (unless (getenv "EMACS") (list "EMACS=t")) (list "INSIDE_EMACS=t") - (copy-sequence process-environment)))) + (copy-sequence process-environment))) + (start-process (symbol-function 'start-process))) (set (make-local-variable 'compilation-arguments) (list command mode name-function highlight-regexp)) (set (make-local-variable 'revert-buffer-function) @@ -1114,13 +1115,27 @@ Returns the compilation buffer created." (funcall compilation-process-setup-function)) (compilation-set-window-height outwin) ;; Start the compilation. - (let ((proc (if (eq mode t) - (get-buffer-process - (with-no-warnings - (comint-exec outbuf (downcase mode-name) - shell-file-name nil `("-c" ,command)))) - (start-process-shell-command (downcase mode-name) - outbuf command)))) + (let ((proc + (if (eq mode t) + ;; comint uses `start-file-process'. + (get-buffer-process + (with-no-warnings + (comint-exec outbuf (downcase mode-name) + shell-file-name nil `("-c" ,command)))) + ;; Redefine temporarily `start-process' in order to + ;; handle remote compilation. + (fset 'start-process + (lambda (name buffer program &rest program-args) + (apply + (if (file-remote-p default-directory) + 'start-file-process + start-process) + name buffer program program-args))) + (unwind-protect + (start-process-shell-command (downcase mode-name) + outbuf command) + ;; Unwindform: Reset original definition of `start-process'. + (fset 'start-process start-process))))) ;; Make the buffer's mode line show process state. (setq mode-line-process '(":%s")) (set-process-sentinel proc 'compilation-sentinel) |