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

    stop command
---
 mpdired.el | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/mpdired.el b/mpdired.el
index 326c0da91c..1cc45db577 100644
--- a/mpdired.el
+++ b/mpdired.el
@@ -89,6 +89,8 @@
   "P"      #'mpdired-previous-internal
   "a"      #'mpdired-add
   "v"      #'mpdired-set-volume-internal
+  ;; Status toggles
+  "s s"    #'mpdired-stop
   ;; Marks
   "m"      #'mpdired-mark-at-point
   "* m"    #'mpdired-mark-at-point
@@ -323,11 +325,11 @@
         (single (nth 4 status))
         (consume (nth 5 status))
         (string (cond ((string= "stop" state) "")
-                      ((string= "play" state) "Playing")
-                      ((string= "pause" state) "Paused"))))
+                      ((string= "play" state) "Playing ")
+                      ((string= "pause" state) "Paused "))))
     (insert (propertize string 'face 'bold))
     (when (numberp volume)
-      (insert (format " Volume: %d" volume)))
+      (insert (format "Volume: %d" volume)))
     (when repeat (insert " Repeat"))
     (when random (insert " Random"))
     (when single (insert " Single"))
@@ -574,6 +576,13 @@ an optional communication buffer."
          mpdired--message "Toggle pause...")
     (process-send-string process "pause\n")))
 
+(defun mpdired-stop ()
+  (interactive)
+  (mpdired--with-comm-buffer process nil
+    (setq mpdired--last-command 'stop
+         mpdired--message "Stopping...")
+    (process-send-string process "stop\n")))
+
 (defun mpdired-next-internal (&optional buffer)
   (interactive)
   (mpdired--with-comm-buffer process buffer

Reply via email to