From 73d169c7db36e8144b2766532181a57ff146bc11 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 2 Dec 2022 19:15:46 -0500 Subject: [PATCH] * lisp/emacs-lisp/cl-macs.el (cl-flet): Optimize a bit more Also optimize the case where we use `cl-flet` to introduce a local alias. --- lisp/emacs-lisp/cl-macs.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 43a2ed92059..95e78ceab6a 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2052,7 +2052,8 @@ info node `(cl) Function Bindings' for details. (dolist (binding bindings) (let ((var (make-symbol (format "--cl-%s--" (car binding)))) (args-and-body (cdr binding))) - (if (and (= (length args-and-body) 1) (symbolp (car args-and-body))) + (if (and (= (length args-and-body) 1) + (macroexp-copyable-p (car args-and-body))) ;; Optimize (cl-flet ((fun var)) body). (setq var (car args-and-body)) (push (list var (if (= (length args-and-body) 1) -- 2.39.2