Skip to content

Commit

Permalink
emms setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen Bin committed May 10, 2024
1 parent 2718f67 commit e659eeb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion lisp/init-emms.el
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,14 @@ If INPUT-P is t, `my-emms-playlist-random-track-keyword' is input by user."
(emms-stop)
(when (bufferp emms-playlist-buffer-name)
(kill-buffer emms-playlist-buffer-name))
(emms-play-directory-tree my-music-root-directory)

(let ((m3u-files (my-lisp-find-file-or-directory my-music-root-directory ".*\\.m3u")))
(cond
((car m3u-files)
(emms-play-playlist (car m3u-files)))
(t
(emms-play-directory-tree my-music-root-directory))))

(unless no-shuffle-p
(emms-shuffle))
(emms-next))
Expand Down
2 changes: 1 addition & 1 deletion lisp/init-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ Copied from 3rd party package evil-textobj."
"Visible window list."
(cl-mapcan #'my-list-windows-in-frame (visible-frame-list)))

(defun my-lisp-find-file-or-directory (root regexp prefer-directory-p)
(defun my-lisp-find-file-or-directory (root regexp &optional prefer-directory-p)
"Find files or directories in ROOT whose names match REGEXP.
If PREFER-DIRECTORY-P is t, return directory; or else, returns file.
This function is written in pure Lisp and slow."
Expand Down

0 comments on commit e659eeb

Please sign in to comment.