aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--oni-core.el4
-rw-r--r--oni-embrace.el41
-rw-r--r--oni-groovy.el4
-rwxr-xr-xtest/integration/oni-embrace.bats10
-rwxr-xr-xtest/integration/oni-groovy.bats10
5 files changed, 65 insertions, 4 deletions
diff --git a/oni-core.el b/oni-core.el
index c24e719..c7ad289 100644
--- a/oni-core.el
+++ b/oni-core.el
@@ -4,8 +4,8 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
-;; Version: 2020.1019.134634
-;; Package-Requires: (oni-data-dir expand-region multiple-cursors embrace gcmh diminish ws-butler)
+;; Version: 2020.1030.180657
+;; Package-Requires: (oni-data-dir oni-embrace expand-region multiple-cursors gcmh diminish ws-butler)
;; 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
diff --git a/oni-embrace.el b/oni-embrace.el
new file mode 100644
index 0000000..4e6389e
--- /dev/null
+++ b/oni-embrace.el
@@ -0,0 +1,41 @@
+;;; oni-embrace.el --- Configuration for embrace -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2020 Tom Willemse
+
+;; Author: Tom Willemse <chelys@rincewind>
+;; Keywords: local
+;; Version: 2020.1030.180221
+;; Package-Requires: (embrace)
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Configuration for embrace.
+
+;;; Code:
+
+(require 'embrace)
+
+(defun oni-embrace-add-slashes ()
+ "Add slashes to the embrace pairs.
+‘groovy-mode’ for example supports strings delimited by slashes."
+ (embrace-add-pair ?/ "/" "/"))
+
+(add-hook 'groovy-mode-hook #'oni-embrace-add-slashes)
+
+;;;###autoload(with-eval-after-load 'embrace (require 'oni-embrace))
+
+(provide 'oni-embrace)
+;;; oni-embrace.el ends here
diff --git a/oni-groovy.el b/oni-groovy.el
index 9312c0c..43f6294 100644
--- a/oni-groovy.el
+++ b/oni-groovy.el
@@ -4,8 +4,8 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
-;; Version: 2020.1019.103906
-;; Package-Requires: (groovy-mode groovy-imports rainbow-delimiters jenkinsfile-mode)
+;; Version: 2020.1030.180316
+;; Package-Requires: (groovy-mode oni-embrace groovy-imports rainbow-delimiters jenkinsfile-mode)
;; 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
diff --git a/test/integration/oni-embrace.bats b/test/integration/oni-embrace.bats
new file mode 100755
index 0000000..0f9f532
--- /dev/null
+++ b/test/integration/oni-embrace.bats
@@ -0,0 +1,10 @@
+#!/usr/bin/env bats
+
+@test "Loading embrace loads oni-embrace" {
+ run emacs -batch -l package -f package-initialize -l embrace \
+ -eval "(prin1 (featurep 'oni-embrace))"
+
+ echo "$output"
+
+ [[ "$output" == *"t" ]]
+}
diff --git a/test/integration/oni-groovy.bats b/test/integration/oni-groovy.bats
index 5a768a3..dc86b82 100755
--- a/test/integration/oni-groovy.bats
+++ b/test/integration/oni-groovy.bats
@@ -39,3 +39,13 @@
[[ "$output" == *"jenkinsfile-mode" ]]
}
+
+@test "Groovy has slashy string support in Embrace" {
+ run emacs -batch -l package -f package-initialize -l embrace \
+ -visit "test.groovy" \
+ -eval "(prin1 (not (null (alist-get ?/ embrace--pair-list))))"
+
+ echo "$output"
+
+ [[ "$output" == *"t" ]]
+}