]> git.eshelyaron.com Git - emacs.git/commit
Add byte-compiler warning about useless trailing cond clauses
authorMattias Engdegård <mattiase@acm.org>
Sat, 9 Sep 2023 11:04:54 +0000 (13:04 +0200)
committerMattias Engdegård <mattiase@acm.org>
Sat, 9 Sep 2023 11:24:31 +0000 (13:24 +0200)
commitc137b5195b633c5c931c35385fdb3e75b9ee5f09
treee2e8b16188c6dc032570d9429f9971ba36d86c91
parent176b7dad71ee92aeab7cdc75db8a5d4f9648fb54
Add byte-compiler warning about useless trailing cond clauses

Warn about clauses after the default clause, as in

    (cond ((= x 0) (say "none"))
          (t (say "some"))
          (say "goodbye"))

because they are very much an indicator of a mistake (such as
misplaced brackets), and since they are deleted by the optimiser, any
other warnings there are lost and the user wouldn't know that
something is wrong otherwise.

* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Add warning.
* etc/NEWS: Announce.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test--with-suppressed-warnings): Add test case.
etc/NEWS
lisp/emacs-lisp/macroexp.el
test/lisp/emacs-lisp/bytecomp-tests.el