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

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

[nongnu] elpa/evil-matchit d779aedaf1 195/244: clean code


From: ELPA Syncer
Subject: [nongnu] elpa/evil-matchit d779aedaf1 195/244: clean code
Date: Thu, 6 Jan 2022 02:59:01 -0500 (EST)

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

    clean code
---
 evil-matchit-c.el      |   4 +-
 evil-matchit-cmake.el  |  12 ++--
 evil-matchit-html.el   |   2 +-
 evil-matchit-sdk.el    | 167 ++++++++++++++++++++++++++++++++++++++-----------
 evil-matchit-simple.el |  25 ++++++++
 evil-matchit.el        | 161 ++++++-----------------------------------------
 6 files changed, 186 insertions(+), 185 deletions(-)

diff --git a/evil-matchit-c.el b/evil-matchit-c.el
index 500dcbcda1..71dd697b62 100644
--- a/evil-matchit-c.el
+++ b/evil-matchit-c.el
@@ -43,9 +43,9 @@
   (evilmi-sdk-get-tag evilmi-c-match-tags evilmi-c-extract-keyword-howtos))
 
 ;;;###autoload
-(defun evilmi-c-jump (rlt NUM)
+(defun evilmi-c-jump (rlt num)
   (let* ((old-pos (point))
-         (pos (evilmi-sdk-jump rlt NUM evilmi-c-match-tags 
evilmi-c-extract-keyword-howtos))
+         (pos (evilmi-sdk-jump rlt num evilmi-c-match-tags 
evilmi-c-extract-keyword-howtos))
          (orig-tag (and rlt (nth 3 (cadr rlt)))))
 
     ;; Place cursor over last case of 'switch' statement and press %:
diff --git a/evil-matchit-cmake.el b/evil-matchit-cmake.el
index 5d16e9dff6..59a1ac3e49 100644
--- a/evil-matchit-cmake.el
+++ b/evil-matchit-cmake.el
@@ -46,12 +46,14 @@
 
 ;;;###autoload
 (defun evilmi-cmake-get-tag ()
-  (evilmi-sdk-get-tag evilmi-cmake-match-tags 
evilmi-cmake-extract-keyword-howtos)
-  )
+  (evilmi-sdk-get-tag evilmi-cmake-match-tags
+                      evilmi-cmake-extract-keyword-howtos))
 
 ;;;###autoload
-(defun evilmi-cmake-jump (rlt NUM)
-  (evilmi-sdk-jump rlt NUM evilmi-cmake-match-tags 
evilmi-cmake-extract-keyword-howtos)
-  )
+(defun evilmi-cmake-jump (info num)
+  (evilmi-sdk-jump info
+                   num
+                   evilmi-cmake-match-tags
+                   evilmi-cmake-extract-keyword-howtos))
 
 (provide 'evil-matchit-cmake)
diff --git a/evil-matchit-html.el b/evil-matchit-html.el
index 305bebe913..c7813b9270 100644
--- a/evil-matchit-html.el
+++ b/evil-matchit-html.el
@@ -1,4 +1,4 @@
-;;; evil-matchit-html.el ---html plugin of evil-matchit
+;;; evil-matchit-html.el --- html plugin of evil-matchit
 
 ;; Copyright (C) 2014-2020 Chen Bin <chenbin DOT sh AT gmail DOT com>
 
diff --git a/evil-matchit-sdk.el b/evil-matchit-sdk.el
index 14a31fa414..467639ae76 100644
--- a/evil-matchit-sdk.el
+++ b/evil-matchit-sdk.el
@@ -1,3 +1,5 @@
+(require 'evil nil t)
+
 (defvar evilmi-debug nil
   "Debug flag.")
 
@@ -25,6 +27,10 @@ between '\\(' and '\\)' in regular expression.")
   "Get keyword from INFO."
   `(nth 3 ,info))
 
+(defmacro evilmi-sdk-get-char (position)
+  "Get character at POSITION."
+  `(char-after ,position))
+
 (defun evilmi-sdk-jump-forward-p ()
   "Return: (forward-direction font-face-under-cursor character-under-cursor).
 If font-face-under-cursor is NOT nil, the quoted string is being processed."
@@ -42,6 +48,107 @@ If font-face-under-cursor is NOT nil, the quoted string is 
being processed."
     (if evilmi-debug (message "evilmi-sdk-jump-forward-p => (%s %s %s)" rlt ff 
(string ch)))
     (list rlt ff ch)))
 
+(defun evilmi-sdk-the-other-quote-char (font-face is-forward char)
+  "The end character under cursor has different font from FONT-FACE."
+  (let* (rlt
+         got
+         (delta (if is-forward 1 -1))
+         (pos (+ delta (point)))
+         (end (if is-forward (point-max) (point-min))))
+    (while (not got)
+      (cond
+       ((or (= pos end)
+            (and (= char (evilmi-sdk-get-char (- pos delta)))
+                 (not (eq font-face (get-text-property pos 'face)))))
+        (setq rlt (if is-forward pos (+ 1 pos)))
+        (setq got t))
+       (t
+        (setq pos (+ delta pos)))))
+    (if evilmi-debug (message "evilmi-sdk-the-other-quote-char called Return: 
%s" rlt))
+    rlt))
+
+(defun evilmi-sdk-comment-p (pos)
+  "Check character at POS is comment by comparing font face."
+  (cond
+   ;; @see https://github.com/redguardtoo/evil-matchit/issues/92
+   ((eq major-mode 'tuareg-mode)
+    (evilmi-among-fonts-p pos '(font-lock-comment-face
+                                font-lock-comment-delimiter-face
+                                font-lock-doc-face)))
+   (t
+    (evilmi-among-fonts-p pos '(font-lock-comment-face
+                                font-lock-comment-delimiter-face)))))
+
+(defun evilmi-sdk-scan-sexps (is-forward)
+  "Get the position of matching tag.
+If IS-FORWARD is t, jump forward; or else jump backward."
+  (let* ((start-pos (if is-forward (point) (+ 1 (point))))
+         (arg (if is-forward 1 -1))
+         (limit (if is-forward (point-max) (point-min)))
+         (lvl 1)
+         (b (following-char))
+         (e (cond
+             ;; {}
+             ((= b 123) 125)
+             ((= b 125) 123)
+             ;; ()
+             ((= b 40) 41)
+             ((= b 41) 40)
+             ;; []
+             ((= b 91) 93)
+             ((= b 93) 91)))
+         (rlt start-pos))
+    (cond
+     ((evilmi-sdk-comment-p (point))
+      ;; Matching tag in comment.
+      ;; Use own algorithm instead of `scan-sexps'
+      ;; because `scan-sexps' not work in some major-mode
+      (save-excursion
+        (setq start-pos (point))
+        (while (and (not (= start-pos limit))
+                    (> lvl 0))
+          (goto-char (setq start-pos (+ start-pos arg)))
+          (when (evilmi-sdk-comment-p start-pos)
+            (cond
+             ((= (following-char) b)
+              (setq lvl (1+ lvl)))
+             ((= (following-char) e)
+              (setq lvl (1- lvl))))))
+        (when (= lvl 0)
+          (setq rlt (+ start-pos (if is-forward 1 0))))))
+     (t
+      ;; not comment
+      ;; search but ignore comments
+      (let* ((parse-sexp-ignore-comments t))
+        (setq rlt (scan-sexps start-pos arg)))))
+
+    (when evilmi-debug
+      (message "evilmi-sdk-scan-sexps => rlt=%s lvl=%s is-forward=%s" rlt lvl 
is-forward))
+    rlt))
+
+(defun evilmi-sdk-adjust-jumpto (is-forward rlt)
+  ;; normal-state hack!
+  (unless (eq evil-state 'visual)
+    (if is-forward (setq rlt (- rlt 1))))
+  (if evilmi-debug (message "evilmi-sdk-adjust-jumpto => %s" rlt))
+  rlt)
+
+;; @see 
http://emacs.stackexchange.com/questions/13222/a-elisp-function-to-jump-between-matched-pair
+(defun evilmi-sdk-jumpto-where (ff is-forward ch)
+  "Non-nil ff means jumping between quotes"
+  (let* ((rlt (if ff (evilmi-sdk-the-other-quote-char ff is-forward ch)
+                (evilmi-sdk-scan-sexps is-forward))))
+    (if evilmi-debug (message "evilmi-sdk-jumpto-where => %s" 
(evilmi-sdk-adjust-jumpto is-forward rlt)))
+    (evilmi-sdk-adjust-jumpto is-forward rlt)))
+
+(defun evilmi-sdk-tweak-selected-region (font-face jump-forward)
+  "Tweak selected region using FONT-FACE and JUMP-FORWARD."
+  ;; visual-state hack!
+  (when (and jump-forward (eq evil-state 'visual) (not font-face))
+    ;; if font-face is non-nil, I control the jump flow from character level,
+    ;; so hack to workaround scan-sexps is NOT necessary
+    (evil-backward-char)))
+
 (defun evilmi-sdk-simple-jump ()
   "Alternative for `evil-jump-item'."
   (if evilmi-debug (message "evilmi-sdk-simple-jump called (point)=%d" 
(point)))
@@ -51,8 +158,11 @@ If font-face-under-cursor is NOT nil, the quoted string is 
being processed."
          ;; so we should not use (scan-sexps)
          (ff (nth 1 tmp))
          (ch (nth 2 tmp)))
-    (goto-char (evilmi--find-position-to-jump ff jump-forward ch))
-    (evilmi--tweak-selected-region ff jump-forward)))
+    (goto-char (evilmi-sdk-jumpto-where ff jump-forward ch))
+    (evilmi-sdk-tweak-selected-region ff jump-forward)))
+
+(defmacro evilmi-sdk-strictly-type-p (crt orig)
+  `(or (evilmi-sdk-monogamy-p ,crt) (evilmi-sdk-monogamy-p ,orig)))
 
 (defun evilmi-sdk-tags-matched-p (level orig-tag-info cur-tag-info match-tags)
   (let* (rlt
@@ -65,8 +175,8 @@ If font-face-under-cursor is NOT nil, the quoted string is 
being processed."
     ;; handle function exit point
     (when (= 1 level)
       ;; end tag could be the same
-      (if (and (evilmi--is-strictly-type cur-tag-info orig-tag-info)
-               (not (evilmi--exactly-same-type cur-tag-info orig-tag-info)))
+      (if (and (evilmi-sdk-strictly-type-p cur-tag-info orig-tag-info)
+               (not (evilmi-sdk-exactly-same-type-p cur-tag-info 
orig-tag-info)))
           ;; just pass
           (setq rlt nil)
         (cond
@@ -81,20 +191,15 @@ If font-face-under-cursor is NOT nil, the quoted string is 
being processed."
     rlt))
 
 ;;;###autoload
-(defun evilmi-sdk-curline ()
-  (buffer-substring-no-properties
-   (line-beginning-position)
-   (line-end-position)))
+(defmacro evilmi-sdk-curline ()
+  `(buffer-substring-no-properties (line-beginning-position) 
(line-end-position)))
 
 ;;;###autoload
 (defun evilmi-sdk-member (keyword keyword-list)
   "Check if KEYWORD exist in KEYWORD-LIST."
   (let* (rlt)
     (cond
-     ((not keyword)
-      (setq rlt nil))
-
-     ((not keyword-list)
+     ((or (not keyword) (not keyword-list))
       (setq rlt nil))
 
      ((stringp keyword-list)
@@ -112,14 +217,15 @@ If font-face-under-cursor is NOT nil, the quoted string 
is being processed."
       ;; just ignore first element
       (setq rlt (evilmi-sdk-member keyword (cdr keyword-list)))))
 
-     (if (and evilmi-debug rlt) (message "evilmi-sdk-member called => %s %s. 
rlt=%s" keyword keyword-list rlt))
+    (when (and evilmi-debug rlt)
+      (message "evilmi-sdk-member called => %s %s. rlt=%s" keyword 
keyword-list rlt))
     rlt))
 
 
 ;;;###autoload
 (defun evilmi-sdk-get-tag-info (keyword match-tags)
   "Return (row column is-function-exit-point keyword).
-The row and column mark the position in evilmi-mylang-match-tags
+The row and column mark the position in `evilmi-mylang-match-tags'
 is-function-exit-point could be unknown status"
   (let* (rlt
          items
@@ -145,7 +251,7 @@ is-function-exit-point could be unknown status"
                           (nth 3 (nth i match-tags))
                           keyword))
         (setq rlt (list i j nil keyword))))
-  (if evilmi-debug (message "evilmi-sdk-get-tag-info called => %s %s. rlt=%s" 
keyword match-tags rlt))
+    (if evilmi-debug (message "evilmi-sdk-get-tag-info called => %s %s. 
rlt=%s" keyword match-tags rlt))
     rlt))
 
 (defun evilmi--sdk-check-keyword (keyword begin end)
@@ -177,27 +283,18 @@ Rule is looked up in HOWTOS."
                                     (line-beginning-position)
                                     (line-end-position)))))
 
-(defun evilmi--is-monogamy (tag-info)
-  (and (nth 2 tag-info) (string= (nth 2 tag-info) "MONOGAMY")))
-
-(defun evilmi--exactly-same-type (crt orig)
-  (= (nth 0 crt) (nth 0 orig)))
+(defmacro evilmi-sdk-monogamy-p (tag-info)
+  `(and (nth 2 ,tag-info) (string= (nth 2 ,tag-info) "MONOGAMY")))
 
-(defun evilmi--is-strictly-type (crt orig)
-  (or (evilmi--is-monogamy crt) (evilmi--is-monogamy orig)))
+(defmacro evilmi-sdk-exactly-same-type-p (crt orig)
+  `(= (nth 0 ,crt) (nth 0 ,orig)))
 
-(defun evilmi--same-type (crt orig)
-  (let* (rlt)
-    (if (and crt orig)
-        ;; crt and orig should be at same row if either of them is monogamy
-        (if (evilmi--is-strictly-type crt orig)
-            (setq rlt (evilmi--exactly-same-type crt orig))
-          (setq rlt t)))
-    rlt))
-
-(defmacro evilmi-sdk-get-char (position)
-  "Get character at POSITION."
-  `(char-after ,position))
+(defmacro evilmi-sdk-same-type (crt orig)
+  `(when (and ,crt ,orig)
+     ;; crt and orig should be at same row if either of them is monogamy
+     (if (evilmi-sdk-strictly-type-p ,crt ,orig)
+         (evilmi-sdk-exactly-same-type-p ,crt ,orig)
+       t)))
 
 ;;;###autoload
 (defun evilmi-sdk-get-tag (match-tags howtos)
@@ -239,7 +336,7 @@ after calling this function."
 
       (when keyword
         (setq cur-tag-info (evilmi-sdk-get-tag-info keyword match-tags))
-        (when (evilmi--same-type cur-tag-info orig-tag-info)
+        (when (evilmi-sdk-same-type cur-tag-info orig-tag-info)
           (setq cur-tag-type (nth 1 cur-tag-info))
 
           ;; key algorithm
diff --git a/evil-matchit-simple.el b/evil-matchit-simple.el
index 3a2808efe9..090361ac2d 100644
--- a/evil-matchit-simple.el
+++ b/evil-matchit-simple.el
@@ -32,6 +32,10 @@
 
 (require 'evil-matchit-sdk)
 
+(defvar evilmi-always-simple-jump nil
+  "`major-mode' like `python-mode' use optimized algorithm by default.
+If it's t, use simple jump.")
+
 (defun evilmi--simple-find-open-brace (cur-line)
   "Find open brace from CUR-LINE."
   (if evilmi-debug (message "evilmi--simple-find-open-brace called => 
cur-line=%s (point)=%d" cur-line (point)))
@@ -61,6 +65,27 @@
 
     rlt))
 
+(defun evilmi--char-is-simple (ch)
+  "Special handling of character CH for `python-mode'."
+  (cond
+   ((and (not evilmi-always-simple-jump)
+         (memq major-mode '(python-mode))
+         ;; in evil-visual-state, (point) could equal to (line-end-position)
+         (>= (point) (1- (line-end-position))))
+    ;; handle follow python code,
+    ;;
+    ;; if true:
+    ;;     a = "hello world"
+    ;;
+    ;; If current cursor is at end of line, rlt should be nil!
+    ;; or else, matching algorithm can't work in above python sample
+    nil)
+   (t
+    (or (memq ch evilmi-forward-chars)
+        (memq ch evilmi-backward-chars)
+        ;; sorry we could not jump between ends of string in python-mode
+        (memq ch evilmi-quote-chars)))))
+
 ;;;###autoload
 (defun evilmi-simple-get-tag ()
   "Get current tag in simple language."
diff --git a/evil-matchit.el b/evil-matchit.el
index 86e58d5316..7c11153dc9 100644
--- a/evil-matchit.el
+++ b/evil-matchit.el
@@ -43,12 +43,11 @@
 ;;
 ;; See https://github.com/redguardtoo/evil-matchit/ for help.
 ;;
-;; This program requires EVIL (http://gitorious.org/evil)
+;; This program requires EVIL (https://github.com/emacs-evil/evil)
 ;;
 
 ;;; Code:
 
-(require 'evil)
 (require 'evil-matchit-sdk)
 
 (defvar evilmi-plugins '(emacs-lisp-mode ((evilmi-simple-get-tag 
evilmi-simple-jump)))
@@ -63,132 +62,6 @@ If nil, `50%' jumps 50 times.")
   "The keybinding of `evilmi-jump-items' and then text object shortcut.
 Some people prefer using \"m\" instead.")
 
-(defvar evilmi-always-simple-jump nil
-  "`major-mode' like `python-mode' use optimized algorithm by default.
-If it's t, use simple jump.")
-
-(defun evilmi--char-is-simple (ch)
-  "Special handling of character CH for `python-mode'."
-  (cond
-   ((and (not evilmi-always-simple-jump)
-         (memq major-mode '(python-mode))
-         ;; in evil-visual-state, (point) could equal to (line-end-position)
-         (>= (point) (1- (line-end-position))))
-    ;; handle follow python code,
-    ;;
-    ;; if true:
-    ;;     a = "hello world"
-    ;;
-    ;; If current cursor is at end of line, rlt should be nil!
-    ;; or else, matching algorithm can't work in above python sample
-    nil)
-   (t
-    (or (memq ch evilmi-forward-chars)
-        (memq ch evilmi-backward-chars)
-        ;; sorry we could not jump between ends of string in python-mode
-        (memq ch evilmi-quote-chars)))))
-
-(defun evilmi-in-comment-p (pos)
-  "Check character at POS is comment by comparing font face."
-  (cond
-   ;; @see https://github.com/redguardtoo/evil-matchit/issues/92
-   ((eq major-mode 'tuareg-mode)
-    (evilmi-among-fonts-p pos '(font-lock-comment-face
-                                font-lock-comment-delimiter-face
-                                font-lock-doc-face)))
-   (t
-    (evilmi-among-fonts-p pos '(font-lock-comment-face
-                                font-lock-comment-delimiter-face)))))
-
-(defun evilmi--scan-sexps (is-forward)
-  "Get the position of matching tag.
-If IS-FORWARD is t, jump forward; or else jump backward."
-  (if evilmi-debug (message "evilmi--scan-sexps called => %s" is-forward))
-  (let* ((start-pos (if is-forward (point) (+ 1 (point))))
-         (arg (if is-forward 1 -1))
-         (limit (if is-forward (point-max) (point-min)))
-         (lvl 1)
-         (b (following-char))
-         (e (cond
-             ;; {}
-             ((= b 123) 125)
-             ((= b 125) 123)
-             ;; ()
-             ((= b 40) 41)
-             ((= b 41) 40)
-             ;; []
-             ((= b 91) 93)
-             ((= b 93) 91)))
-         (rlt start-pos))
-    (cond
-     ((evilmi-in-comment-p (point))
-      ;; Matching tag in comment.
-      ;; Use own algorithm instead of `scan-sexps'
-      ;; because `scan-sexps' not work in some major-mode
-      (save-excursion
-        (setq start-pos (point))
-        (while (and (not (= start-pos limit))
-                    (> lvl 0))
-          (goto-char (setq start-pos (+ start-pos arg)))
-          (when (evilmi-in-comment-p start-pos)
-            (cond
-             ((= (following-char) b)
-              (setq lvl (1+ lvl)))
-             ((= (following-char) e)
-              (setq lvl (1- lvl))))))
-        (when (= lvl 0)
-          (setq rlt (+ start-pos (if is-forward 1 0))))))
-     (t
-      ;; not comment
-      ;; search but ignore comments
-      (let* ((parse-sexp-ignore-comments t))
-        (setq rlt (scan-sexps start-pos arg)))))
-
-    (if evilmi-debug (message "evilmi--scan-sexps called => rlt=%s lvl=%s" rlt 
lvl))
-    rlt))
-
-(defun evilmi--find-the-other-quote-char (font-face is-forward char)
-  "The end character under cursor has different font from FONT-FACE."
-  (let* (rlt
-         got
-         (delta (if is-forward 1 -1))
-         (pos (+ delta (point)))
-         (end (if is-forward (point-max) (point-min))))
-    (while (not got)
-      (cond
-       ((or (= pos end)
-            (and (= char (evilmi-sdk-get-char (- pos delta)))
-                 (not (eq font-face (get-text-property pos 'face)))))
-        (setq rlt (if is-forward pos (+ 1 pos)))
-        (setq got t))
-       (t
-        (setq pos (+ delta pos)))))
-    (if evilmi-debug (message "evilmi--find-the-other-quote-char called 
Return: %s" rlt))
-    rlt))
-
-(defun evilmi--adjust-jumpto (is-forward rlt)
-  ;; normal-state hack!
-  (unless (eq evil-state 'visual)
-    (if is-forward (setq rlt (- rlt 1))))
-  (if evilmi-debug (message "evilmi--adjust-jumpto called. Return: %s" rlt))
-  rlt)
-
-;; @see 
http://emacs.stackexchange.com/questions/13222/a-elisp-function-to-jump-between-matched-pair
-(defun evilmi--find-position-to-jump (ff is-forward ch)
-  "Non-nil ff means jumping between quotes"
-  (let* ((rlt (if ff (evilmi--find-the-other-quote-char ff is-forward ch)
-                (evilmi--scan-sexps is-forward))))
-    (if evilmi-debug (message "evilmi--find-position-to-jump => %s" 
(evilmi--adjust-jumpto is-forward rlt)))
-    (evilmi--adjust-jumpto is-forward rlt)))
-
-(defun evilmi--tweak-selected-region (font-face jump-forward)
-  "Tweak selected region using FONT-FACE and JUMP-FORWARD."
-  ;; visual-state hack!
-  (when (and jump-forward (eq evil-state 'visual) (not font-face))
-    ;; if font-face is non-nil, I control the jump flow from character level,
-    ;; so hack to workaround scan-sexps is NOT necessary
-    (evil-backward-char)))
-
 (defun evilmi--operate-on-item (num &optional func)
   "Jump NUM times and apply function FUNC."
   (when evilmi-debug
@@ -231,24 +104,28 @@ If IS-FORWARD is t, jump forward; or else jump backward."
     ideal-dest))
 
 (defun evilmi--push-mark (rlt)
-    (push-mark (nth 0 rlt) t t))
+  (push-mark (nth 0 rlt) t t))
+
+(defun evilmi--convert-rules (rules)
+  "Convert RULES to function pairs list."
+  (let* (rlt)
+    (dolist (rule rules)
+      (let* ((rule-filename (concat "evil-matchit-" (symbol-name rule)))
+             (fn-prefix (concat "evilmi-" (symbol-name rule)))
+             (get-tag-function (intern (concat fn-prefix "-get-tag")))
+             (jump-function (intern (concat fn-prefix "-jump"))))
+        (autoload get-tag-function rule-filename nil)
+        (autoload jump-function rule-filename nil)
+        (push (list get-tag-function jump-function) rlt)))
+    (nreverse rlt)))
 
 ;;;###autoload
 (defun evilmi-load-plugin-rules(modes rules)
   "Load MODES's plugin RULES."
   (dolist (mode modes)
-    (setq evilmi-plugins
-          (plist-put evilmi-plugins
-                     mode
-                     (mapcar (lambda (rule)
-                               (let* ((rule-filename (concat "evil-matchit-" 
(symbol-name rule)))
-                                      (fn-prefix (concat "evilmi-" 
(symbol-name rule)))
-                                      (get-tag-function (intern (concat 
fn-prefix "-get-tag")))
-                                      (jump-function (intern (concat fn-prefix 
"-jump"))))
-                                 (autoload get-tag-function rule-filename nil)
-                                 (autoload jump-function rule-filename nil)
-                                 (list get-tag-function jump-function)))
-                             rules)))))
+    (setq evilmi-plugins (plist-put evilmi-plugins
+                                    mode
+                                    (evilmi--convert-rules rules)))))
 
 ;;;###autoload
 (defun evilmi-init-plugins ()
@@ -335,7 +212,7 @@ If IS-FORWARD is t, jump forward; or else jump backward."
 (defun evilmi--region-to-select-or-delete (num &optional is-inner)
   (let* (ideal-dest b e)
     (save-excursion
-      (setq ideal-dest (evilmi--operate-on-item num 'evilmi--push-mark))
+      (setq ideal-dest (evilmi--operate-on-item num #'evilmi--push-mark))
       (if ideal-dest (goto-char ideal-dest))
       (setq b (region-beginning))
       (setq e (region-end))



reply via email to

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