From 8d31a1720b7203f8036a7e00ac883a9159a6a9b4 Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Sat, 22 Jul 2023 19:22:41 +0200 Subject: [PATCH] another try, doesn't work either, now using c to jump to current --- lisp/init-audio.el | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lisp/init-audio.el b/lisp/init-audio.el index d758e76..754a541 100644 --- a/lisp/init-audio.el +++ b/lisp/init-audio.el @@ -104,6 +104,20 @@ the user declines to add another file." (emms-playlist-save 'native filename) (emms-playlist-mode)))))))) + (defun tvd-emms-follow-playing-song() + (interactive) + (emms-playlist-mode-center-current)) + ;; (let ((track (emms-track-get (emms-playlist-current-selected-track) 'name))) + ;; (message (format "track name: %s" track))) + ;; (message (format "%s" emms-playlist-selected-marker)) + ;; (save-restriction + ;; (when emms-playlist-selected-marker + ;; (goto-char emms-playlist-selected-marker)))) + + ;; we need to apply this hook automatically because use-package's + ;; :hook keyword doesn't supporting appending a hook + (add-hook 'emms-playlist-selection-changed-hook 'tvd-emms-follow-playing-song 1) + :hook (emms-playlist-mode . hl-line-mode) (emms-playlist-source-inserted . beginning-of-buffer) @@ -112,7 +126,7 @@ the user declines to add another file." ( "" . 'emms-seek-forward) ( "" . 'emms-seek-backward) ( "" . 'emms-pause) - ( "c" . 'emms-playlist-set-playlist-buffer) + ;; ( "c" . 'emms-playlist-set-playlist-buffer) default: 'emms-playlist-mode-center-current ( "b" . 'tvd-emms-beginning-of-song) ( "r" . 'emms-toggle-repeat-track) ( "R" . 'emms-toggle-repeat-playlist)))