summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2024-09-07 14:02:38 +0200
committerJonas Bernoulli <jonas@bernoul.li>2024-09-07 14:02:38 +0200
commit0b881ab4542e3b900bfbeec811fa0c932be2ea29 (patch)
treea9ed6fb23ed98ae979c3fcf5e47a435455a913f5
parent732389e3886b510c2661d7d4fd65e01837211e8a (diff)
llama--collect: Fix return value for dotted lists
Previously only the last cons-cell was returned. Now the expression is returned unchanged. That means that we still do not remove explicit unused arguments from the returned value. As before these have to be placed elsewhere.
-rw-r--r--llama.el14
1 files changed, 7 insertions, 7 deletions
diff --git a/llama.el b/llama.el
index c4831c0..d5a437a 100644
--- a/llama.el
+++ b/llama.el
@@ -203,13 +203,13 @@ this trickery, you can alternatively use this macro under the name
(list symbol))))
expr))
((listp expr)
- (while (consp (cdr expr))
- (llama--collect (car expr) args)
- (setq expr (cdr expr)))
- (when expr
- (llama--collect (car expr) args)
- (llama--collect (cdr expr) args))
- expr)
+ (prog1 expr
+ (while (consp (cdr expr))
+ (llama--collect (car expr) args)
+ (setq expr (cdr expr)))
+ (when expr
+ (llama--collect (car expr) args)
+ (llama--collect (cdr expr) args))))
((vectorp expr)
(vconcat (mapcar (lambda (elt) (llama--collect elt args)) expr)))
(expr)))