From fa5fb58e464fc2e75a57bd1c298b4441a9e3ccdc Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 5 Mar 2007 13:14:00 +0000 Subject: browser: display a help message on an empty deck darcs-hash:20070305131445-4e3e3-e06fe61d90892014f787578c7adeaec9e45b8736.gz --- emms-browser.el | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/emms-browser.el b/emms-browser.el index 78bde72..1328595 100644 --- a/emms-browser.el +++ b/emms-browser.el @@ -585,6 +585,8 @@ example function is `emms-browse-by-artist'." (emms-browser-render-hash hash type) (setq emms-browser-top-level-hash hash) (setq emms-browser-top-level-type type) + (unless (> (hash-table-count hash) 0) + (emms-browser-show-empty-cache-message)) (goto-char (point-min)))) (emms-browser-add-category "artist" 'info-artist) @@ -658,6 +660,30 @@ compilations, etc." (let ((bdata (emms-browser-make-bdata-tree type 1 tracks name))) (emms-browser-insert-format bdata))) +(defun emms-browser-show-empty-cache-message () + "Display some help if the cache is empty." + (emms-with-inhibit-read-only-t + (insert " +Welcome to EMMS. + +There are currently no files in the EMMS database. +To browse music, you need to tell EMMS where your +files are. + +Try the following commands: + + M-x emms-add-directory-tree: + Add all music in a directory and its subdirectories. + + M-x emms-add-directory: + Add all music in a directory + + M-x emms-add-file: Add a single music file. + +After you have added some files, wait for EMMS to say +'all track information loaded,' then return to the +browser, and hit 'b 1' to refresh."))) + ;; -------------------------------------------------- ;; Building a subitem tree ;; -------------------------------------------------- -- cgit v1.2.3