Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Custom mode-hook for Emacs, to run Scheme "unit tests".
;; Add this to your .emacs, the function supposes, that you have a
;; subdirectory "tests", where there is a file with the same name as
;; the file you are editing. Not very interesting, but convinient.
(add-hook 'scheme-mode-hook
(lambda ()
(add-hook 'after-save-hook
(lambda ()
(let ((file-name (file-name-nondirectory buffer-file-name)))
(if (file-exists-p (concat "tests/" file-name))
(compile (concat "guile -s tests/" file-name))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment