diff options
| author | Michael Olson <mwolson@gnu.org> | 2006-06-16 23:38:00 +0000 | 
|---|---|---|
| committer | Michael Olson <mwolson@gnu.org> | 2006-06-16 23:38:00 +0000 | 
| commit | 4af11977682dd18f07484de299f0ab11b07032e0 (patch) | |
| tree | be8b6aa23c1dbd124b3755e8a6e0759e3d7eeee0 | |
| parent | 5f68d4a7e7d38db5d53b3d5cbfc4d363377c91e1 (diff) | |
emms-player-mpd: Make the playable-p function return nil if we cannot start a connection to mpd.
darcs-hash:20060616233847-1bfb2-6b95e1e17b907cc46204c74b7ea9a59963e86dde.gz
| -rw-r--r-- | emms-player-mpd.el | 8 | 
1 files changed, 7 insertions, 1 deletions
diff --git a/emms-player-mpd.el b/emms-player-mpd.el index cbcfe9d..0ab8b8b 100644 --- a/emms-player-mpd.el +++ b/emms-player-mpd.el @@ -803,7 +803,11 @@ Execute CALLBACK with CLOSURE as its first argument when done."    "Return non-nil when we can play this track."    (and (memq (emms-track-type track) '(file url playlist streamlist))         (string-match (emms-player-get emms-player-mpd 'regex) -                     (emms-track-name track)))) +                     (emms-track-name track)) +       (condition-case nil +           (progn (emms-player-mpd-ensure-process) +                  t) +         (error nil))))  (defun emms-player-mpd-play (&optional id)    "Play whatever is in the current MusicPD playlist. @@ -1087,6 +1091,8 @@ The track should be an alist as per `emms-player-mpd-get-alist'."  This is useful to do when you have recently acquired new music."    (interactive     (list (read-string "Directory: "))) +  (unless (string= dir "") +    (setq dir (emms-player-mpd-get-mpd-filename dir)))    (if emms-cache-set-function        (progn          (message "Dumping MusicPD data to cache...")  | 
