would try -- by invoking @code{package-vc-install} -- to install the
latest commit of the package @code{foo} from the specified remote.
-This can also be used for local packages, by combining it with the
-@code{:load-path} (@pxref{Load path}) keyword:
+@vindex use-package-vc-prefer-newest
+Alternatively, the @code{use-package-vc-prefer-newest} user option
+exists to always prefer the latest commit.
+
+The @code{:vc} keyword can also be used for local packages, by
+combining it with @code{:load-path} (@pxref{Load path}):
@example
@group
*** New ':vc' keyword.
This keyword enables the user to install packages using 'package-vc'.
++++
+*** New user option 'use-package-vc-prefer-newest'.
+This allows the user to always install the newest commit of a package
+when using the ':vc' keyword.
+
** Gnus
*** The 'nnweb-type' option 'gmane' has been removed.
:type 'boolean
:group 'use-package)
+(defcustom use-package-vc-prefer-newest nil
+ "Prefer the newest commit over the latest release.
+By default, much like GNU ELPA and NonGNU ELPA, the `:vc' keyword
+tracks the latest stable release of a package. If this option is
+non-nil, the latest commit is preferred instead. This has the
+same effect as specifying `:rev :newest' in every invocation of
+`:vc'.
+
+Note that always tracking a package's latest commit might lead to
+stability issues."
+ :type 'boolean
+ :version "30.1"
+ :group 'use-package)
+
(defvar use-package-statistics (make-hash-table))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(if (and s (stringp s)) (intern s) s))
(normalize (k v)
(pcase k
- (:rev (cond ((or (eq v :last-release) (not v)) :last-release)
- ((eq v :newest) nil)
- (t (ensure-string v))))
+ (:rev (pcase v
+ ('nil (if use-package-vc-prefer-newest nil :last-release))
+ (:last-release :last-release)
+ (:newest nil)
+ (_ (ensure-string v))))
(:vc-backend (ensure-symbol v))
(_ (ensure-string v)))))
(pcase-let ((valid-kws '(:url :branch :lisp-dir :main-file :vc-backend :rev))