diff options
author | Michael Olson <mwolson@gnu.org> | 2006-06-08 18:46:00 +0000 |
---|---|---|
committer | Michael Olson <mwolson@gnu.org> | 2006-06-08 18:46:00 +0000 |
commit | ececf6862bde0815211e5596c7a8cf76304b11f5 (patch) | |
tree | ef675f6d765434df52b266331e02c6ece0f5dc4e | |
parent | 5e88f995fec0d274da36801cb97052959b928bcd (diff) |
Fix compiler warnings in emms-cache.el.
darcs-hash:20060608184612-1bfb2-942ae7db648d88b9dfe4896872fc3f5fdd7a30d3.gz
-rw-r--r-- | emms-browser.el | 18 | ||||
-rw-r--r-- | emms-playlist-mode.el | 6 | ||||
-rw-r--r-- | emms.el | 20 |
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) @@ -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." |