Skip to content

Instantly share code, notes, and snippets.

@maruks
Created October 15, 2013 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maruks/6999491 to your computer and use it in GitHub Desktop.
Save maruks/6999491 to your computer and use it in GitHub Desktop.
emacs lisp function that compiles current buffer and runs speclj tests in repl buffer
(defun compile-run-tests (arg)
(interactive "P")
(let ((oldbuf (current-buffer)))
(save-buffer)
(nrepl-load-current-buffer)
(nrepl-switch-to-relevant-repl-buffer nil)
(insert "(run-specs)")
(nrepl-return)
(unless arg
(switch-to-buffer-other-window oldbuf))))
(eval-after-load 'clojure-mode
'(progn
(define-key clojure-mode-map (kbd "<f6>") 'compile-run-tests)
(define-key clojure-mode-map (kbd "\e\er") 'nrepl-switch-to-relevant-repl-buffer)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment