New patches: [emms-playlist-limit.el: Add default value based on track at point for William Xu **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 **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 **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 **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. } [emms-playlist-limit.el: Minor updates. William Xu **20070709103714] { hunk ./emms-playlist-limit.el 35 - 'emms-playlist-limit-update-tracks) + 'emms-playlist-limit-insert) hunk ./emms-playlist-limit.el 37 - 'emms-playlist-limit-update-tracks))) + 'emms-playlist-limit-insert))) hunk ./emms-playlist-limit.el 83 -(defun emms-playlist-limit-update-tracks () - "Update `emms-playlist-limit-tracks'." +(defun emms-playlist-limit-insert () + "Run in `emms-playlist-source-inserted-hook'." hunk ./emms-playlist-limit.el 90 +;; 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))))) + } [emms-playlist-limit.el: Add missing line: (define-emms-playlist-limit info-title). William Xu **20070711071022] { hunk ./emms-playlist-limit.el 59 +(define-emms-playlist-limit info-title) hunk ./emms-playlist-limit.el 107 -See `emms-info-mp3find-arguments' for possible options." +See `emms-info-mp3find-arguments' for possible options for NAME." } [make-number-of-secs-to-seek-configurable.dpatch Tassilo Horn **20070712062052 Patch sent by "Alfred M. Szmidt" in on the emms-users list (with slight modifications). ] { hunk ./emms.el 220 +(defcustom emms-seek-seconds 10 + "The number of seconds to seek forward or backward when seeking. +This is a number in seconds." + :group 'emms + :type 'number) + hunk ./emms.el 416 - (emms-player-seek 10))) + (emms-player-seek emms-seek-seconds))) hunk ./emms.el 422 - (emms-player-seek -10))) + (emms-player-seek (- emms-seek-seconds)))) } Context: [New file: emms-playlist-limit.el. And minor updates to emms-playlist-sort. William Xu **20070705160221] [emms-player-mplayer.el: Add "eng.srt", "chs.srt", "cht.srt" to William Xu **20070630124728 emms-player-mplayer-subtitle-extensions. ] [Updated NEWS for post-3.0 address@hidden [TAG 3.0 address@hidden Patch bundle hash: 89a8118fe78ae11e9dea22f06492a862d4111b29