diff options
-rw-r--r-- | emms.el | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -643,11 +643,17 @@ for that purpose.") (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)))))))) + (default (or (and emms-playlist-buffer-p + ;; default to current buffer + (buffer-name)) + ;; pick shortest buffer name, since it is + ;; likely to be a shared prefix + (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)))) + buf-list nil t default)))) (let ((buf (if buffer (get-buffer buffer) (current-buffer)))) |