Closed FabArd closed 1 year ago
:bind
defers loading (to when you use one of the bound keys), and :config
runs only after the package is loaded. So I think the behavior you're seeing is expected.
Please use :demand t
if you want to load when emacs wake up.
(macroexpand
use-package
is the fastest way to understand use-package
)
(setq use-package-expand-minimally t)
;;=> t
(macroexpand
'(use-package helm
:config
(helm-mode t)
:bind ("M-x" . helm-M-x)))
;;=> (progn
;; (unless (fboundp 'helm-M-x)
;; (autoload #'helm-M-x "helm" nil t))
;; (eval-after-load 'helm
;; '(progn
;; (helm-mode t)
;; t))
;;
;; (bind-keys :package helm ("M-x" . helm-M-x)))
(macroexpand
'(use-package helm
:demand t
:config
(helm-mode t)
:bind ("M-x" . helm-M-x)))
;;=> (progn
;; (require 'helm nil nil)
;; (helm-mode t)
;; t
;; (bind-keys :package helm
;; ("M-x" . helm-M-x)))
I had same issue. This invocation fixed it for me:
(use-package helm
:defer 3
:config
(require 'helm-config)
(helm-mode 1)
:bind
(("M-x" . helm-M-x)
("C-x b" . helm-mini)
("C-x r b" . helm-filtered-bookmarks)
("C-x C-f" . helm-find-files)
("C-x f" . helm-for-files)))
:bind
defers loading (to when you use one of the bound keys), and:config
runs only after the package is loaded. So I think the behavior you're seeing is expected.
I have to agree, this is the expected behavior.
Hi,
I noticed a strange behavior of use-package with helm when using :bind :
When I start Emacs, if no Helm command has been executed, if I use C-h v or C-h f those command do not use helm. After executing a command of helm (for example Helm-M-x) C-h v, C-h f respond with helm.
I noticed that the problem is generated if the key binding is made by ":bind".
Here are the tests I performed :
1 - configuration without problem : (use-package helm :config (helm-mode t) (global-set-key (kbd "M-x") 'helm-M-x))
Restart Emacs and test C-h v or C-h f : responding with Helm
2 - configuration with problem : (use-package helm :config (helm-mode t) :bind ("M-x" . helm-M-x))
Restart Emacs and test C-h v or C-h f : Helm is not responding execute a Helm command (for exempla M-x for the helm-M-x) as define in this config. test again C-h v or C-h f : Helm is responding.