]> git.eshelyaron.com Git - emacs.git/commitdiff
Add new option `-always-pin'
authorPhillip Lord <phillip.lord@russet.org.uk>
Wed, 20 Jan 2016 22:02:26 +0000 (22:02 +0000)
committerPhillip Lord <phillip.lord@russet.org.uk>
Wed, 20 Jan 2016 22:02:26 +0000 (22:02 +0000)
`use-package-always-pin' allows a default archive (or manual) to be
specified for all use-package statements, unless explicitly overridden.

lisp/use-package/use-package.el

index a359e946378147899d2943aabae779fedb9e068d..a76b0473d7e06d7f8b3c44223b9e22cd6414ceda 100644 (file)
@@ -71,6 +71,11 @@ then the expanded macros do their job silently."
   :type 'sexp
   :group 'use-package)
 
+(defcustom use-package-always-pin nil
+  "Treat every package as though it had specified `:pin SYM."
+  :type 'symbol
+  :group 'use-package)
+
 (defcustom use-package-minimum-reported-time 0.1
   "Minimal load time that will be reported.
 
@@ -1075,6 +1080,11 @@ this file.  Usage:
                    (if use-package-always-ensure
                        (use-package-plist-maybe-put
                         args0 :ensure use-package-always-ensure)
+                     args0)))
+           (args* (use-package-sort-keywords
+                   (if use-package-always-pin
+                       (use-package-plist-maybe-put
+                        args* :pin use-package-always-pin)
                      args0))))
 
       ;; When byte-compiling, pre-load the package so all its symbols are in