emacsorphanage / req-package

dependency management system on top of use-package
GNU General Public License v3.0
152 stars 14 forks source link

problem executing :config #37

Closed jave closed 6 years ago

jave commented 8 years ago

In the code below, org-config doesnt seem to execute. I have many other calls to :config in my init, and they all seem to work, so this is weird. The :bind seems to work also.

(req-package org-plus-contrib :require org-contacts org-man :bind (( " p" . org-capture) ( " a" . org-agenda) ( "\C-cl" . org-store-link) ( "\C-cb" . org-iswitchb)) :config (org-config) ;;i had problems getting the conf code to execute, so i moved it to defun so i can run it as a workaround )

ivan-m commented 7 years ago

I think the behaviour is that this is only lazily evaluated/run when the :binds are evaluated (which are probably wrong unless you want any time you hit a to run org-agenda as it's in the global key map).

edvorg commented 7 years ago

Hi. config is evaluated after one of bindings triggers the package loading and it's only evaluated once. Basically binding generates autoload for corresponding function and config is executed after org-plus-contrib is loaded. It's save to call any functions defined in org-plus-contrib in config section. I should also note that require section can also block config from calling. It's evaluated only after org-contacts and org-man are loaded as well. If those are delayed for loading in some way it will block your config section from evaluation. To summarize the order to execution will look like.

edvorg commented 6 years ago

Closing due to no activity