From 717797c53881efc6b01dcc364eaa6ead80ec376a Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 26 Dec 2001 21:31:58 +0000 Subject: [PATCH] (compile-internal): Set TERM variable in process-environment. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/compile.el | 20 +++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a74bc670a52..4dd90aec51c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2001-12-26 Richard M. Stallman + + * progmodes/compile.el (compile-internal): + Set TERM variable in process-environment. + 2001-12-21 Eli Zaretskii * info.el (Info-select-node): If Info-use-header-line is nil, set diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index d36011db326..f49948d2333 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -826,14 +826,24 @@ Returns the compilation buffer created." (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) -- 2.39.2