From 420070f079258b3800c466f2b80d9c8ce6984195 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Mon, 10 Aug 2015 17:23:52 +0200 Subject: emms-browser-goto-random only goes to lowest level emms-browser-goto-random only considers item of lowest level. For instance, in level 2 emms-browser-goto-random will only stop once an albums has been found and so forth. --- lisp/emms-browser.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/emms-browser.el b/lisp/emms-browser.el index 9f5a1db..8a86bd2 100644 --- a/lisp/emms-browser.el +++ b/lisp/emms-browser.el @@ -1313,12 +1313,14 @@ Return the previous point-max before adding." "Do we need to seed (random)?") (defun emms-browser-goto-random () + "Move cursor to random item with the lowest visible level." (interactive) (when emms-browser-seed-pending (random t) (setq emms-browser-seed-pending nil)) - (goto-char (point-min)) - (forward-line (1- (random (count-lines (point-min) (point-max)))))) + (while (progn (goto-char (point-min)) + (forward-line (1- (random (count-lines (point-min) (point-max))))) + (emms-browser-subitems-visible)))) (defun emms-browser-view-in-dired (&optional bdata) "View the current directory in dired." -- cgit v1.2.3