aboutsummaryrefslogtreecommitdiff
path: root/emms-browser.el
diff options
context:
space:
mode:
authorDamien Elmes <emms@repose.cx>2006-07-05 13:16:00 +0000
committerDamien Elmes <emms@repose.cx>2006-07-05 13:16:00 +0000
commita6b5c7855486045daeff9db25e224896a2eb0f73 (patch)
treed226f5b83f6b42a8d6ff08a896100efc0398a091 /emms-browser.el
parent84ec279f7b4731899ef0ebf8d80483d88ce26f10 (diff)
browser: propertize playlist tracks in formatting code
darcs-hash:20060705131640-4e3e3-30381f6ff30aecd8d7ccab57a2f7bf0e71b52696.gz
Diffstat (limited to 'emms-browser.el')
-rw-r--r--emms-browser.el26
1 files changed, 13 insertions, 13 deletions
diff --git a/emms-browser.el b/emms-browser.el
index 1518434..94fd2fc 100644
--- a/emms-browser.el
+++ b/emms-browser.el
@@ -746,22 +746,18 @@ Stops at the next line at the same level, or EOF."
"Insert a group description into the playlist buffer."
(let* ((type (emms-browser-bdata-type bdata))
(short-type (substring (symbol-name type) 5))
- (name (emms-browser-format-line bdata 'playlist)))
+ (name (emms-browser-format-line bdata)))
(with-current-emms-playlist
(goto-char (point-max))
(insert name "\n"))))
(defun emms-browser-playlist-insert-track (bdata)
"Insert a track into the playlist buffer."
- (let ((name (emms-browser-format-line bdata 'playlist))
+ (let ((name (emms-browser-format-line bdata 'track))
(track (car (emms-browser-bdata-data bdata))))
(with-current-emms-playlist
(goto-char (point-max))
- (insert (emms-propertize
- name
- 'face 'emms-playlist-track-face
- 'emms-track track)
- "\n"))))
+ (insert name "\n"))))
(defun emms-browser-playlist-insert-bdata (bdata starting-level)
"Add all tracks in BDATA to the playlist."
@@ -1266,7 +1262,7 @@ If > album level, most of the track data will not make sense."
(defun emms-browser-make-indent (level)
(or
emms-browser-current-indent
- (make-string (* 2 (1- level)) ?\ )))
+ (make-string (* 1 (1- level)) ?\ )))
(defun emms-browser-get-format (bdata target)
(let* ((type (emms-browser-bdata-type bdata))
@@ -1298,6 +1294,7 @@ If > album level, most of the track data will not make sense."
(path (emms-track-get track 'name))
(face (emms-browser-get-face bdata))
(format (emms-browser-get-format bdata target))
+ (props (list 'emms-browser-bdata bdata))
(format-choices
`(("i" . ,indent)
("n" . ,name)
@@ -1333,12 +1330,15 @@ If > album level, most of the track data will not make sense."
;; give tracks a 'boost' (covers take up an extra space)
(when (eq type 'info-title)
- (setq str (concat " " str)))
+ (setq str (concat " " str)))
+
+ ;; if we're in playlist mode, add a track
+ (when (eq target 'track)
+ (setq props
+ (append props `(emms-track ,track))))
- ;; add the bdata object to the whole string
- (add-text-properties
- 0 (length str)
- (list 'emms-browser-bdata bdata) str)
+ ;; add properties to the whole string
+ (add-text-properties 0 (length str) props str)
str))
(defun emms-browser-get-face (bdata)