aboutsummaryrefslogtreecommitdiff
path: root/emms.el
diff options
context:
space:
mode:
authorMichael Olson <mwolson@gnu.org>2006-05-10 04:07:00 +0000
committerMichael Olson <mwolson@gnu.org>2006-05-10 04:07:00 +0000
commit179c6991624b8b119ee4a35059bac849a1b40f88 (patch)
tree967c5b6b1a48041b8bc2ff662ff65afd02379311 /emms.el
parent82878fd44b6c6e37be79a1d33991cecc99cb019c (diff)
emms-playlist-mode: Implement the option (disabled by default) of opening a new EMMS buffer for a playlist, when hitting RET on one.
darcs-hash:20060510040730-1bfb2-210380685ccbd869f888ace574740f6e18c381b5.gz
Diffstat (limited to 'emms.el')
-rw-r--r--emms.el25
1 files changed, 25 insertions, 0 deletions
diff --git a/emms.el b/emms.el
index db71528..886c45d 100644
--- a/emms.el
+++ b/emms.el
@@ -542,6 +542,31 @@ If called interactively, the new buffer is also selected."
(switch-to-buffer buf))
buf))
+(defun emms-playlist-buffer-list ()
+ "Return a list of EMMS playlist buffers.
+The first element will be the most recently-created playlist, and
+so on."
+ (let ((lis nil))
+ (mapc (lambda (buf)
+ (with-current-buffer buf
+ (when emms-playlist-buffer-p
+ (setq lis (cons buf lis)))))
+ (buffer-list))
+ (nreverse lis)))
+
+(defun emms-playlist-current-kill ()
+ "Kill the current EMMS playlist buffer and switch to the next one."
+ (interactive)
+ (let ((new (cadr (emms-playlist-buffer-list))))
+ (if new
+ (progn
+ (when (buffer-live-p emms-playlist-buffer)
+ (kill-buffer emms-playlist-buffer))
+ (setq emms-playlist-buffer new)
+ (switch-to-buffer emms-playlist-buffer))
+ (with-current-buffer emms-playlist-buffer
+ (bury-buffer)))))
+
(defun emms-playlist-current-clear ()
"Clear the current playlist.
If no current playlist exists, a new one is generated."