From: Eshel Yaron Date: Fri, 15 Nov 2024 10:59:20 +0000 (+0100) Subject: Warn about meta-calls with constant arguments X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4e4588ab2e6931a39c98e7f928f211553c832033;p=emacs.git Warn about meta-calls with constant arguments --- diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index b9b62040b5d..e7a63b97ac4 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -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)