aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRasmus <rasmus@gmx.us>2015-08-10 17:23:52 +0200
committerRasmus <rasmus@gmx.us>2015-08-10 17:32:24 +0200
commit420070f079258b3800c466f2b80d9c8ce6984195 (patch)
treeafbb1989516857cc3a62b3c18cd4a591b33b555d /lisp
parentf1c504eae7a46d24e679c992c093b8bcd63ab32b (diff)
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.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emms-browser.el6
1 files 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."