aboutsummaryrefslogtreecommitdiff
path: root/emms.el
diff options
context:
space:
mode:
authorforcer <forcer>2006-10-25 17:51:00 +0000
committerforcer <mwolson@gnu.org>2006-10-25 17:51:00 +0000
commit2859ed4a7c7ab97cf0f56d508b8e6b328e059e9c (patch)
tree3b5aeb52096fa4d27fdf3388df84bb55e7a2d858 /emms.el
parent59cc07ba42ed34d1aa83c01fec576d93cdb903d6 (diff)
emms.el: Move macros to the top of the file.
darcs-hash:20061025175106-2189f-b5e2b3e02e577abf79fac5c99bb2869f7582dbb5.gz
Diffstat (limited to 'emms.el')
-rw-r--r--emms.el62
1 files changed, 32 insertions, 30 deletions
diff --git a/emms.el b/emms.el
index 291a330..705344b 100644
--- a/emms.el
+++ b/emms.el
@@ -257,6 +257,38 @@ This can be used if the source depends on the current buffer not
being the playlist buffer.")
+;;; Macros
+
+;;; These need to be at the top of the file so that compilation works.
+
+(defmacro with-current-emms-playlist (&rest body)
+ "Run BODY with the current buffer being the current playlist buffer.
+This also disables any read-onliness of the current buffer."
+ `(progn
+ (when (or (not emms-playlist-buffer)
+ (not (buffer-live-p emms-playlist-buffer)))
+ (emms-playlist-current-clear))
+ (let ((emms-source-old-buffer (or emms-source-old-buffer
+ (current-buffer))))
+ (with-current-buffer emms-playlist-buffer
+ (let ((inhibit-read-only t))
+ ,@body)))))
+(put 'with-current-emms-playlist 'lisp-indent-function 0)
+(put 'with-current-emms-playlist 'edebug-form-spec '(body))
+
+(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))
+
+
;;; User Interface
(defun emms-start ()
@@ -497,21 +529,6 @@ which are part of the text that the image rests on."
(forward-line 0))))
-;;; 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.
@@ -620,21 +637,6 @@ for that purpose.")
(when (not emms-playlist-buffer-p)
(error "Not an EMMS playlist buffer")))
-(defmacro with-current-emms-playlist (&rest body)
- "Run BODY with the current buffer being the current playlist buffer.
-This also disables any read-onliness of the current buffer."
- `(progn
- (when (or (not emms-playlist-buffer)
- (not (buffer-live-p emms-playlist-buffer)))
- (emms-playlist-current-clear))
- (let ((emms-source-old-buffer (or emms-source-old-buffer
- (current-buffer))))
- (with-current-buffer emms-playlist-buffer
- (let ((inhibit-read-only t))
- ,@body)))))
-(put 'with-current-emms-playlist 'lisp-indent-function 0)
-(put 'with-current-emms-playlist 'edebug-form-spec '(body))
-
(defun emms-playlist-set-playlist-buffer (&optional buffer)
"Set the current playlist buffer."
(interactive "bNew playlist buffer: ")