emms-patches
[Top][All Lists]
Advanced

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

[Emms-patches] darcs patch: emms-playlist-limit.el: Add default valu...


From: William Xu
Subject: [Emms-patches] darcs patch: emms-playlist-limit.el: Add default valu... (and 3 more)
Date: Mon, 09 Jul 2007 12:25:03 +0800

Sun Jul  8 12:08:09 CST 2007  William Xu <address@hidden>
  * emms-playlist-limit.el: Add default value based on track at point for
  emms-playlist-limit-to-*.

Sun Jul  8 19:59:07 CST 2007  William Xu <address@hidden>
  * emms-playlist-limit.el: Redefine functions emms-playlist-limit-to-* with
  macro: define-emms-playlist-limit.

Sun Jul  8 20:00:50 CST 2007  William Xu <address@hidden>
  * emms-playlist-sort.el: Minor updates.

Sun Jul  8 22:00:12 CST 2007  William Xu <address@hidden>
  * emms-playlist-limit.el: Update Copyright to GPLv3.
New patches:

[emms-playlist-limit.el: Add default value based on track at point for
William Xu <address@hidden>**20070708040809
 emms-playlist-limit-to-*.
] {
hunk ./emms-playlist-limit.el 49
-  (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)))
hunk ./emms-playlist-limit.el 60
-  (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)))
hunk ./emms-playlist-limit.el 71
-  (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)))
hunk ./emms-playlist-limit.el 82
-  (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)))
hunk ./emms-playlist-limit.el 93
-  (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)))
hunk ./emms-playlist-limit.el 104
-  (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.el: Redefine functions emms-playlist-limit-to-* with
William Xu <address@hidden>**20070708115907
 macro: define-emms-playlist-limit.
] {
hunk ./emms-playlist-limit.el 39
+(defmacro define-emms-playlist-limit (attribute)
+  "Macro for defining emms playlist limit functions."
+  `(defun ,(intern (format "emms-playlist-limit-to-%s" attribute)) (regexp)
+     ,(format "Limit to playlists that have %s that matches REGEXP." attribute)
+     (interactive
+      (list
+       (let* ((curr
+               (or (emms-track-get
+                    (emms-playlist-track-at) (quote ,attribute))
+                   (emms-track-get
+                    (emms-playlist-selected-track) (quote ,attribute))))
+              (fmt (if curr
+                       (format "Limit to artist (regexp = %s): " curr)
+                     (format "Limit to artist (regexp): "))))
+         (read-string fmt))))
+     (when (string= regexp "")
+       (setq regexp (emms-track-get (emms-playlist-track-at) (quote 
,attribute))))
+     (emms-playlist-limit-do (quote ,attribute) regexp)))
+
+(define-emms-playlist-limit info-artist)
+(define-emms-playlist-limit info-album)
+(define-emms-playlist-limit info-year)
+(define-emms-playlist-limit info-genre)
+(define-emms-playlist-limit name)
+
+(defun emms-playlist-limit-to-all ()
+  "Show all tracks again."
+  (interactive)
+  (emms-playlist-limit-do nil nil))
+
hunk ./emms-playlist-limit.el 77
-(defun emms-playlist-limit-to-info-artist (regexp)
-  "Limit to playlists that have artist that matches 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
-   (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
-   (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
-   (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
-   (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
-   (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 ()
-  "Show all tracks again."
-  (interactive)
-  (emms-playlist-limit-do nil nil))
-
}

[emms-playlist-sort.el: Minor updates.
William Xu <address@hidden>**20070708120050] {
hunk ./emms-playlist-sort.el 23
-;;; Commentary:
-
-;; Provide various playlist sort functions for emms, such as
-;; `emms-playlist-sort-by-info-title'.
-
-;; Put this file into your load-path and the following into your
-;; ~/.emacs:
-;;            (require 'emms-playlist-sort)
-
hunk ./emms-playlist-sort.el 29
-;;; Customizations
+;;; User Customizations
hunk ./emms-playlist-sort.el 53
-;;; Interfaces
+;;; User Interfaces
hunk ./emms-playlist-sort.el 55
-;; sort macro
hunk ./emms-playlist-sort.el 112
-;;; Low Level
+;;; Low Level Functions
}

[emms-playlist-limit.el: Update Copyright to GPLv3.
William Xu <address@hidden>**20070708140012] {
hunk ./emms-playlist-limit.el 8
-;; This program is free software; you can redistribute it and/or modify
+;; EMMS is free software; you can redistribute it and/or modify
hunk ./emms-playlist-limit.el 10
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
hunk ./emms-playlist-limit.el 12
-;;
-;; This program is distributed in the hope that it will be useful,
+
+;; EMMS is distributed in the hope that it will be useful,
hunk ./emms-playlist-limit.el 17
-;;
+
hunk ./emms-playlist-limit.el 19
-;; along with this program; if not, write to the Free Software
-;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-;; 02110-1301 USA
+;; along with EMMS; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
}

Context:

[New file: emms-playlist-limit.el. And minor updates to emms-playlist-sort.
William Xu <address@hidden>**20070705160221] 
[emms-player-mplayer.el: Add "eng.srt", "chs.srt", "cht.srt" to
William Xu <address@hidden>**20070630124728
 emms-player-mplayer-subtitle-extensions.
] 
[Updated NEWS for post-3.0
address@hidden 
[TAG 3.0
address@hidden 
Patch bundle hash:
b003e85c957b4edbf03d94cb3e66844784277bf2

reply via email to

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