aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTassilo Horn <tassilo@member.fsf.org>2007-06-05 07:54:00 +0000
committerTassilo Horn <tassilo@member.fsf.org>2007-06-05 07:54:00 +0000
commitf57e6f4b0eb4f730107c4a912bd20b1de756f746 (patch)
tree783a1c28efbea49e373dedd186f42debf2fa5646
parenta192a89d5536dfcd8ec4d08004b3b19e1d7d885b (diff)
add-function-emms.dpatch
The new function `emms' calls `emms-playlist-mode-go' and queries for a directory of music files to add to the playlist, if it is empty. darcs-hash:20070605075453-c06f4-d57382a594c2191e118eb88f5017a2e897f6fad3.gz
-rw-r--r--emms-playlist-mode.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/emms-playlist-mode.el b/emms-playlist-mode.el
index ee5a97d..78912cc 100644
--- a/emms-playlist-mode.el
+++ b/emms-playlist-mode.el
@@ -484,6 +484,17 @@ When NO-NEWLINE is non-nil, do not insert a newline after the track."
(when emms-playlist-mode-center-when-go
(emms-playlist-mode-center-current))))
+(defun emms ()
+ "Switch to the current emms-playlist buffer, use
+emms-playlist-mode and query for a directory tree to add to the
+playlist."
+ (interactive)
+ (emms-playlist-mode-go)
+ (when (not (condition-case nil (emms-playlist-first) (error nil)))
+ (let ((dir (read-directory-name "Select a directory to add recursively: "
+ emms-source-file-default-directory nil t)))
+ (emms-add-directory-tree dir))))
+
(defun emms-playlist-mode-go-popup (&optional window-width)
"Popup emms-playlist buffer as a side window.