aboutsummaryrefslogtreecommitdiff
path: root/emms-mode-line.el
diff options
context:
space:
mode:
authorwilliam.xwl <william.xwl>2005-10-04 16:21:00 +0000
committerwilliam.xwl <mwolson@gnu.org>2005-10-04 16:21:00 +0000
commit6e0e5a6961e8d0454664e832d69dabf3a9917549 (patch)
treecb78bfa3ff62ff67518b80165461d0b8c3b854fb /emms-mode-line.el
parent414b92ad08b4399575f7b0adc6dfa7ee68494322 (diff)
emms-mode-line.el: When artist or title info cann't be achieved, show
file name without directory. darcs-hash:20051004162138-e8fe6-dbbeb40bb623c61ac9a1051afcd8c12e4dc11553.gz
Diffstat (limited to 'emms-mode-line.el')
-rw-r--r--emms-mode-line.el16
1 files changed, 13 insertions, 3 deletions
diff --git a/emms-mode-line.el b/emms-mode-line.el
index fd84d57..e4c201f 100644
--- a/emms-mode-line.el
+++ b/emms-mode-line.el
@@ -53,9 +53,19 @@
(defun emms-mode-line-playlist-current ()
"Format the currently playing song"
- (format emms-mode-line-format
- (emms-track-description
- (emms-playlist-current-selected-track))))
+ (format
+ emms-mode-line-format
+ (let* ((track (emms-playlist-current-selected-track))
+ (artist (emms-track-get track 'info-artist))
+ (title (emms-track-get track 'info-title))
+ (type (emms-track-type track)))
+ ;; when artist or title info cann't be achieved, show file name
+ ;; without directory.
+ (if (and (not (and artist title))
+ (eq 'file type))
+ (file-name-nondirectory (emms-track-name track))
+ (emms-track-description
+ (emms-playlist-current-selected-track))))))
(defvar emms-mode-line-initial-titlebar frame-title-format)