Created
April 2, 2012 22:51
-
-
Save psstoev/2287777 to your computer and use it in GitHub Desktop.
Custom mode-hook for Emacs, to run Scheme "unit tests".
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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