tags:

views:

81

answers:

3

Hi,

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

+1  A: 

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)")
Sean
A: 

It seems the only way to achieve what i want, is to use comint package. I'm going to override regular compile mode, to determine (upon file type) whether compiler will or won't ask any questions - if not, use regular compile, otherwise use my custom comint-integrated buffer.

Kuba Tyszko
+4  A: 

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.
offby1