From 9a9b63b7bcc13333e26345b1a6b88d8a22722141 Mon Sep 17 00:00:00 2001
From: Feng Shu <tumashu@163.com>
Date: Tue, 3 Nov 2020 09:57:54 +0800
Subject: [PATCH 4/4] Command arguments need "-" in
 emms-tag-editor-tagfile-functions

* emms-tag-editor.el (emms-tag-editor-tagfile-functions)
(emms-tag-editor-tag-file): Command argument need "-" prefix.

The two reason:
1. some command may need other argument prefix, for example "+" or
   "/" in windows.
2. make emms-tag-editor-tags and emms-tag-editor-tagfile-functions
   look different.
---
 emms-tag-editor.el | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/emms-tag-editor.el b/emms-tag-editor.el
index 49d2900..a9fee06 100644
--- a/emms-tag-editor.el
+++ b/emms-tag-editor.el
@@ -119,17 +119,17 @@ See also `emms-tag-editor-default-parser'.")
 
 (defvar emms-tag-editor-tagfile-functions
   '(("mp3" "mid3v2"
-     ((info-artist      . "a")
-      (info-title       . "t")
-      (info-album       . "A")
-      (info-tracknumber . "T")
-      (info-year        . "y")
-      (info-genre       . "g")
-      (info-note        . "c")
-      (info-albumartist . "-TPE2")
-      (info-composer    . "-TCOM")
-      (info-performer   . "-TOPE")
-      (info-date        . "-TDAT")))
+     ((info-artist      . "-a")
+      (info-title       . "-t")
+      (info-album       . "-A")
+      (info-tracknumber . "-T")
+      (info-year        . "-y")
+      (info-genre       . "-g")
+      (info-note        . "-c")
+      (info-albumartist . "--TPE2")
+      (info-composer    . "--TCOM")
+      (info-performer   . "--TOPE")
+      (info-date        . "--TDAT")))
     ("ogg" . emms-tag-editor-tag-ogg)
     ("flac" . emms-tag-editor-tag-flac))
   "An alist used when committing changes to tags in files.
@@ -186,9 +186,13 @@ See also `emms-tag-editor-tag-file' and `emms-tag-editor-tag-ogg'.")
 Valid tags are given by `emms-tag-editor-tagfile-functions'."
   (let (args val)
     (mapc (lambda (tag)
+            (unless (or (string-prefix-p "-" (cdr tag))
+                        (string-prefix-p "+" (cdr tag))
+                        (string-prefix-p "/" (cdr tag)))
+              (error "Command arguments need prefix in `emms-tag-editor-tagfile-functions'."))
             (setq val (emms-track-get track (car tag)))
             (if (and val (stringp val))
-                (setq args (append (list (concat "-" (cdr tag)) val) args))))
+                (setq args (append (list (cdr tag) val) args))))
           tags)
     (apply 'call-process program
            nil (get-buffer-create emms-tag-editor-log-buffer) nil
-- 
2.20.1

