Search code examples
emacsdot-emacs

can I change emacs' default compile command?


Emacs defaults to the command make -k when I run compile. However, I pretty much never think it's useful to have make continue after errors, so I always remove the -k flag. Is there a way to change the default in my .emacs so that it's just make?


Solution

  • (setq compile-command "make") 
    

    or similar in your .emacs should suffice.

    For more info, type

    C-h f compile
    

    which describes what variables are used when M-x compile is called.

    In there, you should see it calls compile-command and a

    C-h v compile-command
    

    tells you this defaults to "make -k". All above is a simplification, but all the info should be in those commands should you need to dig further.