aboutsummaryrefslogtreecommitdiff
path: root/lisp/emms-source-playlist.el
diff options
context:
space:
mode:
authorYoni Rabkin <yoni@rabkins.net>2019-11-06 13:36:55 -0500
committerYoni Rabkin <yoni@rabkins.net>2019-11-06 13:36:55 -0500
commit342ffff018657b3984c7d57cc509540c0b0670c1 (patch)
treea461bc3d78159ac2258e59113eb8e4423b550a56 /lisp/emms-source-playlist.el
parent96b80680cc4c1306efb7ad65382138989e506910 (diff)
* lisp/emms-source-playlist.el: replace with variable
Diffstat (limited to 'lisp/emms-source-playlist.el')
-rw-r--r--lisp/emms-source-playlist.el16
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/emms-source-playlist.el b/lisp/emms-source-playlist.el
index 5f88a7b..327be8c 100644
--- a/lisp/emms-source-playlist.el
+++ b/lisp/emms-source-playlist.el
@@ -78,6 +78,10 @@ If this is nil, existing playlists will be quietly overwritten."
:type 'boolean
:group 'emms)
+(defvar emms-source-playlist-native-header-line
+ ";;; This is an EMMS playlist file"
+ "Line which identifies a native emms playlist.")
+
;;; General playlist
(defsubst emms-source-playlist-p-sym (format)
@@ -190,17 +194,17 @@ See `emms-source-playlist-formats' for a list of supported formats."
(emms-source-playlist-parse format file)
(error "Not a recognized playlist format"))))))
-;;; EMMS native playlists
+;;; Emms native playlists
-;; Format:
-;; ;;; This is an EMMS playlist file. Play it with M-x emms-play-playlist
-;; <sexpr>
+;; An Emms native playlist file starts with the contents of
+;; `emms-source-playlist-native-header-line' and is followed by
+;; tracks in sexp format.
(defun emms-source-playlist-native-p ()
"Return non-nil if the current buffer contains a native EMMS playlist."
(save-excursion
(goto-char (point-min))
- (looking-at "^;;; This is an EMMS playlist file")))
+ (looking-at (concat "^" emms-source-playlist-native-header-line))))
(defun emms-source-playlist-parse-native (file)
"Parse the native EMMS playlist in the current buffer."
@@ -215,7 +219,7 @@ OUT should be the buffer where tracks are stored in the native EMMS format."
(with-current-buffer in ;; Don't modify the position
(save-excursion ;; in the IN buffer
(with-current-buffer out
- (insert ";;; This is an EMMS playlist file."
+ (insert emms-source-playlist-native-header-line
" Play it with M-x emms-play-playlist\n")
(insert "("))
(let ((firstp t))