From ea35b0637aff4d1f61dac2d25b6556a4d939e6b4 Mon Sep 17 00:00:00 2001 From: Ye Wenbin Date: Thu, 7 Dec 2006 06:35:00 +0000 Subject: emms-i18n changes, add playlist navigate command, uniq playlist command darcs-hash:20061207063510-94065-7726a0fc26d04c70038d5576a0a1451e7e71e368.gz --- emms-score.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'emms-score.el') diff --git a/emms-score.el b/emms-score.el index f9e520e..e8d066f 100644 --- a/emms-score.el +++ b/emms-score.el @@ -242,12 +242,15 @@ See also `emms-next-noerror'." (defun emms-score-load-hash () "Load score hash from `emms-score-file'." (interactive) - (mapc (lambda (elt) - (puthash (car elt) (cdr elt) emms-score-hash)) - (read - (with-temp-buffer - (insert-file-contents emms-score-file) - (buffer-string))))) + (if (file-exists-p emms-score-file) + (mapc (lambda (elt) + (puthash (car elt) (cdr elt) emms-score-hash)) + (read + (with-temp-buffer + (insert-file-contents emms-score-file) + (buffer-string)))) + ;; when file not exists, make empty but valid score file + (emms-score-save-hash))) (defun emms-score-get-plist (filename) (gethash filename emms-score-hash)) -- cgit v1.2.3