aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emms-browser.el18
-rw-r--r--emms-playlist-mode.el6
-rw-r--r--emms.el20
3 files changed, 26 insertions, 18 deletions
diff --git a/emms-browser.el b/emms-browser.el
index 0aa7faa..e96c707 100644
--- a/emms-browser.el
+++ b/emms-browser.el
@@ -58,7 +58,9 @@
;;; Code:
+(require 'emms)
(require 'emms-cache)
+(require 'emms-source-file)
;; --------------------------------------------------
;; Variables and configuration
@@ -307,8 +309,9 @@ example function is `emms-browse-by-artist'."
(when emms-browser-sort-function
(with-current-emms-playlist
(setq new-max (point-max)))
- (emms-playlist-sort 'emms-sort-natural-order-less-p
- old-max new-max))
+ (when (fboundp 'emms-playlist-sort)
+ (emms-playlist-sort emms-browser-sort-function
+ old-max new-max)))
(run-mode-hooks 'emms-browser-tracks-added-hook)
(message "Added %d tracks." count)))
@@ -430,11 +433,12 @@ Returns the playlist window."
(setq pbuf (emms-playlist-current-clear))
(switch-to-buffer pbuf))
;; make q in the playlist window hide the linked browser
- (define-key emms-playlist-mode-map (kbd "q")
- (lambda ()
- (interactive)
- (emms-browser-hide-linked-window)
- (bury-buffer)))
+ (when (boundp 'emms-playlist-mode-map)
+ (define-key emms-playlist-mode-map (kbd "q")
+ (lambda ()
+ (interactive)
+ (emms-browser-hide-linked-window)
+ (bury-buffer))))
(setq pwin (get-buffer-window pbuf))
(goto-char (point-max))))
pwin))
diff --git a/emms-playlist-mode.el b/emms-playlist-mode.el
index 6e049f2..218a131 100644
--- a/emms-playlist-mode.el
+++ b/emms-playlist-mode.el
@@ -201,12 +201,6 @@ function switches back to the remembered buffer."
(setq emms-playlist-mode-switched-buffer (current-buffer))
(switch-to-buffer emms-playlist-buffer)))
-(defmacro emms-with-inhibit-read-only-t (&rest body)
- "Simple wrapper around `inhibit-read-only'."
- `(let ((inhibit-read-only t))
- ,@body))
-(put 'emms-with-inhibit-read-only-t 'edebug-form-spec '(body))
-
(defun emms-playlist-mode-insert-newline ()
"Insert a newline at point."
(interactive)
diff --git a/emms.el b/emms.el
index 795862b..7354c96 100644
--- a/emms.el
+++ b/emms.el
@@ -463,6 +463,21 @@ whenever possible."
seq)
+;;; Convenient macros
+
+(defmacro emms-with-inhibit-read-only-t (&rest body)
+ "Simple wrapper around `inhibit-read-only'."
+ `(let ((inhibit-read-only t))
+ ,@body))
+(put 'emms-with-inhibit-read-only-t 'edebug-form-spec '(body))
+
+(defmacro emms-with-widened-buffer (&rest body)
+ `(save-restriction
+ (widen)
+ ,@body))
+(put 'emms-with-widened-buffer 'edebug-form-spec '(body))
+
+
;;; Tracks
;; This is a simple datatype to store track information.
@@ -669,11 +684,6 @@ If no playlist exists, a new one is generated."
(point-max)))
(run-hooks 'emms-playlist-cleared-hook))
-(defmacro emms-with-widened-buffer (&rest body)
- `(save-restriction
- (widen)
- ,@body))
-
;;; Point movement within the playlist buffer.
(defun emms-playlist-track-at (&optional pos)
"Return the track at POS (point if not given), or nil if none."