]> git.eshelyaron.com Git - emacs.git/commitdiff
Sort keywords at the appropriate time
authorJohn Wiegley <johnw@newartisans.com>
Fri, 1 Dec 2017 08:44:49 +0000 (00:44 -0800)
committerJohn Wiegley <johnw@newartisans.com>
Fri, 1 Dec 2017 08:44:49 +0000 (00:44 -0800)
lisp/use-package/use-package.el

index 0983500e3a94e927960f0383c5f5352a89ecf68e..2ab0135e753fb1911b1798e5ba64857ab885f9c6 100644 (file)
@@ -1741,11 +1741,10 @@ this file.  Usage:
           (orig-args args)
           (args (use-package-normalize-plist name args)))
       (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))))
+        (setq args (if (eval (nth 2 spec))
+                       (use-package-plist-maybe-put
+                        args (nth 0 spec) (eval (nth 1 spec)))
+                     args)))
 
       ;; When byte-compiling, pre-load the package so all its symbols are in
       ;; scope.
@@ -1769,10 +1768,12 @@ this file.  Usage:
       (let ((body
              (macroexp-progn
               (use-package-process-keywords name
-                (let ((args* (if (and use-package-always-demand
-                                      (not (memq :defer args)))
-                                 (append args '(:demand t))
-                               args)))
+                (let ((args*
+                       (use-package-sort-keywords
+                        (if (and use-package-always-demand
+                                 (not (memq :defer args)))
+                            (plist-put args :demand t)
+                          args))))
                   (when (and use-package-always-ensure
                              (plist-member args* :load-path)
                              (not (plist-member orig-args :ensure)))