diff --git a/core/core-lib.el b/core/core-lib.el index 8f81997c5..ad87697d9 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -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." diff --git a/modules/lang/common-lisp/config.el b/modules/lang/common-lisp/config.el index 7eaa753d6..45d4dbe34 100644 --- a/modules/lang/common-lisp/config.el +++ b/modules/lang/common-lisp/config.el @@ -89,7 +89,7 @@ (:localleader :map lisp-mode-map :desc "Sly" "'" #'sly - :desc "Sly (ask)" ";" (λ!! #'sly '-) + :desc "Sly (ask)" ";" (cmd!! #'sly '-) :desc "Expand macro" "m" #'macrostep-expand (:prefix ("c" . "compile") :desc "Compile file" "c" #'sly-compile-file