[Gllug] compile & run keyboard shortcut in Emacs

Matthew King matthew.king at monnsta.net
Mon Dec 17 09:33:31 UTC 2007


Dan Kolb <gllug at eco.li> writes:

> On Sun, Dec 16, 2007 at 08:50:15PM -0000, F Andersen wrote:
>> I use Emacs to write my C programs but then I have to quit Emacs to compile
>> and run. If there's a need to change the program, I have to open Emacs again
>> and repeat the process.
>
> Why quit?

Indeed apart from that, this all seems fairly normal (move mouse to
hover over term, Up Enter to recall 'make && ./app', move mouse back to
emacs to debug)

>> I'm used to using Bloodshed Dev-C++ under Windows, where simply pressing F9
>> compiles and runs. Is there something similar in Emacs?
>
> M-x compile
> For running, I'd drop to a shell, or run a shell command (M-!). No doubt there
> is a better way, which someone who knows way more about emacs will come up
> with.

I have that bound to C-c c. I think I've changed it from something else
though.

Compiling in emacs has the advantage that C-x ` (backtick - why?) will
step through the errors and warnings spat out by the compiler, taking
you directly to the line reported.

>> As a beginner programmer/Linux user, I would be interested to know what
>> approaches people on this list use to code their programs in Linux.

I can't speak for anyone else, although I'd put money down to say that
quitting isn't among the lists of emacs users.

There's always a GUI, but GUIs invariably suck.

Matthew

-- 
I must take issue with the term "a mere child", for it has been my
invariable experience that the company of a mere child is infinitely
preferable to that of a mere adult.
                                           --  Fran Lebowitz
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list