I have been learning to use Emacs for a little while now. So far liking it a lot.
My problem is that for little C codes I prefer using Rake instead of Make. However flymake does not seem to want anything else than Make. As it complains that it can not find Makefile. From the command line Rake is used in the same way as Make so I was wondering if there was some emacs configuration I could enter to allow Rake to be used by flymake?
To correct a bit what I am doing. I’m not actually editing a Rakefile. And flymake-ruby does not help at all. I’m working with C code. I just use RAKE to compile the c code using gcc instead of MAKE.
Right, got it now; sorry about the earlier confusion.
Taking a quick look through flymake.el, for *.c files, the ‘make’ invocation ultimately comes from here:
That gets called by
flymake-simple-make-init, which is called because that’s what*.cfiles are mapped to byflymake-allowed-file-name-masks.So, the right answer would be to modify
flymake-allowed-file-name-masksto map*.cfiles to a different init defun, then write that defun to call rake the way you want. There are a bunch of those defuns already written for various things, and most of them are pretty short and sweet — so even if you don’t know Emacs Lisp, you could probably get something to work with a minimum of futzing. (The really really right answer would be to changeflymake-simple-make-initso that the command name was read from a defcustom variable, then submit that change back upstream…)The quick-and-dirty answer, given that you said all you need to do is call ‘rake’ with the same args as ‘make’, would be to grab a copy of flymake.el, stick it early in your
load-path, and munge the ‘make’ string inflymake-get-make-cmdlineto read ‘rake’ instead. That’ll at least get you to the next step…