emms-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emms-help] Diff to emms-playlist.el rev:1.2


From: Mario Domgörgen
Subject: [Emms-help] Diff to emms-playlist.el rev:1.2
Date: Sun, 30 Nov 2003 17:01:25 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (gnu/linux)

export is also remodeled now...

*** emms-playlist.el.~1.2.~     Sat Nov 29 15:00:55 2003
--- emms-playlist.el    Sun Nov 30 16:59:10 2003
***************
*** 326,359 ****
    "Export the current playlist as to FILENAME. See also:
  `emms-pbi-import-playlist'."
    (interactive "FFile to save playlist as: ")
!   (with-temp-buffer
!     (let ((idx 0)
!         (playlist-length (length emms-playlist)))
!       (while (< idx playlist-length)
!       (insert (concat (emms-playlist-get-filename idx) "\n"))
!       (setq idx (1+ idx)))
!       (write-file filename t))))
  
  ;; This needs to be rewritten to not do such horrible buffer-stuff.
  (defun emms-pbi-import-playlist (filename)
    "Import a previously exported playlist from FILENAME."
    (interactive "fFile to load playlist from: ")
!   (save-excursion
!     (with-temp-buffer
!       (find-file filename)
!       (goto-char (point-min))
!       (emms-stop)
!       (let ((new-pls (make-vector 0 nil)))
!       (while (not (eobp))
!         (setq new-pls
!               (vconcat new-pls
!                        (list (buffer-substring (point-at-bol)
!                                                (point-at-eol)))))
!         (forward-line 1))
!       ;; set this playlist
!       (emms-playlist-set new-pls))
!       (emms-play)
!       (kill-buffer (current-buffer)))))
  
  ;; Major-mode for the playlist-buffer
  (define-derived-mode  emms-pbi-mode fundamental-mode "EMMS playlist"
--- 326,347 ----
    "Export the current playlist as to FILENAME. See also:
  `emms-pbi-import-playlist'."
    (interactive "FFile to save playlist as: ")
!   (with-temp-file filename
!     (mapc (lambda (elt) (insert elt "\n")) emms-playlist)))
  
  ;; This needs to be rewritten to not do such horrible buffer-stuff.
  (defun emms-pbi-import-playlist (filename)
    "Import a previously exported playlist from FILENAME."
    (interactive "fFile to load playlist from: ")
!   (with-temp-buffer
!     (insert-file-contents-literally filename)
!     (emms-stop)
!     ;; set this playlist
!     (emms-playlist-set
!      (vconcat (split-string (buffer-substring (point-min)
!                                             (point-max)))))   
!     (emms-play)))
! 
  
  ;; Major-mode for the playlist-buffer
  (define-derived-mode  emms-pbi-mode fundamental-mode "EMMS playlist"

-- 
Three things are certain:
Death, taxes, and lost data.
Guess which has occurred.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]