]> git.eshelyaron.com Git - emacs.git/commitdiff
Add new customization use-package-always-ensure
authorJohn Wiegley <johnw@newartisans.com>
Sat, 21 Mar 2015 09:19:33 +0000 (04:19 -0500)
committerJohn Wiegley <johnw@newartisans.com>
Sat, 21 Mar 2015 09:19:33 +0000 (04:19 -0500)
Fixes https://github.com/jwiegley/use-package/issues/27

lisp/use-package/use-package.el

index c4959ce48da81fef444dc5ffb7148f0986d407f4..78f1281dbb3d8db02557cbe5495a97cf5cf2723c 100644 (file)
@@ -65,6 +65,11 @@ then the expanded macros do their job silently."
   :type 'boolean
   :group 'use-package)
 
+(defcustom use-package-always-ensure nil
+  "Treat every package as though it had specified `:ensure SEXP`."
+  :type 'sexp
+  :group 'use-package)
+
 (defcustom use-package-minimum-reported-time 0.1
   "Minimal load time that will be reported.
 
@@ -973,10 +978,14 @@ this file.  Usage:
   (declare (indent 1))
   (unless (member :disabled args)
     (let* ((name-symbol (if (stringp name) (intern name) name))
+           (args0 (use-package-plist-maybe-put
+                   (use-package-normalize-plist name-symbol args)
+                   :config '(t)))
            (args* (use-package-sort-keywords
-                   (use-package-plist-maybe-put
-                    (use-package-normalize-plist name-symbol args)
-                    :config '(t)))))
+                   (if use-package-always-ensure
+                       (use-package-plist-maybe-put
+                        args0 :ensure use-package-always-ensure)
+                     args0))))
 
       ;; When byte-compiling, pre-load the package so all its symbols are in
       ;; scope.