[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [emms-help] emms problems
From: |
Jorgen Schaefer |
Subject: |
Re: [emms-help] emms problems |
Date: |
Thu, 25 Nov 2004 19:14:12 +0100 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux) |
Jorgen Schaefer <address@hidden> writes:
> Ok, then we need a different way (I think I know how to fix it,
> and I'll do that RSN - I'll let you know).
Here we go. I rewrote the whole function because the old one
sucked.
The following code works here with a file that uses the DOS file
end convention. To try it, just hit C-x C-e at the end :-)
If it still does not work for you, is `inhibit-eol-conversion' set
to t? (It should be nil I think)
(defun emms-m3u-playlist (playlist)
"A source for simple .m3u playlists. It ignores empty lines, or
lines starting with '#'."
(interactive (list (read-file-name "Play file: "
emms-source-file-default-directory
emms-source-file-default-directory
t)))
(emms-source-files
(let ((files '())
(dir (file-name-directory playlist)))
(with-temp-buffer
(insert-file-contents playlist)
(goto-char (point-min))
(while (re-search-forward "^[^# ].*$" nil t)
(let ((line (match-string 0)))
(setq files (cons (if (char-equal ?/ (aref line 0))
line
(concat dir line))
files)))))
(reverse files))))
Greetings,
-- Jorgen
--
((email . "address@hidden") (www . "http://www.forcix.cx/")
(gpg . "1024D/028AF63C") (irc . "nick forcer on IRCnet"))