summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/cl-macs.el16
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 14e4d2da0c8..299cffc83aa 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -1886,13 +1886,15 @@ This is like `cl-flet', but for macros instead of functions.
cl-declarations body)))
(if (cdr bindings)
`(cl-macrolet (,(car bindings)) (cl-macrolet ,(cdr bindings) ,@body))
- (if (null bindings) (cons 'progn body)
- (let* ((name (caar bindings))
- (res (cl--transform-lambda (cdar bindings) name)))
- (eval (car res))
- (macroexpand-all (cons 'progn body)
- (cons (cons name `(lambda ,@(cdr res)))
- macroexpand-all-environment))))))
+ (let ((progn-maybe (lambda (body)
+ (if (cdr body) (cons 'progn body) (car body)))))
+ (if (null bindings) (funcall progn-maybe body)
+ (let* ((name (caar bindings))
+ (res (cl--transform-lambda (cdar bindings) name)))
+ (eval (car res))
+ (macroexpand-all (funcall progn-maybe body)
+ (cons (cons name `(lambda ,@(cdr res)))
+ macroexpand-all-environment)))))))
(defconst cl--old-macroexpand
(if (and (boundp 'cl--old-macroexpand)