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

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

[elpa] externals/mpdired f167259c1b 027/133: next/previous song in playl


From: ELPA Syncer
Subject: [elpa] externals/mpdired f167259c1b 027/133: next/previous song in playlist view
Date: Sun, 10 Mar 2024 15:59:33 -0400 (EDT)

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

    next/previous song in playlist view
---
 mpdired.el | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/mpdired.el b/mpdired.el
index 62f6d96345..30f1e374aa 100644
--- a/mpdired.el
+++ b/mpdired.el
@@ -9,9 +9,9 @@
 (defvar-keymap mpdired-mode-map
   :doc "Local keymap for MPDired."
   "C-n"   'mpdired-next-line
-  "n"     'mpdired-next-line
+  "n"     'mpdired-next
   "C-p"   'mpdired-previous-line
-  "p"     'mpdired-previous-line
+  "p"     'mpdired-previous
   "q"     'bury-buffer
   "C-m"   'mpdired-enter
   "^"     'mpdired-goto-parent
@@ -299,6 +299,16 @@
     (setq mpdired--last-command 'pause)
     (process-send-string process "pause\n")))
 
+(defun mpdired-next-internal (&optional buffer)
+  (mpdired--with-comm-buffer process buffer
+    (setq mpdired--last-command 'next)
+    (process-send-string process "next\n")))
+
+(defun mpdired-previous-internal (&optional buffer)
+  (mpdired--with-comm-buffer process buffer
+    (setq mpdired--last-command 'previous)
+    (process-send-string process "previous\n")))
+
 (defun mpdired-status-internal ()
   (mpdired--with-comm-buffer process nil
     (setq mpdired--last-command 'status)
@@ -397,6 +407,20 @@
             (mpdired-listall-internal mpdired--directory)
           (mpdired-listall-internal "")))))
 
+(defun mpdired-next ()
+  (interactive)
+  (cond ((eq mpdired--view 'browser)
+        (mpdired-next-line))
+       ((eq mpdired--view 'playlist)
+        (mpdired-next-internal))))
+
+(defun mpdired-previous ()
+  (interactive)
+  (cond ((eq mpdired--view 'browser)
+        (mpdired-previous-line))
+       ((eq mpdired--view 'playlist)
+        (mpdired-previous-internal))))
+
 ;; Main entry point
 (defun mpdired ()
   (interactive)



reply via email to

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