From 9e54b103366aaef8e303bf65787ad841c56483d1 Mon Sep 17 00:00:00 2001 From: Tony Zorman Date: Thu, 29 Dec 2022 12:23:56 +0100 Subject: [PATCH 2/2] ; Document use-package's :vc keyword * doc/misc/use-package.texi (Installing packages): (Install package): Add documentation for :vc and link to the related chapter in the Emacs manual. * etc/NEWS: Mention :vc keyword --- doc/misc/use-package.texi | 40 +++++++++++++++++++++++++++++++++++++-- etc/NEWS | 10 ++++++++++ 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/doc/misc/use-package.texi b/doc/misc/use-package.texi index c587d23d74..a4abbb77f9 100644 --- a/doc/misc/use-package.texi +++ b/doc/misc/use-package.texi @@ -1564,8 +1564,10 @@ Installing packages (@pxref{Package Installation,,, emacs, GNU Emacs Manual}). The @code{use-package} macro provides the @code{:ensure} and @code{:pin} keywords that interface with that package manager to automatically -install packages. This is particularly useful if you use your init -file on more than one system. +install packages. Further, the @code{:vc} keyword may be used to +control how package sources are fetched (@pxref{Fetching Package +Sources,,, emacs, GNU Emacs Manual}). This is particularly useful if +you use your init file on more than one system. @menu * Install package:: @@ -1617,6 +1619,40 @@ Install package You can override the above setting for a single package by adding @w{@code{:ensure nil}} to its declaration. +@findex :vc +The @code{:vc} keyword can be used to control how packages are +fetched. It accepts the same arguments as +@code{package-vc-selected-packages}, except that a name need not +explicitly given: it is inferred from the declaration. Further, the +accepted property list is augmented by a @code{:rev} keyword, which +has the same shape as the @code{REV} argument to +@code{package-vc-install}. + +For example, + +@lisp +@group +(use-package foo + :vc (:url "https://bar.com/foo")) +@end group +@end lisp + +would try—by invoking @code{package-vc-install}—to install 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: + +@lisp +@group +(use-package foo + :vc t + :load-path "/path/to/foo/) +@end group +@end lisp + +The above dispatches to @code{package-vc-install-from-checkout}. + @node Pinning packages @section Pinning packages using @code{:pin} @cindex installing package from specific archive diff --git a/etc/NEWS b/etc/NEWS index 83aa81eb4b..d8e8ed0dd2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -108,6 +108,16 @@ This command either fills a single paragraph in a defun, such as a doc-string, or a comment, or (re)indents the surrounding defun if point is not in a comment or a string. It is by default bound to 'M-q' in 'prog-mode' and all its descendants. + +** use-package + +*** New ':vc' keyword +This keyword enables the user to control how packages are fetched by +utilising 'package-vc.el'. By default, it relays its arguments to +'package-vc-install', but—when combined with the ':load-path' +keyword—it can also call upon 'package-vc-install-from-checkout' +instead. + * New Modes and Packages in Emacs 30.1 -- 2.39.0