all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ivan Boldyrev <boldyrev@dataeast.ru.microsoft.com>
Subject: compile.el patch
Date: 08 Feb 2003 01:41:51 +0600	[thread overview]
Message-ID: <m3znp72800.fsf@localhost.localdomain> (raw)

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.

             reply	other threads:[~2003-02-07 19:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-07 19:41 Ivan Boldyrev [this message]
2003-02-09  5:49 ` compile.el patch Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3znp72800.fsf@localhost.localdomain \
    --to=boldyrev@dataeast.ru.microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.