Fork me on GitHub
#spacemacs
<
2017-11-11
>
jeff.terrell01:11:47

OK, that was easy. I'm editing LaTeX and every time I save I'm recompiling the file, so my fingers are getting used to the rhythm of SPC f s SPC c r. Then I thought, "Isn't there a way to add hooks in emacs? Could I automatically compile after saving the file?" Answer: yes. A couple of minutes later, after a couple quick web searches and a SPC h d k to describe what function gets called when I say SPC c r to recompile, et viola! > :(add-hook 'after-save-hook 'recompile)

jeff.terrell03:11:20

Or, better yet, :(add-hook 'after-save-hook 'recompile nil t) to make a buffer-local hook.