4

I use emacs to code and compile C# project.

My project folder contain:

--\test
----Helloworld.cs
----make.bat

Then I open Helloworld.cs in a buffer and M-x compile, emacs will compile project for me.

But if my project folder construction is like this:

--\test
----\src
------Helloworld.cs
----make.bat

Then I open Helloworld.cs in a buffer and M-x compile, emacs cannot find make.bat.

I have to locate make.bat for "compile command" in minibuffer.

Any help is welcome.

1
  • I used vs2010 at home. But sometime I have to use emacs in USB on other computers. And CEDET is heavyweight. Some cs files and a make.bat is fine for me. Commented Sep 14, 2012 at 4:54

2 Answers 2

1

If ../make.bat works, then indeed it's a good option. If not, you can use cd ../; ./make.bat as your compilation command instead. You could even make Emacs look up the directory hierarchy for a make.bat file and add as many ../ as needed.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. "../make.bat" does not work. But "cd ../ & make" as compilation command worked.
1

emacs compile generally runs from the same directory that the source exists in. Set your M-x compile command to ../make.bat (or give it an absolute path) and everything should work.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.