Quick and dirty hack to avoid crashing when trying to notify a song when there

is not even a current one defined.
This commit is contained in:
Renaud Casenave-Péré 2011-09-06 16:18:35 +09:00
parent 63d9e7045f
commit 902926e3ee

View file

@ -365,11 +365,12 @@ For status:
(interactive)
(unless song
(setq song (empc-current-song empc-object)))
(when song
(empc-echo-notify (concat "[" (int-to-string (+ (plist-get song :pos) 1))
"/" (int-to-string (empc-status-get empc-object :playlistlength)) "] "
(if (and (plist-get song :artist) (plist-get song :title))
(concat (plist-get song :artist) " - " (plist-get song :title))
(plist-get song :file)))))
(plist-get song :file))))))
(defun empc-mode-line-update ()
"Change the string to write in the mode-line and force-update it."