"Alejandro Benitez" <[EMAIL PROTECTED]> writes:

> Hi,
>
> I had problems playing files with EMMS/Alsaplayer, getting the following 
> error:
>
> if: Don't know how to play track: (*track* (type . file) (name .
> "/home/john/sample.mp3") (info-mtime 18495 26588))
> EMMS: All track information loaded.
>
> I changed the following line in emms-player-simple.el
>
> (define-emms-simple-player alsaplayer '(file url)
>   (emms-player-simple-regexp ".ogg" ".mp3" ".wav" ".flac" ".pls"
> ".m3u" "http://";)
>   "alsaplayer" "--quiet" "--nosave" "\"--interface text\"")
>
> to the following:
>
> (define-emms-simple-player alsaplayer '(file url) (regexp-opt '(".ogg"
> ".mp3" ".wav" ".flac" ".pls" ".m3u" "http://";)) "alsaplayer" "--quiet"
> "--nosave" "\"--interface text\"")
>
> Now my EMMS can play files back again.
>
> What's wrong?

I'm on Emacs22.

The output of `emms-player-simple-regexp' is broken, What's the reason
for using `emms-player-simple-regexp'? What am I missing?

Here is a version of `emms-player-simple-regexp' which outputs an
equivalent (but not identical) regular expression to your `regexp-opt':

(defun emms-player-simple-regexp (&rest extensions)
  "Return a regexp matching all EXTENSIONS, case-insensitively."
  (concat "\\("
          (mapconcat (lambda (extension)
                       (mapconcat (lambda (char)
                                    (cond ((char-equal char ?.)
                                           "\\.")
                                          (t (let ((u (upcase char))
                                                   (d (downcase char)))
                                               (if (= u d)
                                                   (format "%c" char)
                                                 (format "[%c%c]" u d))))))
                                  extension
                                  ""))
                     extensions
                     "\\|")
          "\\)"))

-- 
   "Cut your own wood and it will warm you twice"


_______________________________________________
Emms-help mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emms-help

Reply via email to