There's only one running *compilation*
buffer allowed at a time, so if you use M-x compile
(which I've had bound to C-x C-e
for like 20 years), that should roughly ensure it.
In the past, I also had a bit of elisp to – IIRC – create and rename multiple compilation buffers to be able to run multiple things at once (multiple servers in a control plane).
yes, should do. It'll prompt you if you want to kill the existing live compilation to start the new one. If it's already dead, it'll just launch the new compilation.
One trick, as well, is if you rename the existing
*compilation*
buffer, it will live on its own lifecycle, so you rename it to*server*
or whatever, and still do compilation cycles (eg. justgo build main.go
) while the existingmain
from the previous run is still live.