This allows use of variables or even arbitrary expressions to construct
use-package arguments:
(use-package some-package
:mode ,mode-spec
:bind (,binding
,@more-bindings
,@(cl-loop for i from ?a to ?z
collect `(,(string i) . nifty-function))))
This function was not working as advertised.
Then `funcall` was evaluated too early and all the benefits of late evaluation for autoloads was lost.
Furthermore, this function was not really needed in the first place:
```
(use-package foo
:config my-foo-function)
```
can easily be replaced by the following:
```
(use-package foo
:config (my-foo-function))
```
This change an extra level on indirection for two cases:
+ when an association or an alist is required, it is possible to pass a
variable containing an association or an alist
+ when a sexp to be evaluated is required, it is possible to pass a
function instead
Fixes https://github.com/jwiegley/use-package/issues/52: the :config block would be triggered when loading a config
file with the same name as the package and again when loading the
package itself.
The commit 57f80d4 fixed the highlight by following the regexp as for
require. However in Emacs truck, it only highlights first part of the
package name.
This change follows the regexp for require on emacs truck. See line
2327 on font-lock.el in the following patch.
http://bzr.savannah.gnu.org/lh/emacs/trunk/revision/111821
Tweak to previous fix for expanding macros correctly at code-planting time. Specifically, eval `use-package-minimum-reported-time' at code-planting time not at runtime (which would require use-package.el to be loaded first).
The main `use-package' macro incorrectly planted code containing a call to the `with-elapsed-timer' macro in a quoted block to be run by `eval-after-load'. If package use-package was not loaded at runtime, the block would error saying correctly that `with-elapsed-timer' is undefined. This mod correctly macroexpands the block at code generation time.
Some packages such as ECB already provide an autoload file,
so it is this that use-package needs to require. However,
the ELPA name is ecb. This commit allows ensure to take an
argument (other than t).
`diminish' accepts an optional second argument, a replacement string. This change supports all the following arguments to ':diminish':
* package
* (package . "pkg")
* (package1 package2)
* ((package1 . "p1") (package2 . "p2))
The second and fourth formats are new with this change.