How do I get emacs to change the compilation command on a per-buffer basis?
问题 Suppose I have two code files, one is a small test script, the other is my main piece of code (both are c++ code files). I would like emacs to use different compilation commands for each of them (for example "make test_script" for one and "make release" for the other). What's the best way to do this? 回答1: You can use the compile-command local variable to the buffer. For instance, in one C++ source code: // Local Variables: // compile-command: "make release" // End: and you can change that in