Emacs: Emms: Resume playing time on restart

master
Pierre Neidhardt 2017-06-27 11:42:31 +01:00
parent 816a852f6e
commit 4b57bdd6a2
1 changed files with 10 additions and 2 deletions

View File

@ -124,8 +124,16 @@ will always use the same cover per folder."
(fset 'emms-browser-covers 'emms-cache-covers)
;;; TODO: Resume on restart.
;;; See `emms-bookmark-add' and `emms-bookmark-previous'.
;;; Resume on restart.
;;; We don't use bookmarks as that could interfere with user's ones.
(with-eval-after-load 'desktop
(add-to-list 'desktop-globals-to-save 'emms-playing-time)
(let ((time emms-playing-time))
(setq emms-playing-time 0) ; Don't disturb the time display.
(emms-start)
(sleep-for 0 100) ; This is required for the player might not be ready yet.
(emms-player-seek-to time)
(emms-pause)))
;;; TODO: See if mpd is faster at building the db. Not so important.
;;; TODO: Delete entry from cache? See `emms-cache-del'. Not so important.