diff options
-rw-r--r-- | emms-mode-line.el | 16 |
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) |