Set default expand level?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Set default expand level?

Keno Goertz
Hello,

can anyone tell me how to set a default expand level on EMMS? I have the
following in my config file:

#+BEGIN_SRC emacs-lisp
  (require 'emms-setup)
  (emms-all)
  (emms-default-players)
  (setq emms-source-file-default-directory "~/mus/loved")
  (setq emms-info-functions '(emms-info-tinytag))
  (global-set-key (kbd "C-c s") 'emms-smart-browse)
  (emms-browser-make-filter
   "loved" (emms-browser-filter-only-dir "~/mus/loved/"))
  (emms-browser-make-filter
   "unrated" (emms-browser-filter-only-dir "~/mus/unrated/"))
  (emms-browser-make-filter
   "didnotlove" (emms-browser-filter-only-dir "~/mus/didnotlove/"))
  (emms-browser-set-filter (assoc "loved" emms-browser-filters))
#+END_SRC

When calling emms-smart-browse, I successfully get into the artist list
of the music I love. Now, I always find myself hitting 2 because I'm
interested in seeing the albums. When hitting 2 in the artist view, I
get exactly the kind of view I want to see by default.

I have tried using emms-browser-mode-hook, but

#+BEGIN_SRC emacs-lisp
  (add-hook 'emms-browser-mode-hook 'emms-browser-expand-to-level-2)
#+END_SRC

just makes Emacs freeze up when calling emms-smart-browse.

Anyone has an idea?

Thanks
Keno

signature.asc (881 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Set default expand level?

Petteri Hintsanen-2
Keno Goertz <[hidden email]> writes:

> I have tried using emms-browser-mode-hook, but
>
> #+BEGIN_SRC emacs-lisp
>   (add-hook 'emms-browser-mode-hook 'emms-browser-expand-to-level-2)
> #+END_SRC
>
> just makes Emacs freeze up when calling emms-smart-browse.

It looks like emms-browser-find-top-level function goes into an infinite
loop.  So it is a bug in the browser code.

Until it gets fixed you can try something like this:

  (global-set-key (kbd "C-c s")
                  (lambda ()
                    "Display browser and playlist."
                    (interactive)
                    (emms-smart-browse)
                    (emms-browser-expand-to-level-2)))

Regards,
Petteri

Reply | Threaded
Open this post in threaded view
|

Re: Set default expand level?

Keno Goertz
Petteri Hintsanen writes:
> Until it gets fixed you can try something like this:
>
>   (global-set-key (kbd "C-c s")
>                   (lambda ()
>                     "Display browser and playlist."
>                     (interactive)
>                     (emms-smart-browse)
>                     (emms-browser-expand-to-level-2)))

Thank you! That works for me :)

signature.asc (881 bytes) Download Attachment