# HG changeset patch # User Richard M. Stallman # Date 1009401971 0 # Node ID fb68db8b657832c0abc8e0c39e4ba1e2232a2901 # Parent 8649ccc72076fc58d17bbc001c5d5473fa1f57a0 (compile-internal): Set TERM variable in process-environment. diff -r 8649ccc72076 -r fb68db8b6578 lisp/progmodes/compile.el --- 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)