Subject: 28.0.50; (declare (modes ...)) does not have an effect

From: Daniel Mendler <[email-masked]>
Date: Wed, 14 Jul 2021 19:13:46 +0200

Has this feature already been implemented?

Test case:

(defun test-cmd1 () ; works
  (interactive nil test-mode))
(command-modes #'test-cmd1) ; evaluates to (test-mode)

(defun test-cmd2 () ; does not work
  (interactive)
  (declare (modes test-mode)))
(command-modes #'test-cmd2) ; evaluates to nil

In GNU Emacs 28.0.50 (build 28, x86_64-pc-linux-gnu, GTK+ Version
3.24.5, cairo version 1.16.0)
 of 2021-07-14 built on projects
Repository revision: 42b8edfdb9096af7010609fd8890c76bc3918873
Repository branch: HEAD
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux 10 (buster)