]> git.eshelyaron.com Git - emacs.git/commitdiff
Warn about meta-calls with constant arguments
authorEshel Yaron <me@eshelyaron.com>
Fri, 15 Nov 2024 10:59:20 +0000 (11:59 +0100)
committerEshel Yaron <me@eshelyaron.com>
Fri, 15 Nov 2024 10:59:20 +0000 (11:59 +0100)
lisp/emacs-lisp/bytecomp.el

index b9b62040b5d1710b1efb36c8f10417aa9820d259..e7a63b97ac46a5988c17b504074f2fb07e99213c 100644 (file)
@@ -6073,6 +6073,15 @@ and corresponding effects."
             :use-external-socket)
           '(:name :service))))
 
+(defun bytecomp--check-funcall-args (form &optional f &rest _args)
+  (pcase f
+    (`(,(or 'function 'quote) ,(pred symbolp))
+     (byte-compile-warn-x form "meta-call with constant argument.")))
+  form)
+
+(dolist (f '(funcall call-interactively funcall-interactively))
+  (put f 'compiler-macro #'bytecomp--check-funcall-args))
+
 (provide 'byte-compile)
 (provide 'bytecomp)