parent
5923208c2c
commit
9073a5d402
2 changed files with 5 additions and 4 deletions
|
@ -251,13 +251,14 @@ or aliases."
|
||||||
(declare (doc-string 1) (pure t) (side-effect-free t))
|
(declare (doc-string 1) (pure t) (side-effect-free t))
|
||||||
`(lambda (&rest _) (interactive) ,@body))
|
`(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.
|
"Expands to a closure that interactively calls COMMAND with ARGS.
|
||||||
A factory for quickly producing interactive, prefixed commands for keybinds or
|
A factory for quickly producing interactive, prefixed commands for keybinds or
|
||||||
aliases."
|
aliases."
|
||||||
(declare (doc-string 1) (pure t) (side-effect-free t))
|
(declare (doc-string 1) (pure t) (side-effect-free t))
|
||||||
`(lambda (&rest _) (interactive)
|
`(lambda (arg &rest _) (interactive "P")
|
||||||
(funcall-interactively ,command ,@args)))
|
(let ((current-prefix-arg (or ,prefix-arg arg)))
|
||||||
|
(funcall-interactively ,command ,@args))))
|
||||||
|
|
||||||
(defmacro cmds! (&rest branches)
|
(defmacro cmds! (&rest branches)
|
||||||
"Expands to a `menu-item' dispatcher for keybinds."
|
"Expands to a `menu-item' dispatcher for keybinds."
|
||||||
|
|
|
@ -89,7 +89,7 @@
|
||||||
(:localleader
|
(:localleader
|
||||||
:map lisp-mode-map
|
:map lisp-mode-map
|
||||||
:desc "Sly" "'" #'sly
|
:desc "Sly" "'" #'sly
|
||||||
:desc "Sly (ask)" ";" (λ!! #'sly '-)
|
:desc "Sly (ask)" ";" (cmd!! #'sly '-)
|
||||||
:desc "Expand macro" "m" #'macrostep-expand
|
:desc "Expand macro" "m" #'macrostep-expand
|
||||||
(:prefix ("c" . "compile")
|
(:prefix ("c" . "compile")
|
||||||
:desc "Compile file" "c" #'sly-compile-file
|
:desc "Compile file" "c" #'sly-compile-file
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue