save and compile automatically

Posted by robUK on Stack Overflow See other posts from Stack Overflow or by robUK
Published on 2010-01-14T06:09:54Z Indexed on 2010/06/07 1:02 UTC
Read the original article Hit count: 201

Filed under:

Hello

GNU 23.1.1

By clicking the F5 button I can compile my project. However, I want to extend this so that any unsaved work would be saved and then compiled.

Normally I just do C-x-s to save then click F5. But can I add a line that will save without having to ask me do I want to save then it will compile, all done automatically?

; Compile program using <F5>
; Save all unsaved files here, then compile
(global-set-key [f5] 'compile)

Hope you understand me?

Many thanks for any advice,

© Stack Overflow or respective owner

Related posts about emacs