[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-matchit 50bb882419 132/244: support elixir
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-matchit 50bb882419 132/244: support elixir |
Date: |
Thu, 6 Jan 2022 02:58:56 -0500 (EST) |
branch: elpa/evil-matchit
commit 50bb88241983f0bf06d35a455a87c04eddc11c83
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>
support elixir
---
README.org | 3 ++-
evil-matchit-elixir.el | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++
evil-matchit.el | 13 +++++++++--
pkg.sh | 2 +-
4 files changed, 76 insertions(+), 4 deletions(-)
diff --git a/README.org b/README.org
index 5add38bbdc..1fcc604402 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,4 @@
-* evil-matchit (v2.2.4)
+* evil-matchit (v2.2.6)
[[http://melpa.org/#/evil-matchit][file:http://melpa.org/packages/evil-matchit-badge.svg]]
[[http://stable.melpa.org/#/evil-matchit][file:http://stable.melpa.org/packages/evil-matchit-badge.svg]]
@@ -21,6 +21,7 @@ Many modern languages are supported:
- CMake
- Org-mode (match tag of org-mode and tags of other languages embedded in org
file)
- Ruby
+- Elixir
- Bash
- Lua
- PHP
diff --git a/evil-matchit-elixir.el b/evil-matchit-elixir.el
new file mode 100644
index 0000000000..8da849f1e3
--- /dev/null
+++ b/evil-matchit-elixir.el
@@ -0,0 +1,62 @@
+;;; evil-matchit-elixir.el ---elixir plugin of evil-matchit
+
+;; Copyright (C) 2018 Chen Bin <chenbin.sh@gmail.com>
+
+;; Author: Chen Bin <chenbin.sh@gmail.com>
+
+;; This file is not part of GNU Emacs.
+
+;;; License:
+
+;; This file is part of evil-matchit
+;;
+;; evil-matchit 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.
+;;
+;; evil-matchit 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 <http://www.gnu.org/licenses/>.
+
+
+;;; Code:
+
+;; OPTIONAL, you don't need SDK to write a plugin for evil-matchit
+;; but SDK do make you write less code, isn't it?
+;; All you need to do is just define the match-tags for SDK algorithm to
lookup.
+(require 'evil-matchit-sdk)
+
+;; {{ Sample elixir code:
+;; defmodule MyValidator do
+;; use Validator
+;; validate_length :name, 1..100
+;; validate_matches :email, ~r/@/
+;; end
+;; }}
+
+;; should try next howto, the purpose is avoid missing any howto
+(defvar evilmi-elixir-extract-keyword-howtos
+ '(("^[ \t]*\\(def[a-z]+\\|fn\\|if\\|case\\|unless\\|cond\\) " 1)
+ ("^[ \t]*\\(end\\|else\\)[ \t]*$" 1)
+ ("^[^=]+=[ \t]*\\(if\\|case\\|unless\\|cond\\)[ \t]+" 1)))
+
+(defvar evilmi-elixir-match-tags
+ '((("defmodule" "defp" "defmacro" "fn" "cond") () "end")
+ (("if" "case" "unless") ("else") "end")))
+
+;;;###autoload
+(defun evilmi-elixir-get-tag ()
+ (let* ((rlt (evilmi-sdk-get-tag evilmi-elixir-match-tags
evilmi-elixir-extract-keyword-howtos)))
+ rlt))
+
+;;;###autoload
+(defun evilmi-elixir-jump (rlt NUM)
+ (evilmi-sdk-jump rlt NUM evilmi-elixir-match-tags
evilmi-elixir-extract-keyword-howtos))
+
+(provide 'evil-matchit-elixir)
+;;; evil-matchit-elixir.el ends here
\ No newline at end of file
diff --git a/evil-matchit.el b/evil-matchit.el
index 6c7c3ff485..d77e3b1d80 100644
--- a/evil-matchit.el
+++ b/evil-matchit.el
@@ -4,7 +4,7 @@
;; Author: Chen Bin <chenbin.sh@gmail.com>
;; URL: http://github.com/redguardtoo/evil-matchit
-;; Version: 2.2.4
+;; Version: 2.2.6
;; Keywords: matchit vim evil
;; Package-Requires: ((evil "1.0.7"))
;;
@@ -400,6 +400,15 @@ If IS-FORWARD is t, jump forward; or else jump backward."
(evilmi-ruby-get-tag
evilmi-ruby-jump))))
'(ruby-mode enh-ruby-mode)))
+ (autoload 'evilmi-elixir-get-tag "evil-matchit-elixir" nil)
+ (autoload 'evilmi-elixir-jump "evil-matchit-elixir" nil)
+ ;; @see https://github.com/syl20bnr/spacemacs/issues/2093
+ ;; spacemacs use enh-elixir-mode
+ (mapc (lambda (mode)
+ (plist-put evilmi-plugins mode '((evilmi-simple-get-tag
evilmi-simple-jump)
+ (evilmi-elixir-get-tag
evilmi-elixir-jump))))
+ '(elixir-mode))
+
(defun evilmi--region-to-select-or-delete (num &optional is-inner)
(let* (where-to-jump-in-theory b e)
(save-excursion
@@ -492,7 +501,7 @@ If IS-FORWARD is t, jump forward; or else jump backward."
;;;###autoload
(defun evilmi-version()
(interactive)
- (message "2.2.4"))
+ (message "2.2.6"))
;;;###autoload
(define-minor-mode evil-matchit-mode
diff --git a/pkg.sh b/pkg.sh
index 0962b0fd3d..b33e06ad72 100755
--- a/pkg.sh
+++ b/pkg.sh
@@ -1,6 +1,6 @@
#!/bin/bash
name=evil-matchit
-version=2.2.4
+version=2.2.6
pkg=$name-$version
mkdir $pkg
cp README.org $pkg
- [nongnu] elpa/evil-matchit f981f722df 088/244: avoid hang in python-mode, v2.1.1, (continued)
- [nongnu] elpa/evil-matchit f981f722df 088/244: avoid hang in python-mode, v2.1.1, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 0b35f26191 091/244: javascript could use evilmi-simple-*, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 6346825fd8 099/244: less picky about latex tags, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 080639aed3 100/244: clean code and doc, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit b01763bf76 107/244: initialize evilmi-plugins only once v2.1.5, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 1d55eba1d3 112/244: fix bug on verilog if statement, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 01ade592db 114/244: enhance js matching algorithm, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 277623d8be 116/244: support css/less/scss, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 4101ee2432 130/244: handle 'switch' in C properly, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 69299108fd 120/244: Add sig/end matching for ocaml, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 50bb882419 132/244: support elixir,
ELPA Syncer <=
- [nongnu] elpa/evil-matchit e15ad8406b 155/244: Merge pull request #95 from linchen2chris/master, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit a8a8625fc2 144/244: Merge pull request #90 from Khady/patch-2, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 11f57d8f52 142/244: Merge pull request #89 from Khady/patch-1, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit f471bc97bd 137/244: tsx needs jsx support as well, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 0d463ab3da 172/244: Ocaml: add normal parentheses support, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 5cea6fde1c 162/244: clean code and wording, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit fb04ffae4b 176/244: Treat source blocks labelled as "elisp"., ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit b00671fb9e 186/244: Mark evilmi-jump-items as a jump motion, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit ea1e867129 181/244: support more ruby syntax, thanks to @kriansa, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-matchit 9ef1325305 200/244: wording, ELPA Syncer, 2022/01/06