Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
`:if` keyword only work if package was installed previously #496
Comments
|
Yes.. edit: I'm not sure anymore by looking at the code..The code has changed a lot since i last read it. |
|
Note that the intended way of disabling a configuration is not |
caadar
commented
Aug 16, 2017
•
|
Well, Actually needed ability to conditionally install and load a package, say
always prevent package install/loading when window system not present despite of Feel free to close the issue if this not a bug. |
|
Since I didn't write the |
caadar
commented
Aug 18, 2017
|
This is not a bug. Logic may be changed by May be it's worth to set this as dafault for |
|
This sounds like a good solution. Anyone disagree?
|
caadar
commented
Aug 19, 2017
•
|
According to
so consider to place |
caadar
referenced this issue
in raxod502/straight.el
Aug 19, 2017
Closed
use-package :if keyword does not work with straight.el #132
|
Playing devil's advocate, one might also want a package to be installed unconditionally, but only configured and/or loaded Since I don't use |
|
@caadar FYI, I believe that |
caadar
commented
Aug 19, 2017
|
@raxod502 thanx for explonation about
Why? Just set it back The question is about sane default value. |
|
@caadar IMO, having the user set Not that I'm saying it doesn't make sense to provide a customization option for whether |
caadar
commented
Aug 19, 2017
The reason I lobbing the change :) BTW, wrapping |
caadar
commented
Aug 19, 2017
|
I'm not disagreeing with your goal; I'm just saying that a mechanism based on end-user modification of I mean, what would the documentation look like? "If you want Of course, if we think that the current behavior is just plain wrong, and nobody should be allowed to use it, then your proposal makes perfect sense: it's only if we want to support both use cases that there would be a problem.
I think modifying Maybe @jwiegley can elaborate on how |
caadar
commented
Aug 19, 2017
|
Agreed completely! |
|
Well,. subtle errors form upgrades are possible with any package which has a defcustom. If you really want to be bothered with it you could do something in your emacs init after loading use-package which checks if the default value has changed. I haven't really tested this code properly but it should be about right: (unless
(equal
(cadr (car (get 'use-package-keywords 'standard-value)))
'(:disabled :preface :pin :defer-install :ensure :if :when :unless :requires :load-path :no-require :bind :bind* :bind-keymap :bind-keymap* :interpreter :mode :magic :magic-fallback :commands :defines :functions :defer :init :after :demand :config :diminish :delight))
(warn "use-package-keywords default value has changed!"))You can also load the list value and rearrange it in elisp code instead of setting it to a static value. |
Yes, so I think defcustoms should be kept as simple as possible, and defcustoms should not be created for things which will cause subtle bugs if the default values are changed. In this case, the user should not actually be customizing
I would actually use
Yes, that's what packages which extend |
|
I agree that it probably should't be a |
|
Agreed. It's definitely not a generally soluble problem. However, I think that if we make it so that the user never has to mess with I am currently experimenting with a more general weighted-priority middleware model for |
|
|
shackra
commented
Sep 17, 2017
|
I recently got bitten by this bug (?) Weechat package won't work on Windows because when it is byte compiled the error Even if I use Maybe a workaround for me is to set |
shackra
commented
Sep 20, 2017
|
I see, thanks @raxod502 |
caadar commentedAug 16, 2017
Let's test it e.g. with
asyncpackage.emacs -Q:=> nil, yes
asyncnot installed.=> t, but nil expected cuz
:if nil.=> t, so why it was loaded unconditionally?
After emacs restarted use-package does not load async in case of
:t nil, it's ok.Is this intended behavior?