[comp.emacs] how to set emacs to compile with certain options

meissner@osf.org (09/29/90)

| From: kondaman@aludra.usc.edu (Arjun Krishna Kondamani)
| Newsgroups: gnu.emacs
| Date: 27 Sep 90 22:58:42 GMT
| Nntp-Posting-Host: aludra.usc.edu
| 
| This is how I compile with gcc. This is set in my .cshrc file.  
| 
| alias gcc		'gcc -ansi -Wunused -Wshadow -Wpointer-arith -pedantic
| '
| However, when compiling in emacs (M-x compile), no notice is taken of
| these options and most times I have to type it in myself. I was
| wondering if there was a way this could be set in .emacs.
| 
| Arjun.

Make uses /bin/sh to spawn commands, which does not use .cshrc.  Try
the following instead:

(setq compile-command "make CC='gcc -ansi -Wunused -Wshadow -Wpointer-arith -pedantic'")

You might also want to just modify the makefile.  By the way, you
could have found your answer via M-x apropos.  I get the following on
my system, when looking for compile:

batch-byte-compile	      
  Function: Runs byte-compile-file on the files remaining on the command line.
byte-compile-file	      
  Function: Compile a file of Lisp code named FILENAME into a file of byte code.
byte-compile-if-newer	      
  Function: Byte compile file.el if newer than file.elc
byte-recompile-directory      
  Function: Recompile every .el file in DIRECTORY that needs recompilation.
compile			      ESC [ 2 4 ~, ESC [ F 1 2 ~
  Function: Compile the program including the current buffer.  Default: run `make'.
compile-command		      
  Variable: *Last shell command used to do a compilation; default for next compilation.
mrm-byte-compile-el-files-hook
  Function: Hook to byte-compile an .el file when stored.
mrm-recursive-byte-compile    
  Variable: Non-nil if within mrm-byte-compile-el-files.
vm-compile-format	      
vm-compiled-format	      

--
Michael Meissner	email: meissner@osf.org		phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142

Do apple growers tell their kids money doesn't grow on bushes?