[Top][All Lists]

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

[emms-help] Suggestion for how URLs are formatted in the playlist buffer

From: Mathias Dahl
Subject: [emms-help] Suggestion for how URLs are formatted in the playlist buffer
Date: Fri, 28 Dec 2007 00:57:12 +0100

I made the following change to my local EMMS today:

(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."
  (cond ((eq 'file (emms-track-type track))
         (emms-track-name track))
        ((eq 'url (emms-track-type track))
         (emms-format-url-track-name (emms-track-name track)))
        (t (concat (symbol-name (emms-track-type track))
                   ": " (emms-track-name track)))))

(defun emms-format-url-track-name (name)
  (url-unhex-string name))

It makes URLs with hex-encoded characters more readable. Typically
stuff can look like this:


with the change above it looks like this:

http://someserver/mp3/Kamelot - Ghost Opera [2007] [Rock]/04 - Kamelot
- the human stain.mp3

Maybe this could be incorporated into EMMS?

I also have an idea about shortening long URLs in some smart way so
that the middle would be replaced by "...", leaving the root path and
the file name. However that did not itch as bad so I haven't tried to
come up with a hack for that.


reply via email to

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