Fork me on GitHub
#emacs
<
2021-04-07
>
lukasz17:04:41

I have a not Clojure related question, but it's been bugging me for a while now: I use use-package to manage everything, one of core pieces of my setup is of course Projectile. What's bugging me is that Projectile's keyboard map is not working until I manually invoke one of its functions via M-x (like projectile-find-file) - once that happens, then I can use C-c p f to do the same. Is there any solution to this? (My Google-fu failed me so far)

bozhidar20:04:53

Here's how the author of Projectile does it https://github.com/bbatsov/emacs.d/blob/master/init.el#L307 He's not an expert in use-package, though, so there might be a better approach. 🙂

lukasz20:04:55

Thanks @U051BLM8F - great to hear from the author ;-)

1
dpsutton17:04:19

i think use-package is lazy loading things. if you want that loaded on startup you can add :demand t i think?

👍 1
lukasz18:04:44

Didn't work unfortunately, for now I just call project-version in my init.el ¯\(ツ)

Phil Shapiro17:04:35

I’m not familiar with use-package. I use require, and I haven’t had this problem using it.

dakra18:04:43

Having everything lazy loaded until you need it is actually nice as you don't pay the startup price if you don't need the functionallity. For use-package and projectile I use :bind-keymap in my config (https://github.com/dakra/dmacs/blob/master/init.org#projectile)

bozhidar20:04:26

I never had an issue with require myself, as I don't start Emacs often and I don't care if I load everything eagerly. That being said - I like that use-package forces you to structure your config. It's not like you can't do it without it, but you don't have such a strong incentive to do so. 🙂