From 22b985173073b9f4ae832278a2625511af3f79e4 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Sun, 16 Mar 2025 15:57:10 +1100 Subject: [emacs][i3] Add fringe indicators for emms play groups And various other changes --- emacs/.emacs.d/lisp/my/my-emms.el | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'emacs/.emacs.d/lisp/my/my-emms.el') 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) -- cgit v1.2.3