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:
parent
63d9e7045f
commit
902926e3ee
1 changed files with 6 additions and 5 deletions
11
empc.el
11
empc.el
|
|
@ -365,11 +365,12 @@ For status:
|
|||
(interactive)
|
||||
(unless song
|
||||
(setq song (empc-current-song empc-object)))
|
||||
(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)))))
|
||||
(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))))))
|
||||
|
||||
(defun empc-mode-line-update ()
|
||||
"Change the string to write in the mode-line and force-update it."
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue