Posted on 2023-05-18 · 1 min read · emacs
Just a quick heads-up:
This is not dependent on git,
but should work for all version control systems that Emacs knows about;
see
For more information on the specific syntax,
refer to
use-package
,
which was merged into Emacs in November last year,
now has a :vc
keyword!
The change was merged two days ago,
and supersedes—indeed, is a rewrite of—vc-use-package,
which is now only needed for people who prefer to stick to released versions of Emacs.There is no reason for that, of course.
Building Emacs is just a
away!
In short,
the keyword enables one to install packages directly from their remote source:
BUILD_OPTS=$(emacs \
--batch \
--eval "(prin1 system-configuration-options)")
./autogen.sh
echo "$BUILD_OPTS" | sed 's/^"\(.*\)"$/\1/' \
| xargs ./configure
make bootstrap
sudo make install
(use-package modus-themes
:vc (:url "https://gitlab.com/protesilaos/modus-themes"
:branch "main"))
vc-handled-backends
.
By default,
:vc
installs the latest release of a package—the
last commit that bumped the "Version"
tag inside of the main elisp file
(yes, really).
Installing the most recent commit instead,
which should feel more familiar to users coming from package archives like melpa,
can be done by giving :vc
a :rev :newest
argument.
Additionally,
:rev
can also be used to pin specific revisions of a package.
Other niceties, like specifying alternative lisp directories, are also included:
(use-package vertico
:vc (:url "https://github.com/minad/vertico"
:rev :newest
:lisp-dir "extensions/"))
C-h v package-vc-selected-packages RET
,
and the relevant info node (emacs)Fetching Package Sources
.