From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ivan Boldyrev Newsgroups: gmane.emacs.bugs Subject: compile.el patch Date: 08 Feb 2003 01:41:51 +0600 Sender: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1044646991 13876 80.91.224.249 (7 Feb 2003 19:43:11 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 7 Feb 2003 19:43:11 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18hEOt-0003am-00 for ; Fri, 07 Feb 2003 20:43:03 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18hEQ6-0007h0-02 for gnu-bug-gnu-emacs@m.gmane.org; Fri, 07 Feb 2003 14:44:18 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18hEPx-0007bo-00 for bug-gnu-emacs@gnu.org; Fri, 07 Feb 2003 14:44:09 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18hEPq-0007X9-00 for bug-gnu-emacs@gnu.org; Fri, 07 Feb 2003 14:44:08 -0500 Original-Received: from [195.34.2.234] (helo=dataeast.ru) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18hEPp-0007Mk-00 for bug-gnu-emacs@gnu.org; Fri, 07 Feb 2003 14:44:01 -0500 Original-Received: from localhost.localdomain [217.70.109.8] by dataeast.ru with ESMTP (SMTPD32-6.06) id AD435024C; Fri, 07 Feb 2003 22:47:15 +0300 Original-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.1/8.12.1) with ESMTP id h17JfpwA002865 for ; Sat, 8 Feb 2003 01:41:51 +0600 Original-Received: (from iboldyrev@localhost) by localhost.localdomain (8.12.1/8.12.1/Submit) id h17JfpsE002862; Sat, 8 Feb 2003 01:41:51 +0600 X-Face: PH}*k.3oBVs#UXxo9T/`6!vlSI.1C@7ht0^wH,DeRlG\)j3v:@^jABw--/o=BTWpuau^vQM ]WU)p;0L%v?QTVD%s^Cy#D Original-To: bug-gnu-emacs@gnu.org Original-Lines: 114 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: bug-gnu-emacs-bounces+gnu-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:4410 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:4410 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.