diff options
author | Yuchen Pei <id@ypei.org> | 2025-03-16 15:57:10 +1100 |
---|---|---|
committer | Yuchen Pei <id@ypei.org> | 2025-03-16 15:57:10 +1100 |
commit | 22b985173073b9f4ae832278a2625511af3f79e4 (patch) | |
tree | 5846cbd6b8c6ed0e857d23d11b2a86e025889c3c /emacs/.emacs.d/lisp/my/my-emms.el | |
parent | 4c65d5f267f3ed70224ae6e8c26430a9571a21dd (diff) |
[emacs][i3] Add fringe indicators for emms play groups
And various other changes
Diffstat (limited to 'emacs/.emacs.d/lisp/my/my-emms.el')
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-emms.el | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-emms.el b/emacs/.emacs.d/lisp/my/my-emms.el index 331f309..e77089d 100644 --- a/emacs/.emacs.d/lisp/my/my-emms.el +++ b/emacs/.emacs.d/lisp/my/my-emms.el @@ -467,10 +467,23 @@ under /zzz-seren/." (defun my-emms-playlist-random-group () (interactive) (with-current-emms-playlist - (goto-line (1+ (random (count-lines (point-min) (point-max))))) - (pcase-let ((`(,group-start . ,group-end) (my-emms-playlist-group-bounds))) - (goto-line group-start) - (emms-playlist-mode-play-current-track)))) + (remove-overlays) + (goto-line (1+ (random (count-lines (point-min) (point-max))))) + (pcase-let ((`(,group-start . ,group-end) (my-emms-playlist-group-bounds))) + (goto-line group-start) + (overlay-put + (make-overlay (point) (point)) + 'before-string (propertize + "x" 'display + `(left-fringe down-arrow emms-playlist-selected-face))) + (save-excursion + (goto-line (1- group-end)) + (overlay-put + (make-overlay (point) (point)) + 'before-string (propertize + "x" 'display + `(left-fringe up-arrow emms-playlist-selected-face)))) + (emms-playlist-mode-play-current-track)))) (defun my-emms-next-track-or-random-group () (interactive) |