summaryrefslogtreecommitdiff
path: root/lisp/use-package
diff options
context:
space:
mode:
authorRadon Rosborough <radon.neon@gmail.com>2017-02-13 12:48:48 -0800
committerRadon Rosborough <radon.neon@gmail.com>2017-02-13 12:48:48 -0800
commit482c8e57289a1b465676fc5469d70856a5afda3c (patch)
treef3871363e25f0ec6b9847feb82b54e084633bf3e /lisp/use-package
parent8fa6e8823be90d605b46ab30f9242588cdeafeba (diff)
downloademacs-482c8e57289a1b465676fc5469d70856a5afda3c.tar.gz
emacs-482c8e57289a1b465676fc5469d70856a5afda3c.tar.bz2
emacs-482c8e57289a1b465676fc5469d70856a5afda3c.zip
Fix use-package-defaults
This patch should address issues https://github.com/jwiegley/use-package/issues/428 and https://github.com/jwiegley/use-package/issues/429. See https://github.com/jwiegley/use-package/issues/426 for discussion. In brief, the issue was that use-package-sort-keywords was not applied when the predicates in use-package-defaults did not return true, when it should have been applied unconditionally.
Diffstat (limited to 'lisp/use-package')
-rw-r--r--lisp/use-package/use-package.el14
1 files changed, 5 insertions, 9 deletions
diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el
index 4f5c3fa5100..bba24d923f5 100644
--- a/lisp/use-package/use-package.el
+++ b/lisp/use-package/use-package.el
@@ -1169,16 +1169,12 @@ this file. Usage:
(unless (member :disabled args)
(let ((name-symbol (if (stringp name) (intern name) name))
(args (use-package-normalize-plist name args)))
- (let ((first-spec (car use-package-defaults))
- (rest-specs (cdr use-package-defaults)))
- (when (eval (nth 2 first-spec))
- (setq args (use-package-plist-maybe-put
- args (nth 0 first-spec) (eval (nth 1 first-spec)))))
- (dolist (spec rest-specs)
- (when (eval (nth 2 spec))
- (setq args (use-package-sort-keywords
+ (dolist (spec use-package-defaults)
+ (setq args (use-package-sort-keywords
+ (if (eval (nth 2 spec))
(use-package-plist-maybe-put
- args (nth 0 spec) (eval (nth 1 spec))))))))
+ args (nth 0 spec) (eval (nth 1 spec)))
+ args))))
;; When byte-compiling, pre-load the package so all its symbols are in
;; scope.