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

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

[elpa] master 4d381cb 4/9: Add macroexp-let2 support.


From: Jackson Ray Hamilton
Subject: [elpa] master 4d381cb 4/9: Add macroexp-let2 support.
Date: Fri, 13 Nov 2015 05:39:53 +0000

branch: master
commit 4d381cb672b56dd98b20e8cfeaac293c2477a17e
Author: Jackson Ray Hamilton <address@hidden>
Commit: Jackson Ray Hamilton <address@hidden>

    Add macroexp-let2 support.
---
 context-coloring.el            |   24 ++++++++++++++++++++++++
 test/context-coloring-test.el  |   10 ++++++++++
 test/fixtures/macroexp-let2.el |    6 ++++++
 3 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/context-coloring.el b/context-coloring.el
index 3010739..55d57ee 100644
--- a/context-coloring.el
+++ b/context-coloring.el
@@ -815,6 +815,29 @@ Parsing the header with CALLBACK."
    (lambda ()
      (context-coloring-elisp-parse-let-varlist 'let*))))
 
+(defun context-coloring-elisp-colorize-macroexp-let2 ()
+  "Color the `macroexp-let2' at point."
+  (let (syntax-code
+        variable)
+    (context-coloring-elisp-colorize-scope
+     (lambda ()
+       (and
+        (progn
+          (setq syntax-code (context-coloring-get-syntax-code))
+          (context-coloring-elisp-identifier-p syntax-code))
+        (progn
+          (context-coloring-elisp-colorize-sexp)
+          (context-coloring-elisp-forward-sws)
+          (setq syntax-code (context-coloring-get-syntax-code))
+          (context-coloring-elisp-identifier-p syntax-code))
+        (progn
+          (context-coloring-elisp-parse-bindable
+           (lambda (parsed-variable)
+             (setq variable parsed-variable)))
+          (context-coloring-elisp-forward-sws)
+          (when variable
+            (context-coloring-elisp-add-variable variable))))))))
+
 (defun context-coloring-elisp-colorize-cond ()
   "Color the `cond' at point."
   (let (syntax-code)
@@ -933,6 +956,7 @@ Parsing the header with CALLBACK."
     (dolist (callee '("let" "gv-letplace"))
       (puthash callee #'context-coloring-elisp-colorize-let table))
     (puthash "let*" #'context-coloring-elisp-colorize-let* table)
+    (puthash "macroexp-let2" #'context-coloring-elisp-colorize-macroexp-let2 
table)
     (puthash "lambda" #'context-coloring-elisp-colorize-lambda table)
     (puthash "cond" #'context-coloring-elisp-colorize-cond table)
     (puthash "defadvice" #'context-coloring-elisp-colorize-defadvice table)
diff --git a/test/context-coloring-test.el b/test/context-coloring-test.el
index fc79f7b..0a1f88e 100644
--- a/test/context-coloring-test.el
+++ b/test/context-coloring-test.el
@@ -775,6 +775,16 @@ ssssssssssss0"))
   1111 1 1 1 0 0 000011"))
   :fixture "let-star.el")
 
+(context-coloring-test-deftest-emacs-lisp macroexp-let2
+  (lambda ()
+    (context-coloring-test-assert-coloring "
+1111 11111
+  222222222-2222 00000000-00000000-0 2 111
+    2 11121
+
+(11111111-1111 00000000-00000000-0)
+(11111111-1111)")))
+
 (context-coloring-test-deftest-emacs-lisp cond
   (lambda ()
     (context-coloring-test-assert-coloring "
diff --git a/test/fixtures/macroexp-let2.el b/test/fixtures/macroexp-let2.el
new file mode 100644
index 0000000..1b61df2
--- /dev/null
+++ b/test/fixtures/macroexp-let2.el
@@ -0,0 +1,6 @@
+(let (exp)
+  (macroexp-let2 macroexp-copyable-p v exp
+    v exp))
+
+(macroexp-let2 macroexp-copyable-p)
+(macroexp-let2)



reply via email to

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