Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification on :if and :when behavior #1157

Closed
Arian-D opened this issue Apr 9, 2024 · 2 comments
Closed

Clarification on :if and :when behavior #1157

Arian-D opened this issue Apr 9, 2024 · 2 comments
Labels

Comments

@Arian-D
Copy link

Arian-D commented Apr 9, 2024

Hi,

My config is a collection of (use-package ...) statements, and in most of them I use :when for loading a package under certain conditions. For instance, I have the following block in my config

(use-package geiser-guile
    :when (executable-find "guile")
    :after geiser)

and I have straight-use-package-by-default set to t. My (previous) understanding was that the :when would prevent geiser-guile from being cloned if I didn't have Guile on my path (similar to :disabled), but that doesn't seem to be the case; (macroexpand '(use-package abc :if (= 1 2))) reveals that the condition is used after straight-use-package is called.

It's not a request to change it, and I just wanted to know if that is intentional. If it is, I'll just do something like (when (= 1 2) (use-package ...)) in my config.

Thank you.

@raxod502
Copy link
Member

I think #1158 should clarify this, does it answer the question adequately? Sorry for the delay.

raxod502 added a commit that referenced this issue Apr 28, 2024
…ditionally

[#1157] Clarify :if and :when behavior
@Arian-D
Copy link
Author

Arian-D commented May 2, 2024

I forgot to close this.

It absolutely does address my question! I very much appreciate the explanation, and I will most likely use your radian-use-package macro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants