diff options
author | Yoni Rabkin <yoni@rabkins.net> | 2017-09-29 17:27:50 -0400 |
---|---|---|
committer | Yoni Rabkin <yoni@rabkins.net> | 2017-09-29 17:27:50 -0400 |
commit | b1ea89a08da3f5953d55072fffed8f781b461315 (patch) | |
tree | f2a0f55beca63cbdf4b2dea5d56b512b1aacb698 /lisp | |
parent | 881bfaef42e58e04822d944a51ccad0efb9ab7be (diff) |
* lisp/emms.el: set-playlist-buffer bugfix
Take into account destructive sorting. Patch thanks to Ian Dunn.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/emms.el | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/emms.el b/lisp/emms.el index e65e544..c00fcd0 100644 --- a/lisp/emms.el +++ b/lisp/emms.el @@ -738,17 +738,18 @@ for that purpose.") (list (let* ((buf-list (mapcar #'(lambda (buf) (list (buffer-name buf))) (emms-playlist-buffer-list))) + (sorted-buf-list (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))))))))) + (car sorted-buf-list)))) (emms-completing-read "Playlist buffer to make current: " - buf-list nil t default)))) + sorted-buf-list nil t default)))) (let ((buf (if buffer (get-buffer buffer) (current-buffer)))) |