diff options
author | forcer <forcer> | 2005-09-16 00:51:00 +0000 |
---|---|---|
committer | forcer <mwolson@gnu.org> | 2005-09-16 00:51:00 +0000 |
commit | e028af54dcfc56f04bdabdf6aeba3037e4246fac (patch) | |
tree | a825aae1d7b1f7e39b00370cfeb3b3aee5fa8da7 | |
parent | 3b340f3c204e9cec0a69d10f6d22297ee6db1038 (diff) |
Cleaned up `emms-playlist-save' a bit
darcs-hash:20050916005103-2189f-5ca71f755760a832d2351c221fa58ec500fe1f5e.gz
-rw-r--r-- | emms.el | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -452,25 +452,25 @@ If no playlist exists, a new one is generated." (defun emms-playlist-save (playlist filename) "Save a playlist" - (interactive "bPlaylist buffer name : -FFile to save playlist as: ") - (let ((tracklist '()) - (buffer (find-file-noselect filename))) + (interactive "bPlaylist buffer name: \nFFile to save playlist as: ") + (let ((tracklist '())) (condition-case nil (with-current-buffer playlist (save-excursion (emms-playlist-first) (while (emms-playlist-track-at) - (add-to-list 'tracklist (emms-playlist-track-at) t) + (setq tracklist (cons (emms-playlist-track-at) + tracklist)) (emms-playlist-next)))) - (error "")) + (error nil)) + (setq tracklist (nreverse tracklist)) ;; tracklist complete, let's write it ! - (set-buffer buffer) - (erase-buffer) - (prin1 tracklist buffer) - (insert "\n") - (save-buffer) - (kill-buffer buffer))) + (with-current-buffer (find-file-noselect filename) + (erase-buffer) + (prin1 tracklist (current-buffer)) + (insert "\n") + (save-buffer) + (kill-buffer (current-buffer))))) (defun emms-playlist-save-active (filename) (interactive "FFile to save playlist as: ") |