Don't try to send a command if we know it isn't available
This commit is contained in:
parent
48a87e927c
commit
cd4eabe65f
1 changed files with 7 additions and 4 deletions
11
empc.el
11
empc.el
|
|
@ -670,10 +670,13 @@ Send the password or retrieve available commands."
|
||||||
"Send COMMAND to the mpd server.
|
"Send COMMAND to the mpd server.
|
||||||
CLOSURE will be called on the parsed response."
|
CLOSURE will be called on the parsed response."
|
||||||
(empc-ensure-connected)
|
(empc-ensure-connected)
|
||||||
(unless (string= (substring command -1) "\n")
|
(if (memq command (empc-commands empc-object))
|
||||||
(setq command (concat command "\n")))
|
(progn
|
||||||
(empc-queue-push empc-object command closure
|
(unless (string= (substring command -1) "\n")
|
||||||
(if handler handler 'empc-handle-response)))
|
(setq command (concat command "\n")))
|
||||||
|
(empc-queue-push empc-object command closure
|
||||||
|
(if handler handler 'empc-handle-response)))
|
||||||
|
(message "empc: Command `%s' is not available (not supported by the server or forbidden to you)" command))
|
||||||
|
|
||||||
(defun empc-send-sync (command &optional closure handler)
|
(defun empc-send-sync (command &optional closure handler)
|
||||||
"Send COMMAND synchronously. That means empc will push the
|
"Send COMMAND synchronously. That means empc will push the
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue