It is not packages that use-package
loads but features (which are things you can require
and test for with featurep
). From this point of view, use-package
is essentially a fancy wrapper for require
.
While use-package
can often seem like magic, you can demystify by placing point after a use-package
stanza and doing M-x pp-macroexpand-last-sexp
. In the case you reference, macro-expanding
(use-package emacs
:delight
(auto-fill-function " AF")
(visual-line-mode))
yields
(if
(not
(require 'emacs nil t))
(display-warning 'use-package
(format "Cannot load %s" 'emacs)
:error)
(if
(fboundp 'delight)
(delight
'((auto-fill-function " AF" emacs)
(visual-line-mode nil emacs)))))
wrapped in some error-checking, messages and timing.
This is helpful: you can use the nice use-package
interface to configure built-in things like dired
.
(featurep 'emacs)
is true. (Who knew?) And the reason is...? I wonder. – Drew Oct 18 '20 at 01:41emacs
feature. I don't know for certain if this is the reason for it existing, but I think it's a good thing that it does. – phils Oct 18 '20 at 09:49emacs
was added as a feature as a consequence ofxemacs
being a feature." – Drew Oct 18 '20 at 15:21