From b19d65da017e9a95fd018bf1c205f5d18b95ce8f Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Sun, 19 Nov 2006 05:20:00 +0000 Subject: emms.el: In emms-playlist-set-playlist-buffer, prompt user from available EMMS playlist buffers rather than all buffers, and display feedback upon setting the current buffer, since this is not an easy change to see darcs-hash:20061119052023-1bfb2-145fb4f51da6d1bff473343442ddb9ea207ffded.gz --- emms.el | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/emms.el b/emms.el index 52f5547..d556522 100644 --- a/emms.el +++ b/emms.el @@ -639,13 +639,23 @@ for that purpose.") (defun emms-playlist-set-playlist-buffer (&optional buffer) "Set the current playlist buffer." - (interactive "bNew playlist buffer: ") + (interactive + (list (let* ((buf-list (mapcar #'(lambda (buf) + (list (buffer-name buf))) + (emms-playlist-buffer-list))) + (shortest (car (sort buf-list #'(lambda (lbuf rbuf) + (< (length (car lbuf)) + (length (car rbuf)))))))) + (completing-read "Playlist buffer to make current: " + buf-list nil t shortest)))) (let ((buf (if buffer (get-buffer buffer) (current-buffer)))) (with-current-buffer buf (emms-playlist-ensure-playlist-buffer)) - (setq emms-playlist-buffer buf))) + (setq emms-playlist-buffer buf) + (when (interactive-p) + (message "Set current EMMS playlist buffer")))) (defun emms-playlist-new (&optional name) "Create a new playlist buffer. -- cgit v1.2.3