diff --git a/oni-conf/oni-conf.el b/oni-conf/oni-conf.el index 7cd2171..a191501 100644 --- a/oni-conf/oni-conf.el +++ b/oni-conf/oni-conf.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2020.0113.212837 +;; Version: 2021.0208.174956 ;; Package-Requires: (oni-yasnippet) ;; This program is free software; you can redistribute it and/or modify @@ -52,6 +52,9 @@ (add-hook 'conf-mode-hook 'oni-conf--auto-fill-mode) +;;;###autoload +(add-to-list 'auto-mode-alist `(,(rx ".service" string-end) . conf-mode)) + ;;;###autoload (with-eval-after-load 'conf-mode (with-eval-after-load 'yasnippet diff --git a/test/integration/oni-conf.bats b/test/integration/oni-conf.bats old mode 100644 new mode 100755 index 1f9f2d3..aa1cc88 --- a/test/integration/oni-conf.bats +++ b/test/integration/oni-conf.bats @@ -7,5 +7,15 @@ echo "$output" - [ "$output" = "t" ] + [[ "$output" == *"t" ]] +} + +@test "Opening a .service file enables conf-mode" { + run emacs -batch -l package -f package-initialize \ + -visit test.service \ + -eval "(prin1 (derived-mode-p major-mode 'conf-mode))" + + echo "$output" + + [[ "$output" == *"t" ]] }