From: Mattias EngdegÄrd Date: Wed, 18 Jan 2023 16:30:15 +0000 (+0100) Subject: Better lambda quote warning X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1b52eaa190663756e79f44c02e7388ee53e756b2;p=emacs.git Better lambda quote warning * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Avoid `...` shown backslash-escaped as a symbol, and render an empty argument list as `()` instead of `nil`. --- diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index 069adb3edad..c909ffb6933 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -458,12 +458,13 @@ Assumes the caller has bound `macroexpand-all-environment'." (let ((arg (nth funarg form))) (when (and (eq 'quote (car-safe arg)) (eq 'lambda (car-safe (cadr arg)))) - (setcar (nthcdr funarg form) - (macroexp-warn-and-return - (format "%S quoted with ' rather than with #'" - (let ((f (cadr arg))) - (if (symbolp f) f `(lambda ,(nth 1 f) ...)))) - arg nil nil (cadr arg)))))) + (setcar + (nthcdr funarg form) + (macroexp-warn-and-return + (format + "(lambda %s ...) quoted with ' rather than with #'" + (or (nth 1 (cadr arg)) "()")) + arg nil nil (cadr arg)))))) ;; Macro expand compiler macros. This cannot be delayed to ;; byte-optimize-form because the output of the compiler-macro can ;; use macros.