changeset 42339:fb68db8b6578

(compile-internal): Set TERM variable in process-environment.
author Richard M. Stallman <rms@gnu.org>
date Wed, 26 Dec 2001 21:26:11 +0000
parents 8649ccc72076
children 38e43ae6eb0e
files lisp/progmodes/compile.el
diffstat 1 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/compile.el	Wed Dec 26 00:42:56 2001 +0000
+++ b/lisp/progmodes/compile.el	Wed Dec 26 21:26:11 2001 +0000
@@ -899,14 +899,24 @@
 	    (funcall compilation-process-setup-function))
 	;; Start the compilation.
 	(if (fboundp 'start-process)
-	    (let* ((process-environment
-		    ;; Don't override users' setting of $EMACS.
-		    (if (getenv "EMACS")
-			process-environment
-		      (cons "EMACS=t" process-environment)))
+	    (let* ((process-environment 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.
+	      (if (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)