Custom window layout for EMMS?

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

Custom window layout for EMMS?

Utkarsh Singh
Hi,

Some background of my problem, in order to listen music I first launch
EMMS with M-x emms and then move to regular Emacs editing buffer.  But
depending on my mood I like to skip some song.  In order to do so I have
two options:

1. Make emms buffer persistent :: As emms kills *EMMS Playlist* as soon
as we move it to not-visible part, I want to keep it loaded on right
corner of the screen.

2. M-x emms-next :: not so interactive as I don't memorize my playlist.

In order to perform 'first' option I want emms buffer to loaded on the
far right side of my screen.  I have also attached screenshot to depict
my visualization I created by dragging emms buffer from mouse pointer.
So I created this custom window layout(1):

(setq display-buffer-alist
      '(("\\*EMMS.*"
         (display-buffer-in-side-window)
         (window-width . 0.25)
           (side . right)
           (slot . 0))))

But after evaluating above expression I was greeted with an empty emms
buffer which was recovered after M-x emms-stop.

So how can I create custom layout from emms buffer OR can stop emms to
bury buffer when it's out of focus.

[1] Demo on custom window layout: https://www.youtube.com/watch?v=rjOhJMbA-q0
--
Utkarsh Singh

Screenshot from 2021-02-20 17-11-28.png (233K) Download Attachment
signature.asc (529 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Custom window layout for EMMS?

Yoni Rabkin-2
Utkarsh Singh <[hidden email]> writes:

> Hi,
>
> Some background of my problem, in order to listen music I first launch
> EMMS with M-x emms and then move to regular Emacs editing buffer.  But
> depending on my mood I like to skip some song.  In order to do so I have
> two options:
>
> 1. Make emms buffer persistent :: As emms kills *EMMS Playlist* as soon
> as we move it to not-visible part

That isn't true. Emms doesn't know or care if its current buffer is
visible, and Emms definitely doesn't kill a non-visible buffer. For
example, I personally have about 11 Emms playlist buffers going at any
given time, only one of which current playing and non of which are
visible. Remember that Emms playlist buffers are just normal Emacs
buffers!

I think that something else is going on here.

--
   "Cut your own wood and it will warm you twice"

Reply | Threaded
Open this post in threaded view
|

Re: Custom window layout for EMMS?

Yoni Rabkin-2
Utkarsh Singh <[hidden email]> writes:

> Yoni Rabkin <[hidden email]> writes:
>
>> That isn't true. Emms doesn't know or care if its current buffer is
>> visible, and Emms definitely doesn't kill a non-visible buffer. For
>> example, I personally have about 11 Emms playlist buffers going at any
>> given time, only one of which current playing and non of which are
>> visible. Remember that Emms playlist buffers are just normal Emacs
>> buffers!
>
> After changing buffer names using:
> (setq emms-playlist-buffer-name "*Music*")
>
> Now I can see Emms buffer but this seems very weird and how are you
> able to spawn multiple emms session as M-x emms takes me back to last
> non-killed emms buffer?

Emms doesn't have sessions, and Emms playlist are simply Emacs
buffers. You can have as many Emms playlists as you can have Emacs
buffers.

The function `emms-playlist-buffer-list' will return a list of all of
the Emms buffers in Emacs.

For instance, on my setup if I evaluate that function I get:

(emms-playlist-buffer-list) => (#<buffer music Classical>
                                #<buffer video Racing>
                                #<buffer video Duke>
                                #<buffer Emms Streams>
                                #<buffer music Modern>
                                #<buffer video Woodworking>
                                #<buffer video Rifftrax>
                                #<buffer video Bill Mason>
                                #<buffer video Ray Mears>
                                #<buffer music Electronic>
                                #<buffer music Jazz>)

...which are all of the my Emms playlists.

Only one playlist buffer is _current_. This means that when you ask Emms
to play a track or go to the next track, it will try to do that in the
current buffer. The name of the current Emms buffer is stored in the
variable `emms-playlist-buffer'.

"M-x emms" will take you to whatever buffer is set in the variable
`emms-playlist-buffer'.

You can create new Emms playlist buffers by invoking M-x
emms-playlist-new, or programmatically by:

    (emms-playlist-new "name of buffer")

More of this here: https://www.gnu.org/software/emms/manual/#Playlists

You can also manage all of your various Emms playlists by using
`emms-metaplaylist-mode'. Section 29 of the Emms manual explains how to
do this: https://www.gnu.org/software/emms/manual/#Managing-Playlists

I hope this is of help.

--
   "Cut your own wood and it will warm you twice"