Releases: progfolio/elpaca
v0.1.0
Features
-
Elpaca has been refactored to offer a generic interface.
This means Elpaca can be extended to install different types of packages.
Preliminary support for tarball and local file installations has been added.
Git support has been moved into its own sub-package. -
Elpaca's use-package integration now accepts the
:vcuse-package keyword as well as:straight,:elpaca. Most recipes from package author README's should "just work". -
Elpaca now throws custom error signals where appropriate.
There is a per-recipe:on-errorfor handling errors.
Example:(:on-error (lambda (e err) (message "skipping optional package...") t)) -
There's also a global
elpaca-error-functionshook to handle top-level errors.
For example, If a package you're interested in has recently been added to an ELPA, but you haven't updated your menus since then, you can extend Elpaca to offer to refresh its menu cache:
(elpaca-test
:interactive t
:early-init (setq elpaca-menu-functions '(elpaca-menu-declarations elpaca-menu-melpa))
:init
;; Simulate a menu item not being avaialable in menu cache
(elpaca-update-menus 'elpaca-menu-melpa)
(setf (alist-get 'doct elpaca-menu-melpa--index-cache nil 'remove) nil)
(defun +elpaca-update-menus-on-fail (e err)
"Offer to update menus when a recipe URL is unable to be determined."
(when (and (eq (car err) 'elpaca-url-error)
(yes-or-no-p
(format "Unable to resolve URL for package %S. Update default menus?"
(elpaca<-id e))))
(elpaca-update-menus)
(elpaca-try (elpaca<-declaration e))
t))
(add-hook 'elpaca-error-functions #'+elpaca-update-menus-on-fail)
;; Since we removed the recipe from the menu cache above, this would normally error.
;; With the handler, we can recover and install the package.
(elpaca doct))- Hook functions on
elpaca-order-functionsandelpaca-recipe-functionsare now composable rather than short-circuiting, allowing multiple hooks to cooperate.
Breaking Changes
-
The elpaca-installer script has been updated.
Make sure you've updated it in your init file prior to restarting after updating. -
Anything git specific has been renamed.
(e.g.elpaca-repos-dirhas been renamed toelpaca-source-dir) -
Variables marked obsolete during development (e.g.
elpaca-use-package-by-default) have been removed. -
elpaca-menu-non-gnu-elparenamed toelpaca-menu-nongnu-elpa. -
Most build step functions have been renamed to make custom
:buildsteps easier to write. -
Several internal functions have been renamed :
repo<-dirslot renamed tosource<-dir. -
:pre-buildand:post-buildrecipe keywords replaced by a new:buildstep substitution DSL.
The newelpaca-defscriptandelpaca-with-emacsmacros provides a cleaner way to define custom shell or elisp build scripts.
For example, the following recipe installs the mu4e binary and configures my mailboxes:
(elpaca `(mu4e
:build
((:before elpaca-check-version
,(elpaca-defscript +mu4e-build-binary (:type system)
("bash" "-c" ". ./autogen.sh -Dtests=disabled")
("ninja" "-C" "build")
("ln" "-sf" ,(expand-file-name "./build/mu/mu") ,(expand-file-name "~/bin/mu"))
("mu" "init" "--quiet" "--maildir" ,(concat (getenv "HOME") "/Documents/emails")
"--my-address=" ,(+email-address +email-personal)
"--my-address=" ,(+email-address +email-work)
"--my-address=" ,(+email-address +email-dev))
("mu" "index" "--quiet")))
(:not elpaca-build-compile))))And this example tangles a literate Org project to its elisp source files:
(elpaca-test
:interactive t
:early-init (setq elpaca-menu-functions '(elpaca-menu-extensions))
:init
(elpaca-defscript +org-tangle-package (:type elisp)
(require 'ob-tangle)
(setq org-confirm-babel-evaluate nil)
;; Main process state injected into sub-process via back-quoting.
(org-babel-tangle-file ,(concat (elpaca<-package e) ".org")))
(elpaca (miscellany
:host github :repo ("progfolio/miscellany.el" . "miscellany")
:protocol ssh
:build (:after elpaca-source +org-tangle-package))))For no extra charge, I've thrown in some bugs as well. :)