Here’s what I would like to do: When C-c C-l is pressed, a new terminal window is launched if there is no terminal window already, then, in that terminal, gcc is invoked with some flags and the current buffer’s file. How would I do that?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try the built in:
compileisn’t bound to any keys by default, but you could do something like:There are a bunch of packages people have written around compiling on the Emacs Wiki. Check out SmartCompile, CompileCommand, and the category Programmer Utils.
The benefit of using
M-x compile ...over just running it in a “terminal” is that you get C-x ` (akanext-error) which will jump you to the file and line that caused the error command. And there’s the command M-x recompile which does what you’d expect. And, of course, like all Emacs commands, thecompilecommand keeps a history of the compile calls and you can go through the history with M-p and M-n.