diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2023-11-29 17:51:46 +0100 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2023-11-30 11:31:09 +0100 |
commit | 8525be6d5eca0c75008ec1dc799cae537156feea (patch) | |
tree | f9bb78a98e79fe848aec3148dac5c67818352f48 /lisp/emacs-lisp/cconv.el | |
parent | e87644baa3239ce57a5620d3d38352acc1113fa4 (diff) | |
download | emacs-8525be6d5eca0c75008ec1dc799cae537156feea.tar.gz emacs-8525be6d5eca0c75008ec1dc799cae537156feea.tar.bz2 emacs-8525be6d5eca0c75008ec1dc799cae537156feea.zip |
Move malformed-function warning from byte-opt to cconv (bug#67483)
We shouldn't be warning inside the optimiser in the first place.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form):
Remove byte-compile-form-stack manipulation.
(byte-optimize-form-code-walker): Move malformed function warning
from here...
* lisp/emacs-lisp/cconv.el: ...to here.
Diffstat (limited to 'lisp/emacs-lisp/cconv.el')
-rw-r--r-- | lisp/emacs-lisp/cconv.el | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el index 3e75020a013..e65c39e3998 100644 --- a/lisp/emacs-lisp/cconv.el +++ b/lisp/emacs-lisp/cconv.el @@ -615,11 +615,15 @@ places where they originally did not directly appear." (cconv-convert exp env extend)) (`(,func . ,forms) - ;; First element is function or whatever function-like forms are: or, and, - ;; if, catch, progn, prog1, while, until - `(,func . ,(mapcar (lambda (form) - (cconv-convert form env extend)) - forms))) + (if (symbolp func) + ;; First element is function or whatever function-like forms are: + ;; or, and, if, catch, progn, prog1, while, until + `(,func . ,(mapcar (lambda (form) + (cconv-convert form env extend)) + forms)) + (macroexp--warn-wrap form (format-message "Malformed function `%S'" + (car form)) + nil nil))) (_ (or (cdr (assq form env)) form)))) |