]> git.eshelyaron.com Git - emacs.git/commit
Warn about misplaced or duplicated function/macro declarations
authorMattias Engdegård <mattiase@acm.org>
Fri, 17 Jun 2022 15:06:05 +0000 (17:06 +0200)
committerMattias Engdegård <mattiase@acm.org>
Fri, 17 Jun 2022 15:25:29 +0000 (17:25 +0200)
commit73e75e18d170826e1838324d39ac0698948071f8
tree7ef1b3359cdb6ad2f78c4a90c05e8063384ea0bb
parente9c50055ff989a670d024045aba0050371a28fef
Warn about misplaced or duplicated function/macro declarations

Doc strings, `declare` and `interactive` forms must appear in that
order and at most once each.  Complain if they don't, instead of
silently ignoring the problem (bug#55905).

* lisp/emacs-lisp/byte-run.el (byte-run--parse-body)
(byte-run--parse-declarations): New.
(defmacro, defun): Check for declaration well-formedness as
described above.  Clarify doc strings.  Refactor some common code.
* test/lisp/emacs-lisp/bytecomp-resources/fun-attr-warn.el:
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-fun-attr-warn):
New test.
lisp/emacs-lisp/byte-run.el
test/lisp/emacs-lisp/bytecomp-resources/fun-attr-warn.el [new file with mode: 0644]
test/lisp/emacs-lisp/bytecomp-tests.el