Setting up compile mode for Emacs on Windows 7
After a little while of pulling my hair out while working with GNU Emacs (version 24) on Windows 7, I’m having a bit of luck getting compile mode working correctly.
Fixing my problem was a little simpler than I expected. When I want to compile a program in Emacs, I run M-x compile, which prompts me for a compilation command. Since I’m currently using make to build my projects, I just use the default prompt – ‘make -k’.
Now, the problem is that Windows does not recognize ‘make -k’ as a command, which causes compilation mode not to work. The solution? Relatively simple. Using customize, I found that the variable ‘compile-command’ controls what command is displayed in the compile prompt by default. So, with the help of customize, I just set the default command to the absolute path of make, which seems to work so far.
The previous prompt:
The current prompt:
A bit uglier, but so far it works for my purposes. Of course, this is an ugly way of doing things – it would be nice if Emacs knew to look in C:/MinGW/msys/1.0/bin/ for make, and I’m pretty sure that’s doable – probably something to do with PATH settings. Not sure how to do that though, currently.
Now onward to using make to manage C++ and LaTeX files in the same project!