]> git.eshelyaron.com Git - emacs.git/commitdiff
Add new customization option `use-package-always-demand`
authorJohn Wiegley <johnw@newartisans.com>
Thu, 22 Dec 2016 17:02:52 +0000 (09:02 -0800)
committerJohn Wiegley <johnw@newartisans.com>
Thu, 22 Dec 2016 17:03:47 +0000 (09:03 -0800)
This is equivalent to adding `:demand t` to all `use-package` declarations,
and has the same semantics as doing so (meaning it can be overridden locally
using `:defer t` in a declaration).

Fixes https://github.com/jwiegley/use-package/issues/423

lisp/use-package/use-package.el

index 29855044241621b060c6d71ba2a8cf415cc59240..cfff54579bc7892d91d1062b21bc703aa965fae6 100644 (file)
@@ -80,6 +80,11 @@ The check is performed by looking for the module using `locate-library'."
   :type 'boolean
   :group 'use-package)
 
+(defcustom use-package-always-demand nil
+  "If non-nil, assume `:demand t` unless `:defer t` is given."
+  :type 'boolean
+  :group 'use-package)
+
 (defcustom use-package-always-ensure nil
   "Treat every package as though it had specified `:ensure SEXP`."
   :type 'sexp
@@ -1171,7 +1176,10 @@ this file.  Usage:
 
       (let ((body
              (macroexp-progn
-              (use-package-process-keywords name args*
+              (use-package-process-keywords name
+                (if use-package-always-demand
+                    (append args* '(:demand t))
+                  args*)
                 (and use-package-always-defer (list :deferred t))))))
         (if use-package-debug
             (display-buffer