diff options
author | Michael Olson <mwolson@gnu.org> | 2006-11-19 05:34:00 +0000 |
---|---|---|
committer | Michael Olson <mwolson@gnu.org> | 2006-11-19 05:34:00 +0000 |
commit | 343599d4750a34142fc6e230f845a24933220d3e (patch) | |
tree | 41055def3786aba29de39d3a1f7a5bc617825c20 | |
parent | 76ab749162ef9cf8a782b0d801645b94a9e80a49 (diff) |
Default to current buffer when setting the current EMMS playlist buffer.
darcs-hash:20061119053410-1bfb2-9cb15edee05a30c8a3b85865a0cfbd2f5f7302be.gz
-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)))) |