]> git.eshelyaron.com Git - emacs.git/commitdiff
use-package-defaults predicate must also receive the package name
authorJohn Wiegley <johnw@newartisans.com>
Wed, 6 Dec 2017 18:51:24 +0000 (10:51 -0800)
committerJohn Wiegley <johnw@newartisans.com>
Wed, 6 Dec 2017 18:51:24 +0000 (10:51 -0800)
lisp/use-package/use-package-core.el
lisp/use-package/use-package-ensure.el

index 4ab8a84a35849b77f497a9671bdd96d5e4bda5fe..fd7d56b271dcf62570d58f51d5d1eb7cbd1abd5f 100644 (file)
@@ -148,15 +148,15 @@ See also `use-package-defaults', which uses this value."
   '(;; this '(t) has special meaning; see `use-package-handler/:config'
     (:config '(t) t)
     (:init nil t)
-    (:catch t (lambda (args)
+    (:catch t (lambda (name args)
                 (not use-package-expand-minimally)))
     (:defer use-package-always-defer
-            (lambda (args)
+            (lambda (name args)
               (and use-package-always-defer
                    (not (plist-member args :defer))
                    (not (plist-member args :demand)))))
     (:demand use-package-always-demand
-             (lambda (args)
+             (lambda (name args)
                (and use-package-always-demand
                     (not (plist-member args :defer))
                     (not (plist-member args :demand))))))
@@ -168,9 +168,9 @@ is a form that can be evaluated to determine whether or not to
 assign a default value; if it evaluates to nil, then the default
 value is not assigned even if the keyword is not present in the
 `use-package' form. This third element may also be a function, in
-which case it receives the list of keywords (in normalized form),
-and should return nil or t according to whether defaulting should
-be attempted."
+which case it receives the name of the package (as a symbol) and
+a list of keywords (in normalized form). It should return nil or
+t according to whether defaulting should be attempted."
   :type `(repeat
           (list (choice :tag "Keyword"
                         ,@(mapcar #'(lambda (k) (list 'const k))
@@ -534,7 +534,7 @@ extending any keys already present."
     (cl-dolist (spec use-package-defaults)
       (when (let ((func (nth 2 spec)))
               (if (and func (functionp func))
-                  (funcall func args)
+                  (funcall func name args)
                 (eval func)))
         (setq args (use-package-plist-maybe-put
                     args (nth 0 spec) (eval (nth 1 spec))))))
index 46de5a8a3a464e7aa104f132e5fcaed7d7851586..3ae8201dc240e031a45b624af04a2c5463379234 100644 (file)
@@ -200,7 +200,7 @@ manually updated package."
 
 (add-to-list 'use-package-defaults
              '(:ensure (list use-package-always-ensure)
-                       (lambda (args)
+                       (lambda (name args)
                          (and use-package-always-ensure
                               (not (plist-member args :load-path))))) t)