[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
compile.el patch
From: |
Ivan Boldyrev |
Subject: |
compile.el patch |
Date: |
08 Feb 2003 01:41:51 +0600 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Hi, dear Emacs developers!
I use fake e-mail because AFAIK my message will be duplicated in
news:gnu.emacs.bug, but I do not want my address to be captured by
spammers. Probably, you should encrypt posters' addresses as gmane.org
does. See instructions in signature.
I haven't found change log in compile.el, but if you wich to mention
me in man ChangeLog, you may write something like:
* Environment variables are set correctly before running compile
process in compile.el (Ivan Boldyrev)
I hope I didn't make any error in ChangeLog entry and patch
explanation. :)
======================================================================
Patch for Emacs 21.2.1, and, may be, older versions.
Problem
compile.el doesn't set set TERM environment variable correctly.
For example, if run Emacs from console and make command
M-x compile C-a C-k echo $TERM
string "linux" (or "xterm") will be displayed, but nor "dumb" neither
"emacs". Messages of compilers producing color error messages
(e.g. color-gcc from Mandrake distro) will be shown incorrectly.
Solution
Do not call start-process-shell-command until all environment variables
are set. Also do not create completly new process-environment list, but
nconc new values ahead inherited list.
*** compile.el.old Thu Feb 6 20:49:24 2003
--- compile.el Thu Feb 6 20:54:47 2003
***************
*** 826,854 ****
(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)))
;; 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)
! (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.
--- 826,857 ----
(funcall compilation-process-setup-function))
;; Start the compilation.
(if (fboundp 'start-process)
! (let ((process-environment process-environment))
;; Set the terminal type
(setq process-environment
! (nconc
! (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))))
! process-environment))
!
;; Set the EMACS variable, but
;; don't override users' setting of $EMACS.
(if (getenv "EMACS")
(setq process-environment
(cons "EMACS=t" process-environment)))
! (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.
======================================================================
--
Ivan Boldyrev remove .microsoft.com from my mail address
PGP fp: 3640 E637 EE3D AA51 A59F 3306 A5BD D198 5609 8673 ID 56098673
Violets are red, Roses are blue. //
I'm schizophrenic, And so am I.
- compile.el patch,
Ivan Boldyrev <=