1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

bytecomp.el: Warn for `,' not within backquote construct

(bytecomp--report-comma): New function with `compiler-macro' property.
This commit is contained in:
Richard M Stallman 2024-02-03 17:47:02 -05:00 committed by Richard Stallman
parent d41cdceb13
commit b0049c942b

View file

@ -5742,6 +5742,16 @@ and corresponding effects."
(eval form)
form)))
;; Report comma operator used outside of backquote.
;; Inside backquote, backquote will transform it before it gets here.
(put '\, 'compiler-macro #'bytecomp--report-comma)
(defun bytecomp--report-comma (form &rest _ignore)
(macroexp-warn-and-return
(format-message "`%s' called -- perhaps used not within backquote"
(car form))
form (list 'suspicious (car form)) t))
;; Check for (in)comparable constant values in calls to `eq', `memq' etc.
(defun bytecomp--dodgy-eq-arg-p (x number-ok)