aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emms-browser.el15
-rw-r--r--lisp/emms-player-mplayer.el2
-rw-r--r--lisp/emms-player-vlc.el4
-rw-r--r--lisp/emms-player-xine.el2
-rw-r--r--lisp/emms-playlist-mode.el1
-rw-r--r--lisp/emms-source-playlist.el54
-rw-r--r--lisp/emms-tag-editor.el25
7 files changed, 62 insertions, 41 deletions
diff --git a/lisp/emms-browser.el b/lisp/emms-browser.el
index 1329a60..5286d75 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))
@@ -1508,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)))
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 3aea1d3..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
@@ -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))
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")
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)
diff --git a/lisp/emms-source-playlist.el b/lisp/emms-source-playlist.el
index d2026c9..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)
@@ -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 ()
- "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-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))))
+ (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
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