Skip to content

Commit

Permalink
refact(exunit.el): compilation buffer per project (#21)
Browse files Browse the repository at this point in the history
* refact(exunit.el): compilation buffer per project

* chore(deps): adds project to the dependencies
  • Loading branch information
vinikira authored May 2, 2024
1 parent 3b63d88 commit b6134ce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
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

0 comments on commit b6134ce

Please sign in to comment.