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:
parent
d41cdceb13
commit
b0049c942b
1 changed files with 10 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue