From: Tim Vaughan Date: Thu, 12 Dec 2019 12:18:40 +0000 (+0100) Subject: Cleaned up centering behaviour. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=b1db216e7ebeb8f52138a0ec201b3aba6c6c5c31;p=emus.git Cleaned up centering behaviour. --- diff --git a/emus.el b/emus.el index 12c57f1..e529697 100644 --- a/emus.el +++ b/emus.el @@ -511,16 +511,16 @@ Used to update browser display when `emus-current-track' and/or `emus-state' cha (defun emus-centre-current () "Centre the current track in the browser buffer, if available." (interactive) - (when (get-buffer "*emus*") - (when emus-current-track + (when (and (eq (current-buffer) (get-buffer "*emus*")) + emus-current-track) (goto-char (emus-track-browser-pos emus-current-track)) - (recenter)))) + (recenter))) (defun emus-browse () "Switch to *emus* audio library browser." (interactive) (emus--with-library - (switch-to-buffer "*emus*") + (pop-to-buffer "*emus*") (emus-browser-mode) (emus--render-tracks) (emus-centre-current)))