emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/mpdired f9b4f91517: re-add progress bar when resetting


From: ELPA Syncer
Subject: [elpa] externals/mpdired f9b4f91517: re-add progress bar when resetting face
Date: Fri, 29 Mar 2024 06:58:31 -0400 (EDT)

branch: externals/mpdired
commit f9b4f915176fc6f2112c5f011a6e8faa9fd80f44
Author: Manuel Giraud <manuel@ledu-giraud.fr>
Commit: Manuel Giraud <manuel@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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]