emms-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[emms-help] emms-player-*-playable-p Predicates Bug


From: Ross Patterson
Subject: [emms-help] emms-player-*-playable-p Predicates Bug
Date: Mon, 04 Sep 2006 15:48:21 -0700
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

The emms-player-*-playable-p predicates generated by the
define-emms-simple-player macro in emms-player-simple or defun'ed in
emms-player-mpd fail to recognize track string-matches on the regexp
if the regexp matches at the beginning because string-match returns 0
which causes and to return false.  Attached are patches against 2.0-2
from Debian Unstable.

Ross Patterson

diff -u /usr/share/emacs/site-lisp/emms/emms-player-simple.el\~ 
/usr/share/emacs/site-lisp/emms/emms-player-simple.el
--- /usr/share/emacs/site-lisp/emms/emms-player-simple.el~      2006-06-12 
12:14:58.000000000 -0700
+++ /usr/share/emacs/site-lisp/emms/emms-player-simple.el       2006-09-04 
15:47:42.000000000 -0700
@@ -95,8 +95,9 @@
      (defun ,playablep (track)
        "Return non-nil when we can play this track."
        (and (memq (emms-track-type track) ,types)
-            (string-match ,regex (emms-track-name track)))))))
-
+           (not (null (string-match
+                       ,regex
+                       (emms-track-name track)))))))))
 ;; Global variables
 (defvar emms-player-simple-process-name "emms-player-simple-process"
   "The name of the simple player process")

Diff finished.  Mon Sep  4 15:46:54 2006
diff -u /usr/share/emacs/site-lisp/emms/emms-player-mpd.el\~ 
/usr/share/emacs/site-lisp/emms/emms-player-mpd.el
--- /usr/share/emacs/site-lisp/emms/emms-player-mpd.el~ 2006-06-12 
12:14:58.000000000 -0700
+++ /usr/share/emacs/site-lisp/emms/emms-player-mpd.el  2006-09-04 
15:39:33.000000000 -0700
@@ -725,8 +725,9 @@
 (defun emms-player-mpd-playable-p (track)
   "Return non-nil when we can play this track."
   (and (memq (emms-track-type track) '(file url playlist))
-       (string-match (emms-player-get emms-player-mpd 'regex)
-                     (emms-track-name track))))
+       (not (null (string-match
+                  (emms-player-get emms-player-mpd 'regex)
+                  (emms-track-name track))))))
 
 (defun emms-player-mpd-play (&optional id)
   "Play whatever is in the current MusicPD playlist.

Diff finished.  Mon Sep  4 15:47:26 2006

reply via email to

[Prev in Thread] Current Thread [Next in Thread]