branch: elpa/evil-matchit
commit bd4feb78848e6667af5bb3eba2f57069ae1bb7dc
Author: Chen Bin <[email protected]>
Commit: Chen Bin <[email protected]>

    support cmake v1.2.5
---
 README.org                                      | 31 ++++++++++++------------
 evil-matchit-c.el                               |  4 ++--
 evil-matchit-script.el => evil-matchit-cmake.el | 32 ++++++++++++++-----------
 evil-matchit-html.el                            |  2 +-
 evil-matchit-latex.el                           |  6 ++---
 evil-matchit-pkg.el                             |  2 +-
 evil-matchit-python.el                          |  2 +-
 evil-matchit-script.el                          |  4 ++--
 evil-matchit-sdk.el                             |  3 ++-
 evil-matchit-simple.el                          |  4 ++--
 evil-matchit.el                                 | 31 ++++++++++++++----------
 pkg.sh                                          |  2 +-
 12 files changed, 67 insertions(+), 56 deletions(-)

diff --git a/README.org b/README.org
index 99e5a33554..405f9bdca1 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,4 @@
-* evil-matchit (current version 1.2.4)
+* evil-matchit (version 1.2.5)
 
 Vim [[http://www.vim.org/scripts/script.php?script_id=39][matchit.vim]] by 
Benji Fisher ported into Emacs.
 
@@ -84,26 +84,25 @@ Simple. All you need to is define two functions and tell 
evil-matchit in which m
 Here is a complete sample:
 #+BEGIN_SRC elisp
 ;; detect tag in current line and return the result in variable rlt
-;; the rlt will be used by evilmi-mylanguage-jump as the first
-;; parameter.
+;; the rlt will be used by evilmi-mylang-jump as the first parameter.
 ;; if NO tag found, the rlt SHOULD be nil
 ;;
-;; @return the data to be used by evilmi-mylanguage-jump which should be a list
+;; @return the data to be used by evilmi-mylang-jump which should be a list
 ;;         the first element of the list is the position of cursor before jump
 ;;         we use it to select/delete tag. The other elements of the list could
 ;;         be any data type
-(defun evilmi-mylanguage-find-tag ()
+(defun evilmi-mylang-find-tag ()
   (let (rlt )
     (setq rlt '(position-of-open-end "anything-you-like" "anything-you-like")
     rlt
     )
   )
 
-;; @parama rlt result from evilmi-mylanguage-find-tag
+;; @parama rlt result from evilmi-mylang-find-tag
 ;; @param NUM numeric argument when user press "%" to match tag
 ;; @return the matching tag position in theory, useful only for
 ;;         selecting or deleting text between matching tags and tags
-(defun evilmi-mylanguage-jump (rlt NUM)
+(defun evilmi-mylang-jump (rlt NUM)
   (message "rlt=%s" rlt)
   ;; if we need select region between tags (including tags itself)
   ;; we get the beginning of region by reading the first element of
@@ -117,10 +116,8 @@ Here is a complete sample:
   888
   )
 
-;; tell evil-matchit how to use above functions
-(plist-put evilmi-plugins mylanguage-mode
-           '((evilmi-mylanguage-get-tag evilmi-mylanguage-jump)
-             ))
+;; notify evil-matchit how to use above functions
+(plist-put evilmi-plugins mylang-mode '((evilmi-mylang-get-tag 
evilmi-mylang-jump)))
 #+END_SRC
 
 Place above code into your ~/.emacs, after the line "(global-evil-matchit-mode 
1)"
@@ -165,12 +162,16 @@ Simple, eh?
 
 Basically you just need:
 - copy the content of evil-matchit-script.el to your ~/.emacs
-- Search and replace the string "_script" with "_mylanguage" to respect the 
name space
-- Update the value of evilmi--mylanguage-match-tags
-- Notify the evil-matchit about support for new commands (check previous 
section for details)
+- Search and replace the string "_script" with "_mylang" to respect the name 
space
+- Update the value of evilmi--mylan-match-tags
+- Notify the evil-matchit about support for new commands. As I mentioned 
before, it's just one line code in ~/.emacs
+
+#+BEGIN_SRC lisp
+(plist-put evilmi-plugins mylang-mode '((evilmi-mylang-get-tag 
evilmi-mylang-jump)))
+#+END_SRC
 
 ** Share your code to the world
-Tweak your code a little bit to make it a plugin and ask me to merge it into 
main stream.
+Tweak your code a little bit to make it a plugin and ask me to merge it into 
upstream.
 
 Please check "evil-matchit-latext.el" for technical details about plugin.
 
diff --git a/evil-matchit-c.el b/evil-matchit-c.el
index 05c9b2bcc2..66db35ddc5 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) 2013  Chen Bin <[email protected]>
+;; Copyright (C) 2014  Chen Bin <[email protected]>
 
 ;; Author: Chen Bin <[email protected]>
 
@@ -60,4 +60,4 @@ between '\\(' and '\\)' in regular expression.
   (evilmi-sdk-jump rlt NUM evilmi-c-match-tags evilmi-c-extract-keyword-howtos)
   )
 
-(provide 'evil-matchit-c)
\ No newline at end of file
+(provide 'evil-matchit-c)
diff --git a/evil-matchit-script.el b/evil-matchit-cmake.el
similarity index 60%
copy from evil-matchit-script.el
copy to evil-matchit-cmake.el
index 84881ce36f..85d227d483 100644
--- a/evil-matchit-script.el
+++ b/evil-matchit-cmake.el
@@ -1,6 +1,6 @@
-;;; evil-matchit-script.el ---script (ruby/lua) plugin of evil-matchit
+;;; evil-matchit-cmake.el ---cmake (ruby/lua) plugin of evil-matchit
 
-;; Copyright (C) 2013  Chen Bin <[email protected]>
+;; Copyright (C) 2014  Chen Bin <[email protected]>
 
 ;; Author: Chen Bin <[email protected]>
 
@@ -31,13 +31,17 @@
 ;; All you need to do is just define the match-tags for SDK algorithm to 
lookup.
 (require 'evil-matchit-sdk)
 
-;; ruby/bash/lua/vimrc
-(defvar evilmi-script-match-tags
-  '((("unless" "if") ("elif" "elsif" "elseif" "else") ( "end" "fi" "endif"))
-    ("begin" ("rescue" "ensure") "end")
-    ("case" ("when" "else") ("esac" "end"))
-    (("fun!" "function!" "class" "def" "while" "function" "do") () ("end" 
"endfun" "endfunction"))
-    ("repeat" ()  "until")
+(defvar evilmi-cmake-extract-keyword-howtos
+  '(("^[ \t]*\\([a-zA-Z]+ *\\) *(.*$" 1)
+    ))
+
+;; CMake (http://www.cmake.org) syntax
+(defvar evilmi-cmake-match-tags
+  '((("if" "IF") ("elseif" "ELSEIF" "else" "ELSE") ("endif" "ENDIF"))
+    (("foreach" "FOREACH") () ("endforeach" "ENDFOREACH"))
+    (("macro" "MACRO") () ("endmacro" "ENDMACRO"))
+    (("while" "WHILE") () ("endwhile" "ENDWHILE"))
+    (("function" "FUNCTION") () ("endfunction" "ENDFUNCTION"))
     )
   "The table we look up match tags. This is a three column table.
 The first column contains the open tag(s).
@@ -47,13 +51,13 @@ The third column contains the closed tags(s).
   )
 
 ;;;###autoload
-(defun evilmi-script-get-tag ()
-  (evilmi-sdk-get-tag evilmi-script-match-tags 
evilmi-sdk-extract-keyword-howtos)
+(defun evilmi-cmake-get-tag ()
+  (evilmi-sdk-get-tag evilmi-cmake-match-tags 
evilmi-cmake-extract-keyword-howtos)
   )
 
 ;;;###autoload
-(defun evilmi-script-jump (rlt NUM)
-  (evilmi-sdk-jump rlt NUM evilmi-script-match-tags 
evilmi-sdk-extract-keyword-howtos)
+(defun evilmi-cmake-jump (rlt NUM)
+  (evilmi-sdk-jump rlt NUM evilmi-cmake-match-tags 
evilmi-cmake-extract-keyword-howtos)
   )
 
-(provide 'evil-matchit-script)
\ No newline at end of file
+(provide 'evil-matchit-cmake)
diff --git a/evil-matchit-html.el b/evil-matchit-html.el
index a46a942918..a9a671fd07 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) 2013  Chen Bin <[email protected]>
+;; Copyright (C) 2014  Chen Bin <[email protected]>
 
 ;; Author: Chen Bin <[email protected]>
 
diff --git a/evil-matchit-latex.el b/evil-matchit-latex.el
index 399c345a31..76b1d987ea 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) 2013  Chen Bin <[email protected]>
+;; Copyright (C) 2014  Chen Bin <[email protected]>
 
 ;; Author: Chen Bin <[email protected]>
 
@@ -150,7 +150,7 @@ The third column contains the closed tags(s).")
                ;; now handle closed tag
                ;; closed (2) -> mid (1) ignore,impossible
                ((and (= orig-tag-type 2) (= cur-tag-type 1))
-                (message "impossible to be here")
+                (message "impossible to be here (latex-mode)")
                 )
                ;; closed (2) -> closed (2) level++
                ((and (= orig-tag-type 2) (= cur-tag-type 2))
@@ -168,4 +168,4 @@ The third column contains the closed tags(s).")
                )
               )))))))
 
-(provide 'evil-matchit-latex)
\ No newline at end of file
+(provide 'evil-matchit-latex)
diff --git a/evil-matchit-pkg.el b/evil-matchit-pkg.el
index b8d75a25f3..84ca13932d 100644
--- a/evil-matchit-pkg.el
+++ b/evil-matchit-pkg.el
@@ -1,2 +1,2 @@
-(define-package "evil-matchit" "1.2.4"
+(define-package "evil-matchit" "1.2.5"
                 "Vim matchit ported into Emacs (requires EVIL)")
diff --git a/evil-matchit-python.el b/evil-matchit-python.el
index dfdb4495d8..2453c3fa96 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) 2013  Chen Bin <[email protected]>
+;; Copyright (C) 2014  Chen Bin <[email protected]>
 
 ;; Author: Chen Bin <[email protected]>
 
diff --git a/evil-matchit-script.el b/evil-matchit-script.el
index 84881ce36f..5e279261b5 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) 2013  Chen Bin <[email protected]>
+;; Copyright (C) 2014  Chen Bin <[email protected]>
 
 ;; Author: Chen Bin <[email protected]>
 
@@ -56,4 +56,4 @@ The third column contains the closed tags(s).
   (evilmi-sdk-jump rlt NUM evilmi-script-match-tags 
evilmi-sdk-extract-keyword-howtos)
   )
 
-(provide 'evil-matchit-script)
\ No newline at end of file
+(provide 'evil-matchit-script)
diff --git a/evil-matchit-sdk.el b/evil-matchit-sdk.el
index 6d0d1971c0..41974f7f1f 100644
--- a/evil-matchit-sdk.el
+++ b/evil-matchit-sdk.el
@@ -128,6 +128,7 @@ between '\\(' and '\\)' in regular expression.
             )
 
       (setq keyword (evilmi--sdk-extract-keyword cur-line match-tags howtos))
+
       (when keyword
         (setq cur-tag-info (evilmi-sdk-get-tag-info keyword match-tags))
         (setq cur-tag-type (nth 1 cur-tag-info))
@@ -217,4 +218,4 @@ between '\\(' and '\\)' in regular expression.
     )
   )
 
-(provide 'evil-matchit-sdk)
\ No newline at end of file
+(provide 'evil-matchit-sdk)
diff --git a/evil-matchit-simple.el b/evil-matchit-simple.el
index 89c7484608..1845873ccf 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) 2013  Chen Bin <[email protected]>
+;; Copyright (C) 2014  Chen Bin <[email protected]>
 
 ;; Author: Chen Bin <[email protected]>
 
@@ -88,4 +88,4 @@
       )
     ))
 
-(provide 'evil-matchit-simple)
\ No newline at end of file
+(provide 'evil-matchit-simple)
diff --git a/evil-matchit.el b/evil-matchit.el
index 742dcf0f29..94c499793a 100644
--- a/evil-matchit.el
+++ b/evil-matchit.el
@@ -1,10 +1,10 @@
 ;;; evil-matchit.el --- Vim matchit ported to Evil
 
-;; Copyright (C) 2013 Chen Bin
+;; Copyright (C) 2014 Chen Bin
 
 ;; Author: Chen Bin <[email protected]>
 ;; URL: http://github.com/redguardtoo/evil-matchit
-;; Version: 1.2.4
+;; Version: 1.2.5
 ;; Keywords: matchit vim evil
 ;; Package-Requires: ((evil "1.0.7"))
 ;;
@@ -86,16 +86,16 @@
   (interactive)
 
   ;; simple matching for languages containing "{(["
-  (autoload 'evilmi-simple-get-tag "evil-matchit-simple" nil t)
-  (autoload 'evilmi-simple-jump "evil-matchit-simple" nil t)
+  (autoload 'evilmi-simple-get-tag "evil-matchit-simple" nil)
+  (autoload 'evilmi-simple-jump "evil-matchit-simple" nil)
   (mapc (lambda (mode)
           (plist-put evilmi-plugins mode '((evilmi-simple-get-tag 
evilmi-simple-jump)))
           )
         '(java-mode js-mode js2-mode javascript-mode perl-mode cperl-mode))
 
   ;; Html
-  (autoload 'evilmi-html-get-tag "evil-matchit-html" nil t)
-  (autoload 'evilmi-html-jump "evil-matchit-html" nil t)
+  (autoload 'evilmi-html-get-tag "evil-matchit-html" nil)
+  (autoload 'evilmi-html-jump "evil-matchit-html" nil)
   (mapc (lambda (mode)
           (plist-put evilmi-plugins mode '((evilmi-simple-get-tag 
evilmi-simple-jump)
                                            (evilmi-html-get-tag 
evilmi-html-jump)))
@@ -103,28 +103,33 @@
         '(web-mode html-mode nxml-mode nxhtml-mode sgml-mode))
 
   ;; Latex
-  (autoload 'evilmi-latex-get-tag "evil-matchit-latex" nil t)
+  (autoload 'evilmi-latex-get-tag "evil-matchit-latex" nil)
   (autoload 'evilmi-latex-jump "evil-matchit-latex" nil t)
   (plist-put evilmi-plugins 'latex-mode '((evilmi-latex-get-tag 
evilmi-latex-jump)))
 
   ;; Python
-  (autoload 'evilmi-python-get-tag "evil-matchit-python" nil t)
-  (autoload 'evilmi-python-jump "evil-matchit-python" nil t)
+  (autoload 'evilmi-python-get-tag "evil-matchit-python" nil)
+  (autoload 'evilmi-python-jump "evil-matchit-python" nil)
   (plist-put evilmi-plugins 'python-mode '((evilmi-simple-get-tag 
evilmi-simple-jump)
                                            (evilmi-python-get-tag 
evilmi-python-jump)))
 
   ;; C/C++
-  (autoload 'evilmi-c-get-tag "evil-matchit-c" nil t)
-  (autoload 'evilmi-c-jump "evil-matchit-c" nil t)
+  (autoload 'evilmi-c-get-tag "evil-matchit-c" nil)
+  (autoload 'evilmi-c-jump "evil-matchit-c" nil)
   (mapc (lambda (mode)
           (plist-put evilmi-plugins mode '((evilmi-simple-get-tag 
evilmi-simple-jump)
                                            (evilmi-c-get-tag evilmi-c-jump)))
           )
         '(c-mode c++-mode))
 
+  ;; CMake (http://www.cmake.org)
+  (autoload 'evilmi-cmake-get-tag "evil-matchit-cmake" nil)
+  (autoload 'evilmi-cmake-jump "evil-matchit-cmake" nil)
+  (plist-put evilmi-plugins 'cmake-mode '((evilmi-cmake-get-tag 
evilmi-cmake-jump)))
+
   ;; Bash/Lua/Ruby ... any normal script languages
-  (autoload 'evilmi-script-get-tag "evil-matchit-script" nil t)
-  (autoload 'evilmi-script-jump "evil-matchit-script" nil t)
+  (autoload 'evilmi-script-get-tag "evil-matchit-script" nil)
+  (autoload 'evilmi-script-jump "evil-matchit-script" nil)
   (mapc (lambda (mode)
           (plist-put evilmi-plugins mode '((evilmi-simple-get-tag 
evilmi-simple-jump)
                                            (evilmi-script-get-tag 
evilmi-script-jump)))
diff --git a/pkg.sh b/pkg.sh
index 074e742c30..87811ded4d 100755
--- a/pkg.sh
+++ b/pkg.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-pkg=evil-matchit-1.2.4
+pkg=evil-matchit-1.2.5
 mkdir $pkg
 cp README.org $pkg
 cp *.el $pkg

Reply via email to