May specify an argument to simple commands
This commit is contained in:
parent
e650be5d5b
commit
dcdeeb8ead
1 changed files with 4 additions and 2 deletions
6
empc.el
6
empc.el
|
|
@ -185,10 +185,12 @@ If the stream process is killed for whatever the reason, pause mpd if possible."
|
|||
|
||||
(defmacro empc-define-simple-command (command)
|
||||
"Define a simple command that doesn't require heavy response processing."
|
||||
`(defun ,(intern (concat "empc-send-" command)) ()
|
||||
`(defun ,(intern (concat "empc-send-" command)) (&optional arg)
|
||||
,(concat "Send " command " to the server.")
|
||||
(interactive)
|
||||
(empc-send ,command)))
|
||||
(if arg
|
||||
(empc-send (concat ,(concat command " ") arg))
|
||||
(empc-send ,command))))
|
||||
|
||||
(empc-define-simple-command "play")
|
||||
(empc-define-simple-command "stop")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue