From b322d37a92710f8846f7a518a86cc3976825508f Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 8 Mar 2009 21:50:43 +0100 Subject: * emms-browser.el (emms-browser-make-hash-by): Check that field is present before attempting to add entries. Addresses an issue'm encountered when using lastfm integration and mpd as the player. After requesting streaming from last.fm, a new track gets added to EMMS' database, which is named after the streaming URL but has no other fields. Thus, when adding entries or making searches, checking the the field at hand is non-nil is needed. This patch checks that for emms-browser-make-hash-by. --- lisp/emms-browser.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/emms-browser.el b/lisp/emms-browser.el index 1329a60..d1c85d7 100644 --- a/lisp/emms-browser.el +++ b/lisp/emms-browser.el @@ -656,10 +656,11 @@ compilations, etc." 'emms-browser-filter-tracks-hook track) (setq field (emms-browser-get-track-field track type)) - (setq existing-entry (gethash field hash)) - (if existing-entry - (puthash field (cons track existing-entry) hash) - (puthash field (list track) hash)))) + (when field + (setq existing-entry (gethash field hash)) + (if existing-entry + (puthash field (cons track existing-entry) hash) + (puthash field (list track) hash))))) emms-cache-db) hash)) -- cgit v1.2.3 From f201cdb3786319fbd2b2e4661327ab3e3e1cc677 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 8 Mar 2009 21:50:44 +0100 Subject: (emms-browser-mmatches-p): When performing searches, check whether This is the second patch addressing the null track fields issue. In this case, before trying to STRING-MATCH in a search, we check that the track's field is non-null. --- lisp/emms-browser.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/emms-browser.el b/lisp/emms-browser.el index d1c85d7..5286d75 100644 --- a/lisp/emms-browser.el +++ b/lisp/emms-browser.el @@ -1509,9 +1509,9 @@ included." (dolist (item search-list) (setq matched nil) (dolist (field (car item)) - (when (string-match (cadr item) - (emms-track-get track field "")) - (setq matched t))) + (let ((track-field (emms-track-get track field ""))) + (when (and track-field (string-match (cadr item) track-field)) + (setq matched t)))) (unless matched (setq no-match t))) (not no-match))) -- cgit v1.2.3 From a1656480c97858ea9c70cf88c098ecaa3be9b85a Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Tue, 10 Mar 2009 21:45:13 +0200 Subject: * lisp/emms-player-vlc.el: Add support for VLC versions > 0.8.6e. --- lisp/emms-player-vlc.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/emms-player-vlc.el b/lisp/emms-player-vlc.el index 3aea1d3..2865110 100644 --- a/lisp/emms-player-vlc.el +++ b/lisp/emms-player-vlc.el @@ -54,7 +54,7 @@ ;; splice in params here (append '("vlc" "--intf" "rc") (list (emms-track-name track)) - '("vlc:quit"))))) + '("vlc://quit"))))) ;; add a sentinel for signaling termination (set-process-sentinel process 'emms-player-simple-sentinel)) (emms-player-started emms-player-vlc)) -- cgit v1.2.3 From 4b2158e03e8c026760b00c5cc7c4cc6d742bea8f Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Mon, 16 Mar 2009 09:22:29 +0100 Subject: Add "ogm" extension to VLC, MPlayer and Xine. --- lisp/emms-player-mplayer.el | 2 +- lisp/emms-player-vlc.el | 2 +- lisp/emms-player-xine.el | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/emms-player-mplayer.el b/lisp/emms-player-mplayer.el index a843b25..295c437 100644 --- a/lisp/emms-player-mplayer.el +++ b/lisp/emms-player-mplayer.el @@ -37,7 +37,7 @@ (concat "\\`\\(http\\|mms\\)://\\|" (emms-player-simple-regexp "ogg" "mp3" "wav" "mpg" "mpeg" "wmv" "wma" - "mov" "avi" "divx" "ogm" "asf" "mkv" + "mov" "avi" "divx" "ogm" "ogv" "asf" "mkv" "rm" "rmvb" "mp4" "flac" "vob" "m4a" "ape")) "mplayer" "-slave" "-quiet" "-really-quiet") diff --git a/lisp/emms-player-vlc.el b/lisp/emms-player-vlc.el index 2865110..9a42434 100644 --- a/lisp/emms-player-vlc.el +++ b/lisp/emms-player-vlc.el @@ -33,7 +33,7 @@ (concat "\\`\\(http\\|mms\\)://\\|" (emms-player-simple-regexp "ogg" "mp3" "wav" "mpg" "mpeg" "wmv" "wma" - "mov" "avi" "divx" "ogm" "asf" "mkv" + "mov" "avi" "divx" "ogm" "ogv" "asf" "mkv" "rm" "rmvb" "mp4" "flac" "vob" "m4a" "ape")) "vlc" "--intf" "rc") ; these are never used diff --git a/lisp/emms-player-xine.el b/lisp/emms-player-xine.el index dd83308..de86059 100644 --- a/lisp/emms-player-xine.el +++ b/lisp/emms-player-xine.el @@ -38,7 +38,7 @@ (concat "\\`\\(http\\|mms\\)://\\|" (emms-player-simple-regexp "ogg" "mp3" "wav" "mpg" "mpeg" "wmv" "wma" - "mov" "avi" "divx" "ogm" "asf" "mkv" + "mov" "avi" "divx" "ogm" "ogv" "asf" "mkv" "rm" "rmvb" "mp4" "flac" "vob")) "xine" "--no-gui" "--no-logo" "--no-splash" "--no-reload" "--stdctl") -- cgit v1.2.3 From f4dd5b038324bfef2da338eea70ea32e9947e0e2 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Tue, 31 Mar 2009 09:23:10 -0700 Subject: emms-tag-editor: Turn all symbols to strings before completing read. Otherwise ido-mode will choke on it. --- lisp/emms-tag-editor.el | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'lisp') diff --git a/lisp/emms-tag-editor.el b/lisp/emms-tag-editor.el index 7f0da8c..3eba673 100644 --- a/lisp/emms-tag-editor.el +++ b/lisp/emms-tag-editor.el @@ -302,7 +302,10 @@ a selected region. changes will only take effect on the tracks in the region." (interactive (list (emms-completing-read "Set tag: " - emms-tag-editor-tags nil t) + (mapcar (lambda (arg) + (list (symbol-name (car arg)))) + emms-tag-editor-tags) + nil t) (read-from-minibuffer "To: "))) (save-excursion (save-restriction @@ -323,7 +326,10 @@ If `transient-mark-mode' is on and the mark is active, the changes will only take effect on the tracks in the region." (interactive (cons (emms-completing-read "Replace in tag: " - emms-tag-editor-tags nil t) + (mapcar (lambda (arg) + (list (symbol-name (car arg)))) + emms-tag-editor-tags) + nil t) (let ((common (query-replace-read-args (if (and transient-mark-mode mark-active) "Query replace regexp in region" @@ -365,12 +371,19 @@ changes will only take effect on the tracks in the region." If `transient-mark-mode' is on and the mark is active, the changes will only take effect on the tracks in the region." (interactive - (let* ((tag1 (intern (emms-completing-read "Tag 1: " - emms-tag-editor-tags nil t))) + (let* ((tag1 (intern (emms-completing-read + "Tag 1: " + (mapcar (lambda (arg) + (list (symbol-name (car arg)))) + emms-tag-editor-tags) + nil t))) (tag2 (intern (emms-completing-read "Tag 2: " - (assq-delete-all tag1 - (copy-sequence emms-tag-editor-tags)) + (mapcar (lambda (arg) + (list (symbol-name (car arg)))) + (assq-delete-all + tag1 + (copy-sequence emms-tag-editor-tags))) nil t)))) (list tag1 tag2))) (save-excursion -- cgit v1.2.3 From 83234f84ad0420f121797e344dff842b35e38ed0 Mon Sep 17 00:00:00 2001 From: Dieter Deyke Date: Mon, 25 May 2009 21:05:54 -0600 Subject: Allow relative file names in .m3u playlists --- lisp/emms-source-playlist.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/emms-source-playlist.el b/lisp/emms-source-playlist.el index d2026c9..a83f8ad 100644 --- a/lisp/emms-source-playlist.el +++ b/lisp/emms-source-playlist.el @@ -263,12 +263,12 @@ the more restrictive playlist formats have already been detected and simply return non-nil always." t) -(defun emms-source-playlist-parse-m3u () +(defun emms-source-playlist-parse-m3u (directory) "Parse the m3u playlist in the current buffer." (mapcar (lambda (file) (if (string-match "\\`\\(http\\|mms\\)://" file) (emms-track 'url file) - (emms-track 'file file))) + (emms-track 'file (expand-file-name file directory)))) (emms-source-playlist-m3u-files))) (defun emms-source-playlist-m3u-files () @@ -308,7 +308,7 @@ OUT should be the buffer where tracks are stored in m3u format." (goto-char (point-min)) (when (not (emms-source-playlist-m3u-p)) (error "Not an m3u playlist file.")) - (emms-source-playlist-parse-m3u)))) + (emms-source-playlist-parse-m3u (file-name-directory file))))) ;;; pls files -- cgit v1.2.3 From 6e7b40ad7b322d9dea31e399ce6359d26a191ad6 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Tue, 9 Jun 2009 23:09:06 -0700 Subject: emms-source-playlist: Fix bug, update docstring. --- lisp/emms-source-playlist.el | 52 ++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 23 deletions(-) (limited to 'lisp') diff --git a/lisp/emms-source-playlist.el b/lisp/emms-source-playlist.el index a83f8ad..1063494 100644 --- a/lisp/emms-source-playlist.el +++ b/lisp/emms-source-playlist.el @@ -99,11 +99,11 @@ If this is nil, existig playlists will be quitely overwritten." (functionp (emms-source-playlist-files-sym format)))) (funcall sym)))) -(defun emms-source-playlist-parse (format) - (funcall (emms-source-playlist-parse-sym format))) +(defun emms-source-playlist-parse (format file) + (funcall (emms-source-playlist-parse-sym format) file)) -(defun emms-source-playlist-unparse (format playlist file) - (funcall (emms-source-playlist-unparse-sym format) playlist file)) +(defun emms-source-playlist-unparse (format playlist-buf file-buf) + (funcall (emms-source-playlist-unparse-sym format) playlist-buf file-buf)) (defun emms-source-playlist-files (format) (let ((sym (emms-source-playlist-files-sym format))) @@ -181,7 +181,7 @@ See `emms-source-playlist-formats' for a list of supported formats." (goto-char (point-min)) (let ((format (emms-source-playlist-determine-format))) (if format - (emms-source-playlist-parse format) + (emms-source-playlist-parse format file) (error "Not a recognized playlist format")))))) ;;; EMMS native playlists @@ -196,7 +196,7 @@ See `emms-source-playlist-formats' for a list of supported formats." (goto-char (point-min)) (looking-at "^;;; This is an EMMS playlist file"))) -(defun emms-source-playlist-parse-native () +(defun emms-source-playlist-parse-native (file) "Parse the native EMMS playlist in the current buffer." (save-excursion (goto-char (point-min)) @@ -238,7 +238,7 @@ OUT should be the buffer where tracks are stored in the native EMMS format." (goto-char (point-min)) (when (not (emms-source-playlist-native-p)) (error "Not a native EMMS playlist file.")) - (emms-source-playlist-parse-native)))) + (emms-source-playlist-parse-native file)))) ;;; m3u files @@ -263,13 +263,16 @@ the more restrictive playlist formats have already been detected and simply return non-nil always." t) -(defun emms-source-playlist-parse-m3u (directory) - "Parse the m3u playlist in the current buffer." - (mapcar (lambda (file) - (if (string-match "\\`\\(http\\|mms\\)://" file) - (emms-track 'url file) - (emms-track 'file (expand-file-name file directory)))) - (emms-source-playlist-m3u-files))) +(defun emms-source-playlist-parse-m3u (playlist-file) + "Parse the m3u playlist in the current buffer. +Files will be relative to the directory of PLAYLIST-FILE, unless +they have absolute paths." + (let ((dir (file-name-directory playlist-file))) + (mapcar (lambda (file) + (if (string-match "\\`\\(http\\|mms\\)://" file) + (emms-track 'url file) + (emms-track 'file (expand-file-name file dir)))) + (emms-source-playlist-m3u-files)))) (defun emms-source-playlist-m3u-files () "Extract a list of filenames from the given m3u playlist. @@ -308,7 +311,7 @@ OUT should be the buffer where tracks are stored in m3u format." (goto-char (point-min)) (when (not (emms-source-playlist-m3u-p)) (error "Not an m3u playlist file.")) - (emms-source-playlist-parse-m3u (file-name-directory file))))) + (emms-source-playlist-parse-m3u file)))) ;;; pls files @@ -331,13 +334,16 @@ OUT should be the buffer where tracks are stored in m3u format." t nil))) -(defun emms-source-playlist-parse-pls () - "Parse the pls playlist in the current buffer." - (mapcar (lambda (file) - (if (string-match "\\`\\(http\\|mms\\)://" file) - (emms-track 'url file) - (emms-track 'file file))) - (emms-source-playlist-pls-files))) +(defun emms-source-playlist-parse-pls (playlist-file) + "Parse the pls playlist in the current buffer. +Files will be relative to the directory of PLAYLIST-FILE, unless +they have absolute paths." + (let ((dir (file-name-directory playlist-file))) + (mapcar (lambda (file) + (if (string-match "\\`\\(http\\|mms\\)://" file) + (emms-track 'url file) + (emms-track 'file (expand-file-name file dir)))) + (emms-source-playlist-pls-files)))) (defun emms-source-playlist-pls-files () "Extract a list of filenames from the given pls playlist. @@ -386,7 +392,7 @@ OUT should be the buffer where tracks are stored in pls format." (goto-char (point-min)) (when (not (emms-source-playlist-pls-p)) (error "Not a pls playlist file.")) - (emms-source-playlist-parse-pls)))) + (emms-source-playlist-parse-pls file)))) ;;; extm3u files -- cgit v1.2.3 From af49e9e173e1be8e95c70fe454f96ca3512461d0 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Tue, 9 Jun 2009 23:27:34 -0700 Subject: emms-source-playlist: Docstring typo. --- lisp/emms-source-playlist.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/emms-source-playlist.el b/lisp/emms-source-playlist.el index 1063494..57a299d 100644 --- a/lisp/emms-source-playlist.el +++ b/lisp/emms-source-playlist.el @@ -74,7 +74,7 @@ If this is nil, you will be prompted for a format to use." (defcustom emms-source-playlist-ask-before-overwrite t "*Ask before saving over an existing playlist. -If this is nil, existig playlists will be quitely overwritten." +If this is nil, existing playlists will be quietly overwritten." :type 'boolean :group 'emms) -- cgit v1.2.3 From 67bcbeb63bd0d73632992d0106524b118a89fd29 Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Sun, 5 Jul 2009 08:58:27 +0300 Subject: * lisp/emms-playlist-mode.el: Bind "C-x u" to `emms-playlist-mode-undo' in emms-playlist-mode. --- lisp/emms-playlist-mode.el | 1 + 1 file changed, 1 insertion(+) (limited to 'lisp') diff --git a/lisp/emms-playlist-mode.el b/lisp/emms-playlist-mode.el index ebd9670..0ded269 100644 --- a/lisp/emms-playlist-mode.el +++ b/lisp/emms-playlist-mode.el @@ -118,6 +118,7 @@ This is true for every invocation of `emms-playlist-mode-go'." (define-key map (kbd "C-w") 'emms-playlist-mode-kill) (define-key map (kbd "C-_") 'emms-playlist-mode-undo) (define-key map (kbd "C-/") 'emms-playlist-mode-undo) + (define-key map (kbd "C-x u") 'emms-playlist-mode-undo) (define-key map (kbd "C-n") 'next-line) (define-key map (kbd "C-p") 'previous-line) (define-key map (kbd "C-j") 'emms-playlist-mode-insert-newline) -- cgit v1.2.3