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

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

[nongnu] elpa/evil-matchit a344ac8e49: add more debugging code to ocaml


From: ELPA Syncer
Subject: [nongnu] elpa/evil-matchit a344ac8e49: add more debugging code to ocaml algorithm
Date: Fri, 3 Jun 2022 04:58:14 -0400 (EDT)

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

    add more debugging code to ocaml algorithm
---
 evil-matchit-ocaml.el | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/evil-matchit-ocaml.el b/evil-matchit-ocaml.el
index af9dc53dd8..c71cf6f400 100644
--- a/evil-matchit-ocaml.el
+++ b/evil-matchit-ocaml.el
@@ -1,4 +1,4 @@
-;;; evil-matchit-ocaml.el -- tuareg-mode  plugin of evil-matchit
+;;; evil-matchit-ocaml.el -- tuareg-mode  plugin of evil-matchit -*- 
lexical-binding: t -*-
 
 ;; Copyright (C) 2014-2020 Chen Bin
 
@@ -96,12 +96,12 @@ such keyword is available."
   "Get keyword assuming we're at the begging of it"
   (buffer-substring-no-properties (point) (evilmi-ocaml-end-word)))
 
-(defun evilmi-ocaml-is-keyword (l keyword)
-  "Checks if the keyword belongs to a row."
-  (cl-find-if (lambda (w) (string= w keyword)) (apply 'append l)))
+(defun evilmi-ocaml-is-keyword (row keyword)
+  "Check if the KEYWORD belongs to a ROW."
+  (cl-find-if (lambda (w) (string= w keyword)) (apply 'append row)))
 
 (defun evilmi-ocaml-get-tag-info (keyword)
-  "Find the row in the evilmi-ocaml-keywords."
+  "Find the row in the `evilmi-ocaml-keywords' by KEYWORD."
   (cl-find-if (lambda (l) (evilmi-ocaml-is-keyword l keyword)) 
evilmi-ocaml-keywords))
 
 ;; 0 - forward
@@ -130,17 +130,24 @@ such keyword is available."
   "Return information of current tag: (list position-of-word word)."
   (save-excursion
     (evilmi-ocaml-goto-word-beginning)
-    (list (point) (evilmi-ocaml-get-word))))
+    (let* ((rlt (list (point) (evilmi-ocaml-get-word))))
+      (when evilmi-debug
+        (message "evilmi-ocaml-get-tag called => %s" rlt))
+      rlt)))
 
 ;;;###autoload
 (defun evilmi-ocaml-jump (rlt num)
+  (ignore num)
   (let* ((keyword (cadr rlt))
          (tag-info (evilmi-ocaml-get-tag-info keyword))
          (direction (if (member keyword (car tag-info)) 0 1)))
-    (if tag-info
+    (when evilmi-debug
+      (message "evilmi-ocaml-jump called => direction=%s, tag-info=%s, 
keyword=%s" direction tag-info keyword))
+    (when tag-info
         (let ((new-point (save-excursion
                            (evilmi-ocaml-goto-word-beginning)
                            (evilmi-ocaml-go tag-info 1 direction))))
           (if new-point (goto-char new-point))))))
 
 (provide 'evil-matchit-ocaml)
+;;; evil-matchit-ocaml.el ends here
\ No newline at end of file



reply via email to

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