1
0
Fork 0

Use ‘conf-unix-mode’ for ‘.service’ files

This commit is contained in:
Tom Willemse 2021-02-08 22:30:54 -08:00
parent d824998884
commit c62a5ec9c6
2 changed files with 15 additions and 2 deletions

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; 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

12
test/integration/oni-conf.bats Normal file → Executable file
View file

@ -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" ]]
}