From 92370b0ac336b1716614e1daea48f059c372092a Mon Sep 17 00:00:00 2001 From: "mathias.dahl" Date: Fri, 28 Dec 2007 08:59:00 +0000 Subject: Format URL so that it looks nicer in playlist. darcs-hash:20071228085920-18da9-66f645e44747dcc5ca70958f5fdefc3fd79c0590.gz --- emms.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/emms.el b/emms.el index ca618b0..48242a3 100644 --- a/emms.el +++ b/emms.el @@ -598,6 +598,23 @@ Otherwise, return the type and the name with a colon in between." (concat (symbol-name (emms-track-type track)) ": " (emms-track-name track)))) +(defun emms-track-simple-description (track) + "Simple function to give a user-readable description of a track. +If it's a file track, just return the file name. Otherwise, +return the type and the name with a colon in between. Hex-encoded +characters in URLs are replaced by the decoded character." + (let ((type (emms-track-type track))) + (cond ((eq 'file type) + (emms-track-name track)) + ((eq 'url type) + (emms-format-url-track-name (emms-track-name track))) + (t (concat (symbol-name type) + ": " (emms-track-name track)))))) + +(defun emms-format-url-track-name (name) + "Format URL track name for better readability." + (url-unhex-string name)) + (defun emms-track-force-description (track) "Always return text that describes TRACK. This is used when inserting a description into a buffer. -- cgit v1.2.3