unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Changing the Compile-Command in C/C++ Mode
@ 2006-01-27 13:43 Balaji V. Iyer
  2006-01-28  0:45 ` Kevin Rodgers
  0 siblings, 1 reply; 2+ messages in thread
From: Balaji V. Iyer @ 2006-01-27 13:43 UTC (permalink / raw)


Hi Everyone,
  	I do not always use a make file and I would like the emacs (version
21.2.1) to modify the compile-command line to "g++ -Wall -O4 filename.c. I
thought this script did the trick but it didn't. I do not get any syntax
error, but when I hit the M-x compile command I still get "make -k"
How can I fix this? If you have an alternative implementation, I am willing
to use that too.

(function
 	   (lambda ()
 	     (unless (or (file-exists-p "makefile")
 			 (file-exists-p "Makefile"))
 	       (make-local-variable 'compile-command)
 	       (setq compile-command
 		     (concat "gcc -Wall -O3 -o"
		             (file-name-sans-extension
(file-name-nondirectory buffer-file-name))
			     " "
 			     (file-name-nondirectory buffer-file-name))))))

Any help is highly appreciated.

Thanking You,

Yours Sincerely,

Balaji V. Iyer.

PS. Please CC me when replying since I am not a subscribed member to this
mailing list.

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

end of thread, other threads:[~2006-01-28  0:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-27 13:43 Changing the Compile-Command in C/C++ Mode Balaji V. Iyer
2006-01-28  0:45 ` Kevin Rodgers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).