From 9073a5d4028d2b0939f166057621f0f24739439c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 22 Jul 2020 17:09:38 -0400 Subject: [PATCH] Fix #3610: revert changes to cmd!! macro Half-reverts e6c88e4384d5 --- core/core-lib.el | 7 ++++--- modules/lang/common-lisp/config.el | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) 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