Skip to content
Browse files
Display Clojure test failures right in the code buffer
  • Loading branch information
maio committed Aug 30, 2013
1 parent 6cf13e1 commit 4d13573
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
@@ -17,6 +17,7 @@
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(clojure-test-failure-face ((t (:foreground "brightred"))))
'(hl-line ((t (:inherit highlight))))
'(idle-highlight ((t (:inherit hl-line))))
'(italic ((t (:underline nil :slant italic))))
@@ -7,11 +7,30 @@
(call-interactively 'nrepl-switch-to-repl-buffer)
(call-interactively 'nrepl)))

(defun maio/delete-nrepl-error-window ()
(when (get-buffer "*nrepl-error*")
(let ((nrepl-error-window (get-buffer-window (get-buffer "*nrepl-error*"))))
(when nrepl-error-window
(delete-window nrepl-error-window)))))

(eval-after-load 'clojure-mode
(require 'midje-mode)
(require 'clojure-test-mode)
(defadvice clojure-test-run-tests (before save activate) (save-buffer))
(key-chord-define clojure-test-mode-map ";e" 'clojure-test-run-tests)
(defadvice clojure-test-run-tests (before clear-and-save activate)
(defadvice clojure-test-highlight-problem (after comment (line event message pp-actual) activate)
(goto-char (point-min))
(forward-line (1- line))
(call-interactively 'open-line)
(midje-insert-failure-message message)))
(key-chord-define clojure-test-mode-map ";w" 'clojure-test-run-tests)
(evil-define-key 'normal clojure-mode-map "gs" 'maio/nrepl)
(evil-define-key 'normal clojure-mode-map (kbd "M-.") 'nrepl-jump)
(add-hook 'clojure-mode-hook 'eldoc-mode)

0 comments on commit 4d13573

Please sign in to comment.