regexp-opt supports "shy group" regexps (info "(elisp)Regexp Backslash"), 
while gnu "find" doesn't seem to support it. I have tested under macosx
and debian. Hence, our regex definition for some players are
problematic. For example:

,----
| (define-emms-simple-player mplayer '(file url)
|   (regexp-opt '(".ogg" ".mp3" ".wav" ".mpg" ".mpeg" ".wmv" ".wma"
|                 ".mov" ".avi" ".divx" ".ogm" ".asf" ".mkv" "http://"; "mms://"
|                 ".rm" ".rmvb" ".mp4" ".flac" ".vob" ".m4a" ".ape"))
|   "mplayer" "-slave" "-quiet" "-really-quiet") 
`----

regexp-opt would construct some shy groups in return value, when this is
later passed to external "find", "find" will not find some specific kind
of files, for instance ".ape" files.

Take a simple example, 

,----[ with shy group ]
| (shell-command-to-string
|  (format "find /tmp/ -type f -iregex %s"
|          (concat "\".*\\(" (regexp-opt '("avi" "ape")) "\\).*\"")))
| =>"/tmp/b.avi
| "
`----

,----[ without shy group ]
| (shell-command-to-string
|  (format "find /tmp/ -type f -iregex %s"
|          (concat "\".*\\(" 
|                  (mapconcat 'regexp-quote
|                             '("avi" "ape")
|                             "\\|") 
|                  "\\).*\"")))
| 
| =>
| "/tmp/a.ape
| /tmp/b.avi
| "
`----

Right now I find mplayer and xine are defining regexps using regexp-opt,
which I will send patches fixing them. 

-- 
William

http://williamxu.net9.org


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

Reply via email to