Skip to content

Instantly share code, notes, and snippets.

@psstoev
Created April 2, 2012 22:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save psstoev/2287777 to your computer and use it in GitHub Desktop.
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