emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 1b52eaa190 1/2: Better lambda quote warning


From: Mattias Engdegård
Subject: master 1b52eaa190 1/2: Better lambda quote warning
Date: Wed, 18 Jan 2023 13:16:31 -0500 (EST)

branch: master
commit 1b52eaa190663756e79f44c02e7388ee53e756b2
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    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`.
---
 lisp/emacs-lisp/macroexp.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
index 069adb3eda..c909ffb693 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]