When developing software, I tend to notice sometimes that I do repetitive tasks
on my session; at some point, I stop and create a quick function on my
*scratch*
that executes a bunch of steps in one go and add an
after-save-hook
for it on my current buffer.
This package helps removing manual steps in the development cycle. If you need to execute the same commands after a save (run tests, restart browser, etc.), this package allows you to add an Emacs function in the after-save-hook of the editor (or the local buffer).
- Put on your
.emacs.d/init.el
(require 'aftersave)
- Then
M-x aftersave-add-hook
- Select your preferred function to execute after a save
- Profit!
If you at some point, you want to stop execute the given function after a save:
M-x aftersave-remove-hook
- Pick the function you want to remove
- Done!
If you use Ctrl-u
before excuting the aftersave
commands, you will add the
after-save-hook
to the current buffer only.
Code inspired by ideas from Tavis Rudd