In my init.el I want use "use-package" to lazily load my mode and speed up my emacs start.
I want use-package automatically download my mode from elpa/melpa/... thanks to package lib.
But it seems I need to do a (package-refresh-contents) before each time otherwise use-package raise an error.
(error "Package `deft' is not available for installation")
my conf is
(require 'use-package)
(package-refresh-contents) ; take forever at each emacs start
(use-package deft
:ensure t)
but (package-refresh-contents) take forever. can't we delegate the (package-refresh-contents) to use-package so it is done once ?
use-package
does not provide this functionality. You could use the following instead:
(unless package-archive-contents
(package-refresh-contents))
This will only update the package list, if it is empty, which should be sufficient to avoid your problem. You still need to manually update packages, though, with M-x list-packages
and U
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With