(setq emus-current-track track)
(emus--update-track old-track)
(emus--update-track track)
- (emus--resume-cp))))
+ (emus--resume-cp)
+ (emus-goto-current))))
(defun emus-select-track (track)
"Set TRACK as current, but do not start playing."
(emus--update-track old-track)
(emus--update-track track)
(emus-send-cmd "o")
- (emus--resume-cp))))
+ (emus--resume-cp)
+ (emus-goto-current))))
(defun emus-stop ()
"Stop playback of the current track."
(emus-play-track (button-get button 'emus-track))
(emus-display-status))
-(defun emus-centre-current ()
- "Centre the current track in the browser buffer, if available."
+(defun emus-goto-current ()
+ "Move point to the current track in the browser buffer, if available."
(interactive)
- (when (and (eq (current-buffer) (get-buffer "*emus*"))
+ (when (and (get-buffer "*emus*")
emus-current-track)
- (goto-char (emus-track-browser-pos emus-current-track))
- (recenter)))
+ (with-current-buffer "*emus*"
+ (goto-char (emus-track-browser-pos emus-current-track)))))
(defun emus-browse ()
"Switch to *emus* audio library browser."
(pop-to-buffer "*emus*")
(emus-browser-mode)
(emus--render-tracks)
- (emus-centre-current)))
+ (emus-goto-current)))
(defun emus-refresh ()
"Refresh the emus library."
(emus-jump-10s-backward)
(emus-display-status))
-(defun emus-centre-current-status ()
- "Jump 10s backward in current track, then display the emus status in the minibuffer."
+(defun emus-goto-current-status ()
+ "Move point to the current track, then display the emus status in the minibuffer."
(interactive)
- (emus-centre-current)
+ (emus-goto-current)
(emus-display-status))
(defun emus-refresh-status ()
(define-key map (kbd "P") 'emus-play-prev-album-status)
(define-key map (kbd ",") 'emus-jump-10s-backward-status)
(define-key map (kbd ".") 'emus-jump-10s-forward-status)
- (define-key map (kbd "c") 'emus-centre-current-status)
+ (define-key map (kbd "c") 'emus-goto-current-status)
(when (fboundp 'evil-define-key*)
(evil-define-key* 'motion map
(kbd "SPC") 'emus-playpause-status
(kbd "P") 'emus-play-prev-album-status
(kbd ",") 'emus-jump-10s-backward-status
(kbd ".") 'emus-jump-10s-forward-status
- (kbd "c") 'emus-centre-current-status))
+ (kbd "c") 'emus-goto-current-status))
map)
"Keymap for emus browser.")