From 1e2b6678de1495bdfb4e70f312aff25d48006750 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 7 Sep 2020 14:44:32 -0700 Subject: [PATCH] =?UTF-8?q?Add=20=E2=80=98oni-lua=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 6 ++++++ oni-lua.el | 34 ++++++++++++++++++++++++++++++++++ test/integration/oni-lua.bats | 11 +++++++++++ 3 files changed, 51 insertions(+) create mode 100644 oni-lua.el create mode 100755 test/integration/oni-lua.bats diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a97561b..1816d24 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -320,6 +320,12 @@ integration-test-oni-json: - package script: make integration-test-oni-json TEST_ARCHIVE=$(realpath bin/) +integration-test-oni-lua: + stage: integration-test + dependencies: + - package + script: make integration-test-oni-lua TEST_ARCHIVE=$(realpath bin/) + integration-test-oni-org: stage: integration-test dependencies: diff --git a/oni-lua.el b/oni-lua.el new file mode 100644 index 0000000..53c6ce1 --- /dev/null +++ b/oni-lua.el @@ -0,0 +1,34 @@ +;;; oni-lua.el --- Configuration for programming in Lua -*- lexical-binding: t; -*- + +;; Copyright (C) 2020 Tom Willemse + +;; Author: Tom Willemse +;; Keywords: local +;; Version: 2020.0906.130231 +;; Package-Requires: (lua-mode rainbow-delimiters) + +;; 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 +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; This is my configuration for working with Lua files. + +;;; Code: + +(add-hook 'lua-mode-hook 'rainbow-delimiters-mode) + +;;;###autoload(with-eval-after-load 'lua-mode (require 'oni-lua)) + +(provide 'oni-lua) +;;; oni-lua.el ends here diff --git a/test/integration/oni-lua.bats b/test/integration/oni-lua.bats new file mode 100755 index 0000000..4040518 --- /dev/null +++ b/test/integration/oni-lua.bats @@ -0,0 +1,11 @@ +#!/usr/bin/env bats + +@test "Opening a .lua file loads oni-lua" { + run emacs -batch -l package -f package-initialize \ + -visit test.lua \ + -eval "(prin1 (featurep 'oni-lua))" + + echo "$output" + + [[ "$output" == *"t" ]] +}