Skip to content

Commit

Permalink
Add :demand t because :hook defers
Browse files Browse the repository at this point in the history
  • Loading branch information
oantolin committed Jan 15, 2021
1 parent a3436a4 commit 47daded
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
(use-package embark-consult
:ensure t
:after (embark consult)
:demand t ; only necessary if you have the hook below

This comment has been minimized.

Copy link
@minad

minad Jan 15, 2021

Contributor

Just to understand, I always found that confusing - since :after is specified, embark-consult will still be loaded lazily after embark and consult? And demand is only necessary in order to not further defer loading because of the hook?

This comment has been minimized.

Copy link
@oantolin

oantolin Jan 15, 2021

Author Owner

It is confusing! And you are exactly right: without :demand t loading would happen when the hook is run for the first time; with the :demand t it is still delayed until both consult and embark are loaded. To be honest, I often have to macroexpand use-package to make sure it's doing the right thing.

This comment has been minimized.

Copy link
@minad

minad Jan 15, 2021

Contributor

Thank you! Yes, I should have just macroexpanded the thing to see. But it seems logical like this.

;; if you want to have consult previews as you move around an
;; auto-updating embark collect buffer
:hook
Expand Down Expand Up @@ -245,6 +246,7 @@ reasonable starting configuration:
(use-package embark-consult
:ensure t
:after (embark consult)
:demand t ; only necessary if you have the hook below
;; if you want to have consult previews as you move around an
;; auto-updating embark collect buffer
:hook
Expand Down
2 changes: 2 additions & 0 deletions embark.texi
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ preview automatically as you move around the collect buffer.
(use-package embark-consult
:ensure t
:after (embark consult)
:demand t ; only necessary if you have the hook below
;; if you want to have consult previews as you move around an
;; auto-updating embark collect buffer
:hook
Expand Down Expand Up @@ -337,6 +338,7 @@ reasonable starting configuration:
(use-package embark-consult
:ensure t
:after (embark consult)
:demand t ; only necessary if you have the hook below
;; if you want to have consult previews as you move around an
;; auto-updating embark collect buffer
:hook
Expand Down

0 comments on commit 47daded

Please sign in to comment.