diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 58bcdd52ac..52d946a0c0 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2092,6 +2092,21 @@ except that it additionally expands symbol macros." (car exp)) ,(nreverse nbs) ,@body))))) + (`(function (lambda . ,(or `(,params . ,body) _dontcare))) + (let (found nbs) + (dolist (param params) + (let* ((sm (assq param env))) + (push (if (not (cdr sm)) + param + (let ((nexp (cadr sm))) + (setq found t) + (unless (symbolp nexp) (error "FIXME")) + nexp)) + nbs))) + (when found + (setq exp `(function (lambda + ,(nreverse nbs) + ,@body)))))) ;; FIXME: The behavior of CL made sense in a dynamically scoped ;; language, but for lexical scoping, Common-Lisp's behavior might ;; make more sense (and indeed, CL behaves like Common-Lisp w.r.t