Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refact(exunit.el): compilation buffer per project #21

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cask
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
(depends-on "f")
(depends-on "ecukes")
(depends-on "ert-runner")
(depends-on "el-mock"))
(depends-on "el-mock")
(depends-on "project"))
10 changes: 8 additions & 2 deletions exunit.el
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
;; URL: http://github.com/ananthakumaran/exunit.el
;; Version: 0.1
;; Keywords: processes elixir exunit
;; Package-Requires: ((s "1.11.0") (emacs "24.3") (f "0.20.0") (transient "0.3.6"))
;; Package-Requires: ((s "1.11.0") (emacs "24.3") (f "0.20.0") (transient "0.3.6") (project "0.9.8"))

;; This program is free software: you can redistribute it and/or modify it
;; under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -36,6 +36,7 @@
(require 'compile)
(require 'transient)
(require 'subr-x)
(require 'project)

;;; Private

Expand Down Expand Up @@ -197,7 +198,12 @@ and filename relative to the dependency."

(define-compilation-mode exunit-compilation-mode "ExUnit Compilation"
"Compilation mode for ExUnit output."
(setq compilation-parse-errors-filename-function #'exunit-parse-error-filename)
(setq compilation-parse-errors-filename-function #'exunit-parse-error-filename
compilation-buffer-name-function
(lambda (compilation-mode)
(if (project-current)
(concat "*" (downcase compilation-mode) "-" (project-name (project-current)) "*")
(compilation--default-buffer-name compilation-mode))))
(add-hook 'compilation-filter-hook 'exunit-colorize-compilation-buffer nil t))

(defun exunit-do-compile (args)
Expand Down
Loading