Sorry it took so long; Emacs build broke several times, an on top of that Org is having some tectonic changes as well, and I've had my own time trouble. I tried the following patch. Stefan Monnier writes: > But that's a very minor cosmetic detail. Either way works, I was just > curious why you did it this way. > > > Stefan > > > diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el > index 1852471bcbb..ad0477e3b68 100644 > --- a/lisp/emacs-lisp/cl-macs.el > +++ b/lisp/emacs-lisp/cl-macs.el > @@ -2030,7 +2030,10 @@ cl-flet > (let ((binds ()) (newenv macroexpand-all-environment)) > (dolist (binding bindings) > (let ((var (make-symbol (format "--cl-%s--" (car binding)))) > + (fname (car binding)) > (args-and-body (cdr binding))) > + (if (eq (car-safe fname) 'setf) > + (setq fname (gv-setter (cadr fname)))) > (if (and (= (length args-and-body) 1) (symbolp (car args-and-body))) > ;; Optimize (cl-flet ((fun var)) body). > (setq var (car args-and-body)) > @@ -2038,7 +2041,7 @@ cl-flet > (car args-and-body) > `(cl-function (lambda . ,args-and-body)))) > binds)) > - (push (cons (car binding) > + (push (cons fname > (lambda (&rest args) > (if (eq (car args) cl--labels-magic) > (list cl--labels-magic var) Four of my tests failed which did pass for the solution I've proposed. The first case is not even supported with global functions in Elisp so I'm not sure how relevant it is. Here are the summaries; the rest (results vs expected, some comments) is attached. I've received some complaints about my usage of Org markup in the mailing list so details are omitted from the mail body. ** TEST-FAILED setf with #'(setf ..) in body ** TEST-FAILED non-setf local function within (setf ..) local function ** TEST-FAILED Local setf function within local non-setf function within local setf function ** TEST-FAILED Eponymous local macro, local function and its setf, local macro, local function