aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorforcer <forcer>2006-04-10 12:26:00 +0000
committerforcer <mwolson@gnu.org>2006-04-10 12:26:00 +0000
commit6618771242832290c6bca0f8c0ce944e04780750 (patch)
treece082e30c6baf91ebbdfa57cabed97ba937a6f87
parent0d64f1dc19471d0a6343a89703292d88131761b4 (diff)
emms.el: Introduce and use `emms-source-old-buffer'
darcs-hash:20060410122623-2189f-b75ebb39924d04ffdaddb7dae6f3f303f493a950.gz
-rw-r--r--emms.el13
1 files changed, 10 insertions, 3 deletions
diff --git a/emms.el b/emms.el
index 673b114..d50b8f3 100644
--- a/emms.el
+++ b/emms.el
@@ -218,6 +218,11 @@ seconds the player did seek."
(defvar emms-player-paused-p nil
"Whether the current player is paused or not.")
+(defvar emms-source-old-buffer nil
+ "The active buffer before a source was invoked.
+This can be used if the source depends on the current buffer not
+being the playlist buffer.")
+
;;; User Interface
@@ -446,9 +451,11 @@ This also disables any read-onliness of the current buffer."
(when (or (not emms-playlist-buffer)
(not (buffer-live-p emms-playlist-buffer)))
(emms-playlist-current-clear))
- (with-current-buffer emms-playlist-buffer
- (let ((inhibit-read-only t))
- ,@body))))
+ (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))