]> git.eshelyaron.com Git - emacs.git/commitdiff
(compile-internal): Update process-environment before calling start-process.
authorRichard M. Stallman <rms@gnu.org>
Wed, 23 Oct 2002 17:45:18 +0000 (17:45 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 23 Oct 2002 17:45:18 +0000 (17:45 +0000)
lisp/progmodes/compile.el

index c26044dd9ed56ef382323a7d01491eb725df1cfc..a13796e1d5b0f8a241643304cfde6d2adf089f7a 100644 (file)
@@ -826,24 +826,23 @@ Returns the compilation buffer created."
            (funcall compilation-process-setup-function))
        ;; Start the compilation.
        (if (fboundp 'start-process)
-           (let* ((process-environment process-environment)
+           (let* ((process-environment
+                   (append
+                    (if (and (boundp 'system-uses-terminfo)
+                             system-uses-terminfo)
+                        (list "TERM=dumb" "TERMCAP="
+                              (format "COLUMNS=%d" (window-width)))
+                      (list "TERM=emacs"
+                            (format "TERMCAP=emacs:co#%d:tc=unknown:"
+                                    (window-width))))
+                    ;; Set the EMACS variable, but
+                    ;; don't override users' setting of $EMACS.
+                    (if (getenv "EMACS")
+                        process-environment
+                      (cons "EMACS=t" process-environment))))
                   (proc (start-process-shell-command (downcase mode-name)
                                                      outbuf
                                                      command)))
-             ;; Set the terminal type
-             (setq process-environment
-                   (if (and (boundp 'system-uses-terminfo)
-                            system-uses-terminfo)
-                       (list "TERM=dumb" "TERMCAP="
-                             (format "COLUMNS=%d" (window-width)))
-                     (list "TERM=emacs"
-                           (format "TERMCAP=emacs:co#%d:tc=unknown:"
-                                   (window-width)))))
-             ;; Set the EMACS variable, but
-             ;; don't override users' setting of $EMACS.
-             (or (getenv "EMACS")
-                 (setq process-environment
-                       (cons "EMACS=t" process-environment)))
              (set-process-sentinel proc 'compilation-sentinel)
              (set-process-filter proc 'compilation-filter)
              (set-marker (process-mark proc) (point) outbuf)