summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2024-10-03 21:06:02 +0200
committerJonas Bernoulli <jonas@bernoul.li>2024-10-03 21:06:02 +0200
commitad20e98b6b98ccd6dbdd02217a839b61a01fcdde (patch)
treec6de504f10697133c4e525564be763a3b4edfde6
parentf76edf2745f9ea5b08fb3d999c1f27ff42fe98aa (diff)
llama--{collect,fontify}: Stop at nested llama expression
-rw-r--r--llama-test.el4
-rw-r--r--llama.el4
2 files changed, 6 insertions, 2 deletions
diff --git a/llama-test.el b/llama-test.el
index 1ba4f6c..79cbabf 100644
--- a/llama-test.el
+++ b/llama-test.el
@@ -387,6 +387,10 @@
(should (equal (llama list %1 %2)
(lambda (%1 %2)
(list %1 %2))))
+
+ (should (equal (llama list %1 (llama list %))
+ (lambda (%1)
+ (list %1 (lambda (%) (list %))))))
)
(ert-deftest llama-test-901-errors-first nil
diff --git a/llama.el b/llama.el
index 56441ac..27bf743 100644
--- a/llama.el
+++ b/llama.el
@@ -185,7 +185,7 @@ to view this docstring.)"
(defun llama--collect (expr args &optional fnpos backquoted)
(cond
- ((memq (car-safe expr) '(## quote)) expr)
+ ((memq (car-safe expr) '(## llama quote)) expr)
((and backquoted (symbolp expr)) expr)
((and backquoted (eq (car-safe expr) backquote-unquote-symbol))
(cons backquote-unquote-symbol
@@ -395,7 +395,7 @@ expansion, and the looks of this face should hint at that.")
(cond
((eq (car-safe expr) 'quote))
((eq (ignore-errors (bare-symbol (car-safe expr))) 'quote))
- ((and (eq (car-safe expr) '##) (not top)))
+ ((and (memq (car-safe expr) '(## llama)) (not top)))
((and backquoted (symbol-with-pos-p expr)))
((and backquoted (eq (car-safe expr) backquote-unquote-symbol))
(llama--fontify expr))