Blog - Wiki - 

My EMMS Dired-Player Transient

Transients seemingly are all the rage recently and I have built a few myself once I realized that Transient is built-in already, thus doesn't need any additional packages. The recently released CASUAL DIRED package inspired me to share my EMMS-DIRED-PLAYER transient that I have built a while ago.

I am not a "playlist-guy" and my usual use-case for listening to music is selecting either a file or folder in DIRED and simply play that. To make the process a little more convenient I have built an EMMS-DIRED-PLAYER transient.

20240509T095700--emms-transient.webp

Figure 1: My EMMS Dired Transient. And yes, I started to use TABS

I am sure this transient can be still improved, and likely I will do so at some point, but I am using this for a while and for the time being it does seem to do the trick.

(transient-define-prefix svbck/emms-dired-transient ()
  :transient-suffix     'transient--do-stay
  ["EMMS Dired Player\n"
   ["Player Controls"
    ("P" "Play Dired" emms-play-dired )
    ("SPC" "Pause" emms-pause)
    ("s" "Stop" emms-stop)
    ("k" "Seek" emms-seek)
    (">" "Forward" emms-seek-forward)
    ("<" "Backward\n" emms-seek-backward)]

   ["Navigate Library"
    ("n" "Next Line" next-line)
    ("p" "Previous Line" previous-line)
    ("RET" "Open" dired-find-file)
    ("q" "Close" bury-buffer)
    ]
   ["Playlist"
    ("g" "Exit & Goto Playlist" emms :transient nil)
    ("N" "New Playlist" emms-playlist-new)
    ]
   [""
    ("ESC" "Exit Player" transient-quit-one)]
   ])

(define-key dired-mode-map "ä" #'svbck/emms-dired-transient)

Since I am using a Scandinavian keyboard-layout I have bound the transient to "ä" since it is unlikely to be bound to anything else.

I am still torn whether I like the whole transient thing, but it is quite convenient and setting one up is rather straight forward. One thing that I specifically enjoy is that I can name the commands in a way that it makes to me, as opposed to the "usual" approach which shows the full command-name in say "which-key".

In any case have set a few up to make my most-common tasks a little more convenient.

Last updated on: 2024-05-09 Thu 10:05