If there is no alive process, don't try to send commands but store then into the queue
This commit is contained in:
parent
cd4eabe65f
commit
18d96b8a8f
1 changed files with 7 additions and 6 deletions
3
empc.el
3
empc.el
|
|
@ -104,12 +104,13 @@ playlist is a vector of song ids, keeping the order of the songs
|
|||
(defun empc-queue-push (object command closure fn)
|
||||
"Enqueue '(COMMAND . (CLOSURE . FN)) to the queue of OBJECT.
|
||||
Leave the idle state beforehand if necessary."
|
||||
(when (empc-process object)
|
||||
(if (empc-queue object)
|
||||
(when (string= (empc-queue-head-command object) "idle\n")
|
||||
(setcar (caaar object) "noidle\n")
|
||||
(process-send-string (empc-process object) "noidle\n"))
|
||||
(when command
|
||||
(process-send-string (empc-process object) command)))
|
||||
(process-send-string (empc-process object) command))))
|
||||
(setcar (car object)
|
||||
(nconc (empc-queue object)
|
||||
(list (cons command (cons closure fn))))))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue