From b1ea89a08da3f5953d55072fffed8f781b461315 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Fri, 29 Sep 2017 17:27:50 -0400 Subject: * lisp/emms.el: set-playlist-buffer bugfix Take into account destructive sorting. Patch thanks to Ian Dunn. --- AUTHORS | 1 + NEWS | 1 + lisp/emms.el | 11 ++++++----- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/AUTHORS b/AUTHORS index d508d77..02227ba 100644 --- a/AUTHORS +++ b/AUTHORS @@ -39,6 +39,7 @@ or fewer. We started recording trivial patches this way in June of David Michael tumashu Maxim Cournoyer +Ian Dunn ;; Local variables: diff --git a/NEWS b/NEWS index 79da5f2..c0f8771 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ News since version 4.3: + - Bug fix: set-playlist-buffer listing. - emms-source-file-directory-tree-find now follows symlinks. - Playlists can now be sorted by mtime. - Move to cl-lib. 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)))) -- cgit v1.2.3