One thing I missed was automatic testing when files are saved. I use Guard when developing Rails projects and wanted to hook it into my Emacs setup.
guard-shell to run ert-runner whenever an
.el file is modified. I added a workaround for ignoring flycheck files, which Emacs saves when a file is modified and can trigger a huge amount of builds.
guard :shell do watch (/(.*)\.el$/) do |file| # Ugly fix but I couldn't spend time messing around with regex. unless file.to_s.include? 'flycheck' if system('cask exec ert-runner') n 'Tests succeeded', 'ERT', :success else n 'Tests failed', 'ERT', :failed end '' end end end
:failed with the process result also means Guard’s notifier works correctly, so it’s possible to use the Emacs notifier to get realtime test pass & fail colours whenever a file is saved. Pretty neat!