emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/evil-matchit bed39041b1 123/244: support markdown


From: ELPA Syncer
Subject: [nongnu] elpa/evil-matchit bed39041b1 123/244: support markdown
Date: Thu, 6 Jan 2022 02:58:55 -0500 (EST)

branch: elpa/evil-matchit
commit bed39041b1181ec26cf2601a8a7aa4afe2510f5b
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>

    support markdown
---
 README.org                 |  3 +-
 evil-matchit-c.el          |  2 +-
 evil-matchit-cmake.el      |  4 +--
 evil-matchit-diff.el       |  2 +-
 evil-matchit-fortran.el    |  4 +--
 evil-matchit-html.el       |  2 +-
 evil-matchit-javascript.el |  2 +-
 evil-matchit-latex.el      |  2 +-
 evil-matchit-markdown.el   | 79 ++++++++++++++++++++++++++++++++++++++++++++++
 evil-matchit-org.el        |  4 +--
 evil-matchit-python.el     |  2 +-
 evil-matchit-ruby.el       |  4 +--
 evil-matchit-script.el     |  4 +--
 evil-matchit-sdk.el        | 12 +++++--
 evil-matchit-sh.el         |  2 +-
 evil-matchit-simple.el     |  2 +-
 evil-matchit-sql.el        |  4 +--
 evil-matchit-template.el   |  4 +--
 evil-matchit-verilog.el    |  4 +--
 evil-matchit.el            | 14 +++++---
 pkg.sh                     |  2 +-
 21 files changed, 126 insertions(+), 32 deletions(-)

diff --git a/README.org b/README.org
index fe6395ad41..2f2b07a802 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,4 @@
-* evil-matchit (v2.2.2)
+* evil-matchit (v2.2.3)
 
 
[[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]]
 
@@ -15,6 +15,7 @@ Many modern languages are supported:
 - React JSX (rjsx-mode)
 - JSON
 - OCaml
+- Markdown
 - Perl
 - Latex
 - CMake
diff --git a/evil-matchit-c.el b/evil-matchit-c.el
index 6cec4c1083..442a60aa8f 100644
--- a/evil-matchit-c.el
+++ b/evil-matchit-c.el
@@ -1,6 +1,6 @@
 ;;; evil-matchit-c.el --c like language (c/c++/perl/java/javascript) plugin of 
evil-matchit
 
-;; Copyright (C) 2014-2016 Chen Bin <chenbin.sh@gmail.com>
+;; Copyright (C) 2014-2017 Chen Bin <chenbin.sh@gmail.com>
 
 ;; Author: Chen Bin <chenbin.sh@gmail.com>
 
diff --git a/evil-matchit-cmake.el b/evil-matchit-cmake.el
index c3971e5294..6e15f62f1e 100644
--- a/evil-matchit-cmake.el
+++ b/evil-matchit-cmake.el
@@ -1,6 +1,6 @@
 ;;; evil-matchit-cmake.el ---cmake (ruby/lua) plugin of evil-matchit
 
-;; Copyright (C) 2014-2016 Chen Bin <chenbin.sh@gmail.com>
+;; Copyright (C) 2014-2017 Chen Bin <chenbin.sh@gmail.com>
 
 ;; Author: Chen Bin <chenbin.sh@gmail.com>
 
@@ -27,7 +27,7 @@
 ;;; Code:
 
 ;; OPTIONAL, you don't need SDK to write a plugin for evil-matchit
-;; but SDK don make you write less code, isn't it?
+;; 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)
 
diff --git a/evil-matchit-diff.el b/evil-matchit-diff.el
index d0c978bce6..691d1b2aef 100644
--- a/evil-matchit-diff.el
+++ b/evil-matchit-diff.el
@@ -1,6 +1,6 @@
 ;;; evil-matchit-diff.el -- diff-mode  plugin of evil-matchit
 
-;; Copyright (C) 2014-2016 Chen Bin <chenbin.sh@gmail.com>
+;; Copyright (C) 2014-2017 Chen Bin <chenbin.sh@gmail.com>
 
 ;; Author: Chen Bin <chenbin.sh@gmail.com>
 
diff --git a/evil-matchit-fortran.el b/evil-matchit-fortran.el
index 48c3341035..047a9fd4f7 100644
--- a/evil-matchit-fortran.el
+++ b/evil-matchit-fortran.el
@@ -1,6 +1,6 @@
 ;;; evil-matchit-fortran.el ---fortran (ruby/lua) plugin of evil-matchit
 
-;; Copyright (C) 2014-2016 Chen Bin <chenbin.sh@gmail.com>
+;; Copyright (C) 2014-2017 Chen Bin <chenbin.sh@gmail.com>
 
 ;; Author: Chen Bin <chenbin.sh@gmail.com>
 
@@ -27,7 +27,7 @@
 ;;; Code:
 
 ;; OPTIONAL, you don't need SDK to write a plugin for evil-matchit
-;; but SDK don make you write less code, isn't it?
+;; 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)
 
diff --git a/evil-matchit-html.el b/evil-matchit-html.el
index a933d32936..3f7badc493 100644
--- a/evil-matchit-html.el
+++ b/evil-matchit-html.el
@@ -1,6 +1,6 @@
 ;;; evil-matchit-html.el ---html plugin of evil-matchit
 
-;; Copyright (C) 2014-2016 Chen Bin <chenbin.sh@gmail.com>
+;; Copyright (C) 2014-2017 Chen Bin <chenbin.sh@gmail.com>
 
 ;; Author: Chen Bin <chenbin.sh@gmail.com>
 
diff --git a/evil-matchit-javascript.el b/evil-matchit-javascript.el
index 0b3256adcf..eb86833421 100644
--- a/evil-matchit-javascript.el
+++ b/evil-matchit-javascript.el
@@ -1,6 +1,6 @@
 ;;; evil-matchit-javascript.el --- simple match plugin of evil-matchit
 
-;; Copyright (C) 2014-2016 Chen Bin <chenbin.sh@gmail.com>
+;; Copyright (C) 2014-2017 Chen Bin <chenbin.sh@gmail.com>
 
 ;; Author: Chen Bin <chenbin.sh@gmail.com>
 
diff --git a/evil-matchit-latex.el b/evil-matchit-latex.el
index a5e7c6af69..3fe6a0c1a5 100644
--- a/evil-matchit-latex.el
+++ b/evil-matchit-latex.el
@@ -1,6 +1,6 @@
 ;;; evil-matchit-latex.el ---latex plugin of evil-matchit
 
-;; Copyright (C) 2014-2016 Chen Bin <chenbin.sh@gmail.com>
+;; Copyright (C) 2014-2017 Chen Bin <chenbin.sh@gmail.com>
 
 ;; Author: Chen Bin <chenbin.sh@gmail.com>
 
diff --git a/evil-matchit-markdown.el b/evil-matchit-markdown.el
new file mode 100644
index 0000000000..d5921e787a
--- /dev/null
+++ b/evil-matchit-markdown.el
@@ -0,0 +1,79 @@
+;;; evil-matchit-markdown.el --- markdown-mode plugin of evil-matchit
+
+;; Copyright (C) 2014-2017 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 don 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)
+
+;;;###autoload
+(defun evilmi-markdown-get-tag ()
+  "Get current tag.
+Return (list start-position tag)."
+  (let* ((cur-line (evilmi-sdk-curline))
+         rlt
+         forward-direction)
+    (if (string-match "^\\(```\\)" cur-line)
+        (let* ((str (match-string 1 cur-line))
+               (prefix (buffer-substring-no-properties (point-min)
+                                                       
(line-beginning-position)))
+               (forward-direction (evenp (evilmi-count-matches str prefix))))
+          (setq rlt (list (if forward-direction (line-beginning-position)
+                            (line-end-position))
+                          forward-direction
+                          str))))
+    rlt))
+
+;;;###autoload
+(defun evilmi-markdown-jump (info num)
+  "Jump to the next tag."
+  (let* ((forward-direction (nth 1 info))
+         (str (nth 2 info))
+         (pos (point))
+         (rlt pos))
+    (cond
+     ((string= str "```")
+      (let* ((prefix (buffer-substring-no-properties (point-min)
+                                                     
(line-beginning-position))))
+        (cond
+         (forward-direction
+          ;; jump forward
+          (goto-char (+ pos (length str)))
+          (search-forward str)
+          (setq rlt (line-end-position)))
+         (t
+          ;; jump backward
+          (goto-char (- pos (length str)))
+          (search-backward str)
+          (setq rlt (line-beginning-position))))))
+     (t
+      ;; do nothing
+      ))
+    rlt))
+
+(provide 'evil-matchit-markdown)
diff --git a/evil-matchit-org.el b/evil-matchit-org.el
index beb8f54616..5030a32a99 100644
--- a/evil-matchit-org.el
+++ b/evil-matchit-org.el
@@ -1,6 +1,6 @@
 ;;; evil-matchit-org.el --- org-mode plugin of evil-matchit
 
-;; Copyright (C) 2014-2016 Chen Bin <chenbin.sh@gmail.com>
+;; Copyright (C) 2014-2017 Chen Bin <chenbin.sh@gmail.com>
 
 ;; Author: Chen Bin <chenbin.sh@gmail.com>
 
@@ -27,7 +27,7 @@
 ;;; Code:
 
 ;; OPTIONAL, you don't need SDK to write a plugin for evil-matchit
-;; but SDK don make you write less code, isn't it?
+;; 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)
 
diff --git a/evil-matchit-python.el b/evil-matchit-python.el
index 0bad0e570f..9603141d5a 100644
--- a/evil-matchit-python.el
+++ b/evil-matchit-python.el
@@ -1,6 +1,6 @@
 ;;; evil-matchit-python.el ---python plugin of evil-matchit
 
-;; Copyright (C) 2014-2016 Chen Bin <chenbin.sh@gmail.com>
+;; Copyright (C) 2014-2017 Chen Bin <chenbin.sh@gmail.com>
 
 ;; Author: Chen Bin <chenbin.sh@gmail.com>
 
diff --git a/evil-matchit-ruby.el b/evil-matchit-ruby.el
index 26730535ef..5e79b81692 100644
--- a/evil-matchit-ruby.el
+++ b/evil-matchit-ruby.el
@@ -1,6 +1,6 @@
 ;;; evil-matchit-ruby.el ---ruby plugin of evil-matchit
 
-;; Copyright (C) 2014-2016 Chen Bin <chenbin.sh@gmail.com>
+;; Copyright (C) 2014-2017 Chen Bin <chenbin.sh@gmail.com>
 
 ;; Author: Chen Bin <chenbin.sh@gmail.com>
 
@@ -27,7 +27,7 @@
 ;;; Code:
 
 ;; OPTIONAL, you don't need SDK to write a plugin for evil-matchit
-;; but SDK don make you write less code, isn't it?
+;; 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)
 
diff --git a/evil-matchit-script.el b/evil-matchit-script.el
index a2b64951cf..0ea760b5e8 100644
--- a/evil-matchit-script.el
+++ b/evil-matchit-script.el
@@ -1,6 +1,6 @@
 ;;; evil-matchit-script.el ---script (ruby/lua) plugin of evil-matchit
 
-;; Copyright (C) 2014-2016 Chen Bin <chenbin.sh@gmail.com>
+;; Copyright (C) 2014-2017 Chen Bin <chenbin.sh@gmail.com>
 
 ;; Author: Chen Bin <chenbin.sh@gmail.com>
 
@@ -27,7 +27,7 @@
 ;;; Code:
 
 ;; OPTIONAL, you don't need SDK to write a plugin for evil-matchit
-;; but SDK don make you write less code, isn't it?
+;; 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)
 
diff --git a/evil-matchit-sdk.el b/evil-matchit-sdk.el
index 464b743b76..2655f96c90 100644
--- a/evil-matchit-sdk.el
+++ b/evil-matchit-sdk.el
@@ -1,7 +1,6 @@
 (defvar evilmi-sdk-extract-keyword-howtos
   '(("^[ \t]*\\([a-z]+\!?\\)\\( .*\\| *\\)$" 1)
-    ("^.* \\(do\\) |[a-z0-9A-Z,|]+|$" 1)
-    )
+    ("^.* \\(do\\) |[a-z0-9A-Z,|]+|$" 1))
   "The list of HOWTO on extracting keyword from current line.
 Each howto is actually a pair. The first element of pair is the regular
 expression to match the current line. The second is the index of sub-matches
@@ -268,4 +267,13 @@ is-function-exit-point could be unknown status"
         ))
     where-to-jump-in-theory))
 
+(defun evilmi-count-matches (regexp str)
+  (let* ((count 0)
+         (start 0))
+    (unless start (setq start 0))
+    (while (string-match regexp str start)
+      (setq count (1+ count))
+      (setq start (match-end 0)))
+    count))
+
 (provide 'evil-matchit-sdk)
diff --git a/evil-matchit-sh.el b/evil-matchit-sh.el
index 5e35998182..f85b0c127a 100644
--- a/evil-matchit-sh.el
+++ b/evil-matchit-sh.el
@@ -1,6 +1,6 @@
 ;;; evil-matchit-sh.el ---sh (bash/zsh) plugin of evil-matchit
 
-;; Copyright (C) 2014-2016 Chen Bin <chenbin.sh@gmail.com>
+;; Copyright (C) 2014-2017 Chen Bin <chenbin.sh@gmail.com>
 
 ;; Author: Chen Bin <chenbin.sh@gmail.com>
 
diff --git a/evil-matchit-simple.el b/evil-matchit-simple.el
index 7c924c93eb..0d23f3af36 100644
--- a/evil-matchit-simple.el
+++ b/evil-matchit-simple.el
@@ -1,6 +1,6 @@
 ;;; evil-matchit-simple.el --- simple match plugin of evil-matchit
 
-;; Copyright (C) 2014-2016 Chen Bin <chenbin.sh@gmail.com>
+;; Copyright (C) 2014-2017 Chen Bin <chenbin.sh@gmail.com>
 
 
 ;; Author: Chen Bin <chenbin.sh@gmail.com>
diff --git a/evil-matchit-sql.el b/evil-matchit-sql.el
index d1dcc52700..5ba424bf09 100644
--- a/evil-matchit-sql.el
+++ b/evil-matchit-sql.el
@@ -1,6 +1,6 @@
 ;;; evil-matchit-sql.el ---sql plugin of evil-matchit
 
-;; Copyright (C) 2014-2016 Chen Bin <chenbin.sh@gmail.com>
+;; Copyright (C) 2014-2017 Chen Bin <chenbin.sh@gmail.com>
 
 ;; Author: Chen Bin <chenbin.sh@gmail.com>
 
@@ -27,7 +27,7 @@
 ;;; Code:
 
 ;; OPTIONAL, you don't need SDK to write a plugin for evil-matchit
-;; but SDK don make you write less code, isn't it?
+;; 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)
 
diff --git a/evil-matchit-template.el b/evil-matchit-template.el
index 214f9ba7f6..d07b7c698a 100644
--- a/evil-matchit-template.el
+++ b/evil-matchit-template.el
@@ -1,6 +1,6 @@
 ;;; evil-matchit-template.el --- web template plugin of evil-matchit
 
-;; Copyright (C) 2014-2016 Chen Bin <chenbin.sh@gmail.com>
+;; Copyright (C) 2014-2017 Chen Bin <chenbin.sh@gmail.com>
 
 ;; Author: Chen Bin <chenbin.sh@gmail.com>
 
@@ -27,7 +27,7 @@
 ;;; Code:
 
 ;; OPTIONAL, you don't need SDK to write a plugin for evil-matchit
-;; but SDK don make you write less code, isn't it?
+;; 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)
 
diff --git a/evil-matchit-verilog.el b/evil-matchit-verilog.el
index 11d97fafa8..f06c8d8e88 100644
--- a/evil-matchit-verilog.el
+++ b/evil-matchit-verilog.el
@@ -1,6 +1,6 @@
 ;;; evil-matchit-verilog.el ---verilog plugin of evil-matchit
 
-;; Copyright (C) 2014-2016 Chen Bin <chenbin.sh@gmail.com>
+;; Copyright (C) 2014-2017 Chen Bin <chenbin.sh@gmail.com>
 
 ;; Author: Chen Bin <chenbin.sh@gmail.com>
 
@@ -27,7 +27,7 @@
 ;;; Code:
 
 ;; OPTIONAL, you don't need SDK to write a plugin for evil-matchit
-;; but SDK don make you write less code, isn't it?
+;; 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)
 
diff --git a/evil-matchit.el b/evil-matchit.el
index 1a26e7b92f..7ac63afca1 100644
--- a/evil-matchit.el
+++ b/evil-matchit.el
@@ -1,10 +1,10 @@
 ;;; evil-matchit.el --- Vim matchit ported to Evil
 
-;; Copyright (C) 2014-2016 Chen Bin <chenbin.sh@gmail.com>
+;; Copyright (C) 2014-2017 Chen Bin <chenbin.sh@gmail.com>
 
 ;; Author: Chen Bin <chenbin.sh@gmail.com>
 ;; URL: http://github.com/redguardtoo/evil-matchit
-;; Version: 2.2.2
+;; Version: 2.2.3
 ;; Keywords: matchit vim evil
 ;; Package-Requires: ((evil "1.0.7"))
 ;;
@@ -307,9 +307,15 @@ If IS-FORWARD is t, jump forward; or else jump backward."
 
   ;; Emacs Org-mode
   (autoload 'evilmi-org-get-tag "evil-matchit-org" nil)
-  (autoload 'evilmi-org-jump "evil-matchit-org" nil t)
+  (autoload 'evilmi-org-jump "evil-matchit-org" nil)
   (plist-put evilmi-plugins 'org-mode '((evilmi-org-get-tag evilmi-org-jump)))
 
+
+  ;; Markdown
+  (autoload 'evilmi-markdown-get-tag "evil-matchit-markdown" nil)
+  (autoload 'evilmi-markdown-jump "evil-matchit-markdown" nil)
+  (plist-put evilmi-plugins 'markdown-mode '((evilmi-markdown-get-tag 
evilmi-markdown-jump)))
+
   ;; Latex
   (autoload 'evilmi-latex-get-tag "evil-matchit-latex" nil)
   (autoload 'evilmi-latex-jump "evil-matchit-latex" nil t)
@@ -486,7 +492,7 @@ If IS-FORWARD is t, jump forward; or else jump backward."
 ;;;###autoload
 (defun evilmi-version()
   (interactive)
-  (message "2.2.2"))
+  (message "2.2.3"))
 
 ;;;###autoload
 (define-minor-mode evil-matchit-mode
diff --git a/pkg.sh b/pkg.sh
index 7120125b4a..60f17e0b96 100755
--- a/pkg.sh
+++ b/pkg.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 name=evil-matchit
-version=2.2.2
+version=2.2.3
 pkg=$name-$version
 mkdir $pkg
 cp README.org $pkg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]