all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* compile.el patch
@ 2003-02-07 19:41 Ivan Boldyrev
  2003-02-09  5:49 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Ivan Boldyrev @ 2003-02-07 19:41 UTC (permalink / 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-02-09  5:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-07 19:41 compile.el patch Ivan Boldyrev
2003-02-09  5:49 ` Eli Zaretskii

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.