From 342ffff018657b3984c7d57cc509540c0b0670c1 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Wed, 6 Nov 2019 13:36:55 -0500 Subject: * lisp/emms-source-playlist.el: replace with variable --- lisp/emms-source-playlist.el | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'lisp') 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 -;; +;; 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)) -- cgit v1.2.3