I am looking for either a hack to regular compilation mode, or suggestion on how to create new mode. What i want to achieve, is to 'compile' my code - but the compilator sometimes asks certain questions on the terminal (yes/no, etc etc). Afaik, regular compilation mode can't direct my keyboard input and feed the subprocess with it. Is that possible ?
Thanks
To run make or another compilation command, type M-x compile . This reads a shell command line using the minibuffer, and then executes the command by running a shell as a subprocess (or inferior process) of Emacs.
Emacs can run compilers for languages such as C and Fortran, feeding the compilation log into an Emacs buffer. It can also parse the error messages and show you where the errors occurred.
Compilation mode turns each error message in the buffer into a hyperlink; you can move point to it and type RET, or click on it with the mouse (see Following References with the Mouse), to visit the locus of the error message in a separate window. The locus is the specific position in a file where that error occurred.
C-u M-x compile RET
is all you need.
This is, in fact, documented: typing C-h f compile RET
shows
Additionally, with universal prefix arg, compilation buffer will be in comint mode, i.e. interactive.
If you know all of the answers in advance, you might be able to get away with something as easy as:
(setq compile-command "(echo yes; echo no; echo yes) | (old compile command)")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With