Combining Tools with Emacs
One of the things the Emacs editor is
very good at is acting as a front end for other development tools (we
discussed this from a philosophical angle in Chapter13). In fact, nearly every tool we've
discussed in this chapter can be driven from within an
Emacs editor session through front ends
that give them greater utility than they would have running
standalone.
To illustrate this, we'll walk you through the use of these
tools with Emacs in a typical
build/test/debug cycle. For details on them, see
Emacs's own on-line help system; this
section just gives you an overview, to motivate you to learn
more.
Read and learn — not just about
Emacs, but about the mental habit of
looking for synergies between programs, and creating them. Try to read
this section as instruction in philosophy, not just technique.
Make, for example, can be started
with the Emacs command ESC-x
compile followed by an Enter. This command will run
make(1)
in the current directory, capturing the output in an
Emacs buffer.
This by itself wouldn't be very useful. But
Emacs's make
mode knows about the error message format (featuring a source file and
line number) emitted by Unix C compilers and many other tools.
If anything run by make issues error
messages, the command Ctl-X ` (control-X-backquote)
will try to parse them and take you to each error location in turn,
popping open a window on the appropriate file and taking the cursor to
the error line.[138]
This makes it extremely easy to step through an entire build,
fixing any syntax that has been broken since the last compile.
[an error occurred while processing this directive]