1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-17 03:10:58 -08:00

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.
This commit is contained in:
Radon Rosborough 2017-02-13 12:48:48 -08:00
parent 8fa6e8823b
commit 482c8e5728

View file

@ -1169,16 +1169,12 @@ this file. Usage:
(unless (member :disabled args) (unless (member :disabled args)
(let ((name-symbol (if (stringp name) (intern name) name)) (let ((name-symbol (if (stringp name) (intern name) name))
(args (use-package-normalize-plist name args))) (args (use-package-normalize-plist name args)))
(let ((first-spec (car use-package-defaults)) (dolist (spec use-package-defaults)
(rest-specs (cdr use-package-defaults))) (setq args (use-package-sort-keywords
(when (eval (nth 2 first-spec)) (if (eval (nth 2 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
(use-package-plist-maybe-put (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 ;; When byte-compiling, pre-load the package so all its symbols are in
;; scope. ;; scope.