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:
Compile command: make -k

The current prompt:
Compile command: c:/MinGW/msys/1.0/bin/make -k

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!


2 thoughts on “Setting up compile mode for Emacs on Windows 7

  1. Admiring the hard work you put into your blog and detailed information you offer.
    It’s good to come across a blog every once in a while that isn’t the
    same old rehashed information. Wonderful read! I’ve saved your site and I’m
    adding your RSS feeds to my Google account.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s