branch: externals/mpdired
commit a53d111e2ed87dfb073607b610600aac9e708d51
Author: Manuel Giraud <[email protected]>
Commit: Manuel Giraud <[email protected]>
playlist create and append
---
mpdired.el | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/mpdired.el b/mpdired.el
index cc817fe98e..831d8b7573 100644
--- a/mpdired.el
+++ b/mpdired.el
@@ -106,6 +106,9 @@
"s r" #'mpdired-toggle-random
"s S" #'mpdired-toggle-single
"s c" #'mpdired-toggle-consume
+ ;; Playlist commands
+ "l c" #'mpdired-playlist-create
+ "l a" #'mpdired-playlist-append
;; Marks
"m" #'mpdired-mark-at-point
"* m" #'mpdired-mark-at-point
@@ -735,6 +738,18 @@ an optional communication buffer."
(process-send-string process
(format "setvol %d\n" (min 100 (max 0 volume))))))
+(defun mpdired-playlist-create (name)
+ (interactive "MPlaylist name: ")
+ (mpdired--with-comm-buffer process nil
+ (setq mpdired--last-command 'playlist-create)
+ (process-send-string process (format "save \"%s\"\n" name))))
+
+(defun mpdired-playlist-append (name)
+ (interactive "MPlaylist name: ")
+ (mpdired--with-comm-buffer process nil
+ (setq mpdired--last-command 'playlist-append)
+ (process-send-string process (format "save \"%s\" append\n" name))))
+
(defun mpdired--save-point ()
(cond ((eq mpdired--view 'queue)
(let ((bol (mpdired--bol)))