root <address@hidden> writes:
...
3) now the real magic happens with emacs....
in emacs it is possible to set the "compile" command or
you can use a "command line macro". i use the macro approach.
in emacs you can record a whole set of keystrokes and make
them into a command line macro that you can execute with "C-x e"
after i've changed the source file i want to
a) save the changes (C-x C-s)
b) switch to the shell buffer (C-x o)
c) make -f Makefile.foo to run the makefile
d) switch back to my program to continue editing.
using the command line macro i can have this all happen in 1 keystroke
to create a command line macro you type "C-x (" to start recording
and "C-x )" to stop recording.
so, with a split screen and the cursor in your code buffer and
the shell in the other buffer do:
C-x ( <== start recording
C-x C-s <== save the changes
C-o <== switch to the shell
M-x > <== go to the end of the shell buffer
make -f Makefile.foo <== run make
C-x o <== switch back to the code buffer
C-x ) <== stop recording
and now you have all the magic because "C-x e" does it all.
do forever
type your changes to your literate program,
type "C-x e" to noweave, latex, notangle, compile, test, and update xdvi
click on xdvi to see the changes
i find it extremely productive. i run "C-x e" every 10 lines of changes
(about once every minute or two) so i know that the latest change will
compile, latex, and run the test cases properly.
But you need half the screen devoted to a shell, which really
shouldn't be necessary. Why not simply have a command which runs the
makefile with `shell-command' or something similar?
(local-set-key "\C-ce"
(lambda ()
(interactive)
(shell-command "make -f Makefile.foo &")))
Or something could be arranged so any output goes to a (normally
non-showing) buffer, which could be displayed in case of an error.
Jay