I add a help function to wait the value changing to non-nil. To avoid blocking main thread, a timer is used. I have no better ideas to do this.
Thank you very much. I suggested some changes.
I suggest adding an optional callback to libmpdel-refresh-status. This callback would be called when refreshing is finished.
Then you need to pass the lambda below as argument to libmpdel-refresh-status.
If you do that, the code below don't need a timer anymore as it is only executed when the value is already there (you have to replace the unless above with if).
Here are some more suggestions. Thank you for your great work!
I suggest passing the variable value as argument to handler. Something like (untested):
(let ((call-handler (lambda ()
(funcall handler (funcall fstate)))))
if you apply my suggestion above, you get the play-state as argument here so you don't have to call (libmpdel-play-state) below.
I suggest only calling libmpdel-send-command once:
(when handler (funcall handler))))
Perfect, thank you very much!
No due date set.
This pull request currently doesn't have any dependencies.
Deleting a branch is permanent. It CANNOT be undone. Continue?