title: save and compile automatically
body: <p>GNU 23.1.1</p>
  
  <p>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. </p>
  
  <p>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?</p>
  
  <pre><code>; Compile program using &lt;F5&gt;
  ; Save all unsaved files here, then compile
  (global-set-key [f5] 'compile)
  </code></pre>
  
  <p>Hope you understand me?</p>
  
  <p>Many thanks for any advice,</p>