emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/compile.el,v


From: Michael Albinus
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/compile.el,v
Date: Wed, 11 Jul 2007 19:38:22 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Michael Albinus <albinus>       07/07/11 19:38:21

Index: progmodes/compile.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/compile.el,v
retrieving revision 1.430
retrieving revision 1.431
diff -u -b -r1.430 -r1.431
--- progmodes/compile.el        10 Jul 2007 19:52:11 -0000      1.430
+++ progmodes/compile.el        11 Jul 2007 19:38:21 -0000      1.431
@@ -1098,7 +1098,8 @@
              (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 @@
            (funcall compilation-process-setup-function))
        (compilation-set-window-height outwin)
        ;; Start the compilation.
-       (let ((proc (if (eq mode t)
+       (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))))
+                                                 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)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]