branch: externals/mpdired commit f9b4f915176fc6f2112c5f011a6e8faa9fd80f44 Author: Manuel Giraud <man...@ledu-giraud.fr> Commit: Manuel Giraud <man...@ledu-giraud.fr>
re-add progress bar when resetting face --- mpdired.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mpdired.el b/mpdired.el index 48587f9450..7735ac1ac9 100644 --- a/mpdired.el +++ b/mpdired.el @@ -372,7 +372,16 @@ used for mark followed by a space." ((eq type 'playlist) (put-text-property bol eol 'face 'mpdired-playlist)) ((eq type 'song) - (put-text-property bol eol 'face 'mpdired-song))))) + (put-text-property bol eol 'face 'mpdired-song) + ;; Add "progress bar" back + (when mpdired--song + (let* ((currid (get-text-property bol 'id)) + (songid (car mpdired--song)) + (elapsed (cadr mpdired--song)) + (duration (caddr mpdired--song)) + (x (/ (* elapsed (- eol bol)) duration))) + (when (and (= currid songid) (> eol (+ bol x))) + (put-text-property (+ bol x) eol 'face 'mpdired-progress)))))))) (defun mpdired--insert-entry (entry) "Insert ENTRY in MPDired browser view."