Transient for convenience with emms
Table of Contents
A new version of Transient, so here’s my media helper
- EDIT 2023335b Added the image showing a better styled result, which captures semantic keys
- EDIT 2023335 Added the image showing the styled1 result, and added the code for
tsa/jump-to-music
This was posted to Reddit.2
With the recent announcement of a new version of Transient, I thought I would post the transient helper I wrote for the deeply customizable built-in-to-emacs emms music player, which I have been enjoying once I stopped thinking of it as Winamp or Spotify or whatever player I used previously.
tsa/transient-emms
(transient-define-prefix tsa/transient-emms ()
"EMMS music"
:transient-non-suffix 'transient--do-quit-one
["EMMS"
["Controls"
("p" "⏯ Play/Pause" emms-pause)
("s" "⏹ Stop" emms-stop)
("S" "⏲ Seek to time" emms-seek-to)
("n" "⏭ Next" emms-next)
("B" "⏮ Back (Previous)" emms-previous)
("b" "⏪ Back rewind" emms-seek-backward :transient transient--do-stay) ;; I want the transient to stay open on just these commands, so I can easily repeat them
("f" "⏩ Fast-Forward" emms-seek-forward :transient transient--do-stay)]
["Playlist"
("N" "Cue Next" emms-cue-previous)
("P" "Cue Previous" emms-cue-previous)
("r" "🔀 play Random" emms-random)
("R" "🔀 toggle shuffle" emms-toggle-random-playlist)
]
["Global/External"
("d" "📂 emms Dired" emms-play-dired)
("u" "Music dir" tsa/jump-to-music) ;; invokes a bookmark, which in turn hops to my bookmarked music directory
("m" "Modeline" emms-mode-line-mode)
("M" "current info" emms-show)
("e" "emms" emms)]
])
Just bind this to a global key and I start enjoying music and podcasts.
tsa/jump-to-music
By request, here is the little snippet that visits my bookmarked directory “Music”.
(defun tsa/jump-to-music (&optional _)
"Jump to the Music bookmark"
(interactive "P")
(bookmark-jump "Music"))
Footnotes
1 When I upgraded Transient, the styles had all taken values from Proto Silas Modus themes, which favor a more muted schema than my eyes prefer. I went in and changed them to be more obvious, using the customizer to track down what I hope are the bottom of the style inheritance chain.
2 Comments are welcome there. https://www.reddit.com/r/emacs/comments/18722tq/my_emms_transient/