diff options
author | Michael Olson <mwolson@gnu.org> | 2006-04-20 22:26:00 +0000 |
---|---|---|
committer | Michael Olson <mwolson@gnu.org> | 2006-04-20 22:26:00 +0000 |
commit | 244e5efb47ff0996654a463f58a71dc50ed8939b (patch) | |
tree | f76cbcd6e048d9a20e2c12f74927a979fc11f673 | |
parent | 56ab07f294567f494eded602b83761e6a2b8ab83 (diff) |
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
-rw-r--r-- | emms-player-mpd.el | 12 |
1 files changed, 8 insertions, 4 deletions
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) |