emms-help
[Top][All Lists]
Advanced

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

[emms-help] Re: playlist buffer


From: Michael Olson
Subject: [emms-help] Re: playlist buffer
Date: Mon, 10 Jul 2006 00:46:27 -0400
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

Sebastian Luque <address@hidden> writes:

>  I have set that variable to the
> following function (stolen from somewhere):
>
> (defun my-emms-track-description (track)
>   "Return a nice description of TRACK."
>   (let ((artist (emms-track-get track 'info-artist))
>         (title (emms-track-get track 'info-title))
>         (name (emms-track-get track 'name))
>         (type (emms-track-type track)))
>     (cond ((and (stringp artist) (not (string= artist ""))
>                 (stringp title) (not (string= title "")))
>            (let ((desc (format "%s - %s" artist title)))
>              (if (memq type '(file url))
>                  desc
>                (concat (symbol-name type) ": " desc))))
>           ((and (stringp title) (not (string= title "")))
>            (my-upcase-initials title))
>           ((null name)
>            "Invalid track!")
>           ((memq type '(url streamlist))
>            "")
>           (t
>            (concat (symbol-name type) ": " name)))))

For reference, here's the `my-upcase-initials' function that this
snippet refers to.

(defun my-upcase-initials (string)
  "Do `upcase-initials' on STRING, but do not uppercase letters
that come after quote characters."
  (with-temp-buffer
    (insert (upcase-initials string))
    (goto-char (point-min))
    (while (re-search-forward "['`]\\([[:upper:]]\\)" nil t)
      (downcase-region (match-beginning 1) (match-end 1)))
    (buffer-string)))

-- 
Michael Olson -- FSF Associate Member #652 -- http://www.mwolson.org/
Interests: Emacs Lisp, text markup, protocols -- Jabber: mwolson_at_hcoop.net
  /` |\ | | | IRC: freenode.net/mwolson: #emacs, #hcoop, #muse, #PurdueLUG
 |_] | \| |_| Projects: Emacs, Muse, ERC, EMMS, Planner, ErBot, DVC

Attachment: pgpc0wQVfEI57.pgp
Description: PGP signature


reply via email to

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