diff options
-rw-r--r-- | emms-browser.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/emms-browser.el b/emms-browser.el index 630873d..181ec6a 100644 --- a/emms-browser.el +++ b/emms-browser.el @@ -137,10 +137,13 @@ The default is to compare case-insensitively." (defun emms-browser (&optional name) "Launch or switch to the EMMS Browser." (interactive) - (when (or (null emms-browser-buffer) + (if (or (null emms-browser-buffer) (not (buffer-live-p emms-browser-buffer))) - (setq emms-browser-buffer (emms-browser-new-buffer name)) - (funcall emms-browser-default-browsing-function)) + (progn + (setq emms-browser-buffer (emms-browser-new-buffer name)) + (funcall emms-browser-default-browsing-function)) + (when name + (rename-buffer name))) ;; if the buffer is displayed, switch the window instead (let ((wind (get-buffer-window emms-browser-buffer))) (if wind |