unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* M-x compile does not set the EMACS env var anymore
@ 2003-01-31 19:20 Gustav Hållberg
  2003-02-01 22:11 ` Richard Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: Gustav Hållberg @ 2003-01-31 19:20 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 451 bytes --]

In emacs 21.2, M-x compile does not set the EMACS environment variable 
in the compilation process (which at least 20.7 used to do), and looking
at the code it seems as if it's supposed to do this still.

To test this, evaluate (compile "export")

Note that the TERM env variable is not set properly either.

I am attaching a suggested bugfix.

My patch does not address the case of the branch that gets run unless
(fboundp 'start-process).

- Gustav

[-- Attachment #2: compile.el-diff --]
[-- Type: text/plain, Size: 2076 bytes --]

--- compile-old.el	2003-01-31 19:56:44.000000000 +0100
+++ compile.el	2003-01-31 20:05:07.000000000 +0100
@@ -826,29 +826,33 @@
 	    (funcall compilation-process-setup-function))
 	;; Start the compilation.
 	(if (fboundp 'start-process)
-	    (let* ((process-environment process-environment)
-		   (proc (start-process-shell-command (downcase mode-name)
-						      outbuf
-						      command)))
+	    (let ((process-environment process-environment))
 	      ;; 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)))))
+		    (append 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.
-	      (if (getenv "EMACS")
+	      (unless (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)
-	      (setq compilation-in-progress
-		    (cons proc compilation-in-progress)))
+
+	      (let ((proc (start-process-shell-command (downcase mode-name)
+						       outbuf
+						       command)))
+		(set-process-sentinel proc 'compilation-sentinel)
+		(set-process-filter proc 'compilation-filter)
+		(set-marker (process-mark proc) (point) outbuf)
+		(setq compilation-in-progress
+		      (cons proc compilation-in-progress))))
+
 	  ;; No asynchronous processes available.
 	  (message "Executing `%s'..." command)
 	  ;; Fake modeline display as if `start-process' were run.

[-- Attachment #3: Type: text/plain, Size: 148 bytes --]

_______________________________________________
Bug-gnu-emacs mailing list
Bug-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: M-x compile does not set the EMACS env var anymore
  2003-01-31 19:20 M-x compile does not set the EMACS env var anymore Gustav Hållberg
@ 2003-02-01 22:11 ` Richard Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Stallman @ 2003-02-01 22:11 UTC (permalink / raw)
  Cc: bug-gnu-emacs

This has been fixed for 21.3, the coming bug-fix release.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-02-01 22:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-31 19:20 M-x compile does not set the EMACS env var anymore Gustav Hållberg
2003-02-01 22:11 ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).