From 6618771242832290c6bca0f8c0ce944e04780750 Mon Sep 17 00:00:00 2001 From: forcer Date: Mon, 10 Apr 2006 12:26:00 +0000 Subject: emms.el: Introduce and use `emms-source-old-buffer' darcs-hash:20060410122623-2189f-b75ebb39924d04ffdaddb7dae6f3f303f493a950.gz --- emms.el | 13 ++++++++++--- 1 file 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)) -- cgit v1.2.3