danielfm / smudge

Control the Spotify app from within Emacs.
https://asciinema.org/a/218654
GNU General Public License v3.0
309 stars 47 forks source link

Add a transient map for frequent commands #84

Closed magne-hov closed 9 months ago

magne-hov commented 2 years ago

Hi, thanks for this nice package.

I like to invoke smudge-command-map with a prefix key, but that means that I need quite a few key presses if I want to skip multiple tracks or change the volume by multiple increments.

I find that a transient keymap solves this pretty well for me. It lets me define frequent commands that I can repeat without needing to repeat the prefix. While the transient map is active any other key will work as normal and deactivate the transient map. This is the same way that test-scale-adjust lets you repeat itself without repeating the C-x prefix.

I've added a defcustom so that this feature can be enabled optionally:

(use-package smudge
  :custom
  (smudge-player-use-transient-map t)
  :bind-keymap
  ("C-c M-s" . smudge-command-map))

I thought I'd share this here in case other were interested in having similar functionality.

danielfm commented 9 months ago

I was wondering about something like this just the other day. Thanks for sharing!

danielfm commented 9 months ago

Works nicely, thanks for the contribution. 😄