From a6ffe948ddbb1c061114bdf5b4a7c424d756bc97 Mon Sep 17 00:00:00 2001 From: forcer Date: Sun, 18 Sep 2005 15:47:00 +0000 Subject: emms-playlist-set-playlist-buffer: Ensure the selected buffer is a playlist. darcs-hash:20050918154758-2189f-720bc6d736b60db1d420c97a59eef0c5847fa859.gz --- emms.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'emms.el') diff --git a/emms.el b/emms.el index 419c454..b18bc75 100644 --- a/emms.el +++ b/emms.el @@ -431,9 +431,11 @@ Otherwise, return the type and the name with a colon in between." (defun emms-playlist-set-playlist-buffer (&optional buffer) "Set the current playlist buffer." (interactive "bNew playlist buffer: ") - (emms-playlist-ensure-playlist-buffer) - (setq emms-playlist-buffer (or (get-buffer buffer) - (current-buffer)))) + (let ((buf (or (get-buffer buffer) + (current-buffer)))) + (with-current-buffer buf + (emms-playlist-ensure-playlist-buffer)) + (setq emms-playlist-buffer buf))) (defun emms-playlist-new (&optional name) "Create a new playlist buffer. -- cgit v1.2.3