smudge icon indicating copy to clipboard operation
smudge copied to clipboard

`smuge-controller` doesn't seem to be defined until I run some command

Open alexsieusahai opened this issue 3 years ago • 4 comments

Hi, great package, mostly no hiccups.

I'm using basically a vanilla spacemacs on the current develop branch.

I totally apologize if I'm missing something obvious btw

I'm trying to rebind stuff like this:

;; keybinds
(with-eval-after-load 'evil
  ;; prev / next
  ;; note; these will return 403 errors if the query doesn't make logical sense;
  ;; if there's nothing previous (like if you selected a track), then it'll return a 403
  (define-key evil-normal-state-local-map (kbd "SPC m j") 'smudge-controller-next-track)
  (define-key evil-normal-state-local-map (kbd "SPC m k") 'smudge-controller-previous-track)

  ;; search
  (define-key evil-normal-state-local-map (kbd "SPC m t /") 'smudge-track-search)
  (define-key evil-normal-state-local-map (kbd "SPC m l /") 'smudge-my-playlists)
  (define-key evil-normal-state-local-map (kbd "SPC m l /") 'smudge-playlist-load-more)

  ;; volume
  (define-key evil-normal-state-local-map (kbd "SPC m v k") 'smudge-controller-volume-up)
  (define-key evil-normal-state-local-map (kbd "SPC m v j") 'smudge-controller-volume-down)

  ;; various toggles
  (define-key evil-normal-state-local-map (kbd "SPC m t p") 'smudge-controller-toggle-play)
  (define-key evil-normal-state-local-map (kbd "SPC m t s") 'smudge-controller-toggle-shuffle)
  (define-key evil-normal-state-local-map (kbd "SPC m t r") 'smudge-controller-toggle-repeat))

But nothing seems to be defined (Symbol's function definition is void: smudge-controller-next-track if I try to eval (smudge-controler-next-track), for example), at least until I run some command, like (smudge-my-playlists).

Indeed, if I append (smudge-my-playlists) to the above keybinds snippet, everything loads fine...

Any idea why this might be the case?

alexsieusahai avatar Jan 27 '22 21:01 alexsieusahai

Btw, my super ugly bandaid fix is just do this

(smudge-my-playlists)
(sleep-for 1)
(kill-buffer "*Playlists: <acc_name>*")

before running the above snippet, if anyone else stumbles upon this and doesn't mind a poor fix in the meanwhile.

alexsieusahai avatar Jan 27 '22 21:01 alexsieusahai

I have encountered the same issue on Spacemacs.

sjhuang26 avatar Mar 01 '22 18:03 sjhuang26

This package does NOT play nice with Spacemacs' lazy loading. Doing a manual install should fix this issue, as it did for me.

magicaldave avatar Jan 06 '23 18:01 magicaldave

I only tested this with Doom and in my old vanilla Emacs dotfiles. So if any Spacemacs user is willing to contribute a fix, I will get it merged.

danielfm avatar Dec 05 '23 20:12 danielfm