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
Don't configure a package if not installed? #693
Comments
The Do you have a specific reason you don't want to just use |
Use-package uses Edit: This isn't really necessary if you don't have |
I think you should use |
I've now added such an example to the use-package manual: https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-29&id=a17a6036dd4549514c7cecc7cdd93a571bf57ece This change will be a part of the use-package shipped with Emacs 29. I'm therefore closing this issue. |
* doc/misc/use-package.texi (Conditional loading): Expand section with examples. Resolves jwiegley/use-package#693
I don't really understand why people want to use |
What's the best way to not configure a package if it's not installed?
Suppose I have this in my
.emacs.el
:If I don't have web-mode installed, the
:config
part will never trigger, but looks like the:mode
setting is still done. So if I try to open a HTML file, it will complain about cannot loading web-mode. Ideally, it would be best that if web-mode is not installed the wholeuse-package
call is disabled. I suppose I can put a:if (package-installed-p 'web-mode)
there, but that only works if web-mode is installed through elpa (I'm not sure, is that true?). It could also be slower than necessary (again I'm not sure. Is it slow?). Is there a better way?The text was updated successfully, but these errors were encountered: