From 3e97e2a386e287dc5b7acf37a87aa1b8daaa0af8 Mon Sep 17 00:00:00 2001 From: yonirabkin Date: Fri, 16 Sep 2005 20:22:00 +0000 Subject: Small fixes darcs-hash:20050916202237-be80e-e15fcf8f430dd620041567040d8e746d5d83118a.gz --- emms-playlist-mode.el | 47 +++++++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/emms-playlist-mode.el b/emms-playlist-mode.el index 32292fe..8d9f2d6 100644 --- a/emms-playlist-mode.el +++ b/emms-playlist-mode.el @@ -1,30 +1,12 @@ ;;; emms-playlist-mode.el --- Playlist mode for Emms. ;;; Copyright Yoni Rabkin under the GNU General Public License. +;;; This file is a part of the Emacs Multimedia system. ;;; Commentary: ;;; -;;; Jorgen has the following to say about playlist-mode: -;;; -;;; Playlist Mode -;;; ============= -;;; This should be a file named emms-playlist-mode.el, providing said -;;; mode, which is a suitable value for `emms-playlist-default-major-mode'. -;;; -;;; The mode should probably set `emms-playlist-buffer-name' and -;;; `emms-playlist-insert-track-function', and add something to -;;; `emms-playlist-selection-changed-hook' and -;;; `emms-playlist-cleared-hook'. -;;; -;;; When this is done, emms-pbi.el, emms-pbi-filter.el, -;;; emms-pbi-mark.el, emms-pbi-popup.el and emms-pl-manip.el can be -;;; removed. -;;; -;;; ...and when Jorgen says (require 'jump) we say how-high.el. -;;; ;;; I'm designing this as a method of displaying and manipulating the ;;; different Emms playlist buffers defined by the user. -;;; ;;; Feature requests: ;;; @@ -33,8 +15,9 @@ ;;; ;;; (2) Add emms-info support which re-writes the track titles. ;;; -;;; (3) Add multi-line formatting and arbitrary comment entry (via a -;;; null-track type [Lukhas]?). +;;; (3) Add multi-line formatting and arbitrary comment entry. +;;; +;;; (4) Font-locking for unselected tracks via overlays. ;;; -------------------------------------------------------- ;;; Variables @@ -45,6 +28,9 @@ (defvar emms-playlist-mode-selected-overlay-marker nil) +(make-variable-buffer-local + 'emms-playlist-mode-selected-overlay-marker) + ;; Is this needed at all? (defvar emms-playlist-mode-prepend-show-string "Now Playling:") @@ -234,6 +220,20 @@ (add-hook 'emms-playlist-selection-changed-hook 'emms-playlist-mode-overlay-selected) +;;; -------------------------------------------------------- +;;; Playlists +;;; -------------------------------------------------------- + +(defun emms-playlist-buffers () + "Return a list of EMMS playlist buffers." + (let ((lis nil)) + (mapc (lambda (buf) + (with-current-buffer buf + (when emms-playlist-buffer-p + (setq lis (cons buf lis))))) + (buffer-list)) + lis)) + ;;; -------------------------------------------------------- ;;; Entry ;;; -------------------------------------------------------- @@ -267,11 +267,6 @@ (interactive) (kill-all-local-variables) - ;; Even though Stefan Monnier warns against this, in this case I - ;; know what I'm doing. - (make-variable-buffer-local - 'emms-playlist-mode-selected-overlay-marker) - (use-local-map emms-playlist-mode-map) (setq major-mode 'emms-playlist-mode mode-name "Emms-Playlist") -- cgit v1.2.3