aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Xu <william.xwl@gmail.com>2007-07-08 04:08:00 +0000
committerWilliam Xu <william.xwl@gmail.com>2007-07-08 04:08:00 +0000
commit35c8ce2f4e0e1a98b9422a96e9579469f641f099 (patch)
tree9414141e985dd730791611b2c3c326e92763890e
parent3b6c9a35fafca4eaa9ad5896ffae782ed2348e10 (diff)
emms-playlist-limit.el: Add default value based on track at point for
emms-playlist-limit-to-*. darcs-hash:20070708040809-cfa61-9b5b97d1099915a83c9f8eea8949ac4c1747d3c0.gz
-rw-r--r--emms-playlist-limit.el48
1 files changed, 42 insertions, 6 deletions
diff --git a/emms-playlist-limit.el b/emms-playlist-limit.el
index 7e5609c..3a8a4d7 100644
--- a/emms-playlist-limit.el
+++ b/emms-playlist-limit.el
@@ -46,32 +46,68 @@
(defun emms-playlist-limit-to-info-artist (regexp)
"Limit to playlists that have artist that matches REGEXP."
- (interactive "sLimit to artist (regexp): ")
+ (interactive
+ (list
+ (read-string
+ (format "Limit to artist (regexp = %s): "
+ (emms-track-get (emms-playlist-track-at) 'info-artist)))))
+ (when (string= regexp "")
+ (setq regexp (emms-track-get (emms-playlist-track-at) 'info-artist)))
(emms-playlist-limit-do 'info-artist regexp))
(defun emms-playlist-limit-to-info-album (regexp)
"Limit to playlists that have album that matches REGEXP."
- (interactive "sLimit to album (regexp): ")
+ (interactive
+ (list
+ (read-string
+ (format "Limit to album (regexp = %s): "
+ (emms-track-get (emms-playlist-track-at) 'info-album)))))
+ (when (string= regexp "")
+ (setq regexp (emms-track-get (emms-playlist-track-at) 'info-album)))
(emms-playlist-limit-do 'info-album regexp))
(defun emms-playlist-limit-to-info-title (regexp)
"Limit to playlists that have title that matches REGEXP."
- (interactive "sLimit to title (regexp): ")
+ (interactive
+ (list
+ (read-string
+ (format "Limit to title (regexp = %s): "
+ (emms-track-get (emms-playlist-track-at) 'info-title)))))
+ (when (string= regexp "")
+ (setq regexp (emms-track-get (emms-playlist-track-at) 'info-title)))
(emms-playlist-limit-do 'info-title regexp))
(defun emms-playlist-limit-to-info-year (regexp)
"Limit to playlists that have year that matches REGEXP."
- (interactive "sLimit to year (regexp): ")
+ (interactive
+ (list
+ (read-string
+ (format "Limit to year (regexp = %s): "
+ (emms-track-get (emms-playlist-track-at) 'info-year)))))
+ (when (string= regexp "")
+ (setq regexp (emms-track-get (emms-playlist-track-at) 'info-year)))
(emms-playlist-limit-do 'info-year regexp))
(defun emms-playlist-limit-to-info-genre (regexp)
"Limit to playlists that have genre that matches REGEXP."
- (interactive "sLimit to genre (regexp): ")
+ (interactive
+ (list
+ (read-string
+ (format "Limit to genre (regexp = %s): "
+ (emms-track-get (emms-playlist-track-at) 'info-genre)))))
+ (when (string= regexp "")
+ (setq regexp (emms-track-get (emms-playlist-track-at) 'info-genre)))
(emms-playlist-limit-do 'info-genre regexp))
(defun emms-playlist-limit-to-name (regexp)
"Limit to playlists that have name that matches REGEXP."
- (interactive "sLimit to name (regexp): ")
+ (interactive
+ (list
+ (read-string
+ (format "Limit to genre (regexp = %s): "
+ (emms-track-get (emms-playlist-track-at) 'name)))))
+ (when (string= regexp "")
+ (setq regexp (emms-track-get (emms-playlist-track-at) 'name)))
(emms-playlist-limit-do 'name regexp))
(defun emms-playlist-limit-to-all ()