From 244e5efb47ff0996654a463f58a71dc50ed8939b Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Thu, 20 Apr 2006 22:26:00 +0000 Subject: emms-player-mpd: Use better check to see if we are given valid output from "mpd --version". This should improve results for the case where mpd is installed on a different machine. Thanks to Adam Sj[_\c3_][_\b8_]gren for the report. darcs-hash:20060420222600-1bfb2-6cbb1667e10978e848a64bb58dcec3388aa26819.gz --- emms-player-mpd.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'emms-player-mpd.el') diff --git a/emms-player-mpd.el b/emms-player-mpd.el index 73cb297..49facc5 100644 --- a/emms-player-mpd.el +++ b/emms-player-mpd.el @@ -97,11 +97,15 @@ or nil if we cannot figure it out." (let ((out (split-string (shell-command-to-string "mpd --version") "\n")) - supported) - ;; Get last non-empty line + (found-start nil) + (supported nil)) + ;; Get supported formats (while (car out) - (when (not (string= (car out) "")) - (setq supported (car out))) + (cond ((string= (car out) "Supported formats:") + (setq found-start t)) + ((and found-start + (not (string= (car out) ""))) + (setq supported (concat supported (car out))))) (setq out (cdr out))) ;; Create regexp (when (and (stringp supported) -- cgit v1.2.3