Add λ!! (lambda!!) macro
For quick inline commands for keybinds that simply call a command (interactively) with a prefix argument.
This commit is contained in:
parent
e146cba00e
commit
c3c282f0a4
1 changed files with 8 additions and 0 deletions
|
@ -157,7 +157,15 @@ Accepts the same arguments as `message'."
|
|||
(declare (doc-string 1))
|
||||
`(lambda () (interactive) ,@body))
|
||||
|
||||
(defmacro λ!! (command &optional arg)
|
||||
"Expands to a command that interactively calls COMMAND with prefix ARG."
|
||||
(declare (doc-string 1))
|
||||
`(lambda () (interactive)
|
||||
(let ((current-prefix-arg ,arg))
|
||||
(call-interactively ,command))))
|
||||
|
||||
(defalias 'lambda! 'λ!)
|
||||
(defalias 'lambda!! 'λ!!)
|
||||
|
||||
(defmacro pushnew! (place &rest values)
|
||||
"Like `cl-pushnew', but will prepend VALUES to PLACE.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue