diff options
author | William Xu <william.xwl@gmail.com> | 2007-07-09 10:37:00 +0000 |
---|---|---|
committer | William Xu <william.xwl@gmail.com> | 2007-07-09 10:37:00 +0000 |
commit | b9d1759434443695370b7b2424e12b9ee03e6a1d (patch) | |
tree | 7005395dbef33882398f84b6d0ed9b4e29e4069f | |
parent | f3690237e3602d2594ac49b5f5227ad18319049d (diff) |
emms-playlist-limit.el: Minor updates.
darcs-hash:20070709103714-cfa61-907861f878bb0b0e100bd0070d81b4c12a2bd7ba.gz
-rw-r--r-- | emms-playlist-limit.el | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/emms-playlist-limit.el b/emms-playlist-limit.el index 429d5b2..578098b 100644 --- a/emms-playlist-limit.el +++ b/emms-playlist-limit.el @@ -32,9 +32,9 @@ (interactive "p") (if (and arg (> arg 0)) (add-hook 'emms-playlist-source-inserted-hook - 'emms-playlist-limit-update-tracks) + 'emms-playlist-limit-insert) (remove-hook 'emms-playlist-source-inserted-hook - 'emms-playlist-limit-update-tracks))) + 'emms-playlist-limit-insert))) (defmacro define-emms-playlist-limit (attribute) "Macro for defining emms playlist limit functions." @@ -80,13 +80,22 @@ (defvar emms-playlist-limit-tracks nil "All tracks in playlist buffer.") -(defun emms-playlist-limit-update-tracks () - "Update `emms-playlist-limit-tracks'." +(defun emms-playlist-limit-insert () + "Run in `emms-playlist-source-inserted-hook'." (setq emms-playlist-limit-tracks (append emms-playlist-limit-tracks (emms-playlist-tracks-in-region (point-min) (point-max))))) +;; FIXME: When user deletes some tracks, `emms-playlist-limit-tracks' +;; should be updated. +;; (defun emms-playlist-limit-clear () +;; "Run in `emms-playlist-cleared-hook'." +;; (setq emms-playlist-limit-tracks +;; (append emms-playlist-limit-tracks +;; (emms-playlist-tracks-in-region +;; (point-min) (point-max))))) + (defun emms-playlist-limit-do (name value) "Limit by NAME with VALUE. e.g., |