Fix #3610: revert changes to cmd!! macro

Half-reverts e6c88e4384
This commit is contained in:
Henrik Lissner 2020-07-22 17:09:38 -04:00
parent 5923208c2c
commit 9073a5d402
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 5 additions and 4 deletions

View file

@ -251,13 +251,14 @@ or aliases."
(declare (doc-string 1) (pure t) (side-effect-free t))
`(lambda (&rest _) (interactive) ,@body))
(defmacro cmd!! (command &rest args)
(defmacro cmd!! (command &optional prefix-arg &rest args)
"Expands to a closure that interactively calls COMMAND with ARGS.
A factory for quickly producing interactive, prefixed commands for keybinds or
aliases."
(declare (doc-string 1) (pure t) (side-effect-free t))
`(lambda (&rest _) (interactive)
(funcall-interactively ,command ,@args)))
`(lambda (arg &rest _) (interactive "P")
(let ((current-prefix-arg (or ,prefix-arg arg)))
(funcall-interactively ,command ,@args))))
(defmacro cmds! (&rest branches)
"Expands to a `menu-item' dispatcher for keybinds."