branch: externals/mpdired
commit 7bc94bdfe4064c295b7e18be7631a6ed28ac09b7
Author: Manuel Giraud <man...@ledu-giraud.fr>
Commit: Manuel Giraud <man...@ledu-giraud.fr>

    place `mpdired--bol' correctly on status line
---
 mpdired.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/mpdired.el b/mpdired.el
index 98b243455a..7be3bdb179 100644
--- a/mpdired.el
+++ b/mpdired.el
@@ -354,7 +354,12 @@ elapsed duration).")
 (defun mpdired--bol ()
   "Correct beginning of line in a MPDired buffer.  First two columns are
 used for mark followed by a space."
-  (+ 2 (line-beginning-position)))
+  (let* ((bol (line-beginning-position))
+        (type (get-text-property bol 'type)))
+    ;; Status start at first column.
+    (if (and type (eq type 'status))
+       bol
+      (+ 2 bol))))
 
 (defun mpdired--short-name (string)
   (or (and (string-match "/\\([^/]*\\)\\'" string)
@@ -431,6 +436,8 @@ used for mark followed by a space."
       (when random (insert " Random"))
       (when single (insert " Single"))
       (when consume (insert " Consume"))
+      (put-text-property (line-beginning-position)
+                        (line-end-position) 'type 'status)
       (insert "\n"))))
 
 (defun mpdired--insert-song (song)

Reply via email to