GNU Emacs packages

ID

emacs

Home page

https://www.gnu.org/software/emacs/

Platforms

🐧 Linux · 🍎 macOS · 🪟 Windows

Operations

installed · install · remove · sync

purl types

pkg:emacs

CLI name

emacs

Issues and PRs

📦 manager: emacs

Source

meta_package_manager/managers/emacs.toml

GNU Emacs’s own package manager, package.el, driven headlessly (https://www.gnu.org/software/emacs/).

A package is a symbol from an ELPA archive, and every verb takes that symbol: the inventory prints it, and install and removal both accept it. The archives are the registry, GNU ELPA and NonGNU ELPA being configured out of the box.

Every operation is one emacs --batch --eval invocation, so the output format is chosen here rather than parsed out of whatever the tool prints. The inventory’s format string and the pattern below are therefore written together, and neither can drift without the other.

Parsing notes, verified against GNU Emacs 31.1 on macOS:

  • package-initialize is mandatory in batch mode. emacs --batch skips the init file, so package-alist is empty until it runs, and the inventory would report nothing at all rather than failing.

  • The inventory holds only what package.el installed. Emacs’s own bundled libraries are not in package-alist, which is the right scope: they are part of the editor rather than packages a user manages.

  • An empty inventory prints nothing and exits 0, so it is honest rather than an error.

  • Removal takes the package description rather than the symbol, hence the alist-get lookup: package-delete refuses a bare symbol.

  • sync is package-refresh-contents, which contacts every configured archive and is the only read that reaches the network.

Todo

Declare outdated, upgrade_all and search. All three are expressible as further --eval forms, comparing package-alist against package-archive-contents, but none was captured on the drive that produced the samples below and no operation is declared from a form that was not run.

What mpm adds to emacs

mpm reaches across every manager at once, not emacs alone: mpm installed and mpm outdated cover emacs alongside every other manager you run in one table, mpm upgrade --all updates them together, and mpm sbom exports the whole machine as one bill of materials.

Every mpm command also gains --dry-run and --plan previews, cross-scheme version comparison and purl identifiers. See manager augmentations for how each one is built.

Your emacs commands, in mpm

You already know emacs: each operation maps one-to-one onto mpm, in an interface shared by every manager.

To…

With emacs

With mpm

List what’s installed

emacs --batch --eval (progn (require (quote package)) (package-initialize) (dolist (p package-alist) (princ (format "%s %s\n" (car p) (package-version-join (package-desc-version (cadr p)))))))

mpm --emacs installed

Install a package

emacs --batch --eval (progn (require (quote package)) (package-initialize) (package-install (quote <package_id>)))

mpm install pkg:emacs/(progn (require (quote package)) (package-initialize) (package-install (quote <package_id>)))

Remove a package

emacs --batch --eval (progn (require (quote package)) (package-initialize) (package-delete (car (alist-get (quote <package_id>) package-alist))))

mpm remove pkg:emacs/(progn (require (quote package)) (package-initialize) (package-delete (car (alist-get (quote <package_id>) package-alist))))

Prefix any command above with --dry-run to simulate the underlying manager calls without touching the system: the safe way to watch what mpm would do before trusting it.

Operations

Operation

Supported

installed

outdated

orphans

search

install

upgrade

upgrade_all

remove

sync

cleanup

doctor

Selecting and configuring emacs

Deselect emacs for a single run with --no-emacs, or persist the choice in your configuration:

[mpm]
emacs = false

Keep it enabled but tune how mpm drives it with a per-manager override:

[mpm.managers.emacs]
timeout = 900

mpm config-template emacs prints every overridable attribute as a ready-to-paste block.

Recipes

A few jobs you would otherwise script around emacs, one mpm command each:

  • Snapshot and clone a machine: mpm --emacs dump emacs.toml, then mpm restore emacs.toml on the next one.

  • Export a compliance SBOM: mpm --emacs sbom (CycloneDX by default, --spdx for SPDX).

Privilege escalation

mpm runs this manager as the current user and never prepends sudo by default. Flip the policy for its privileged operations with --sudo or the per-manager sudo override.

None of its operations needs root.

See privilege escalation for the full policy.

Cooldown

State of GNU Emacs packages’s release-age gating, from the cooldown support table:

Status: ❌ None (ELPA archives publish versions, never dates)

A cooldown only pays off where a compromised release can be withdrawn while the clock runs, and can only be emulated where the registry dates its releases. From the retraction table:

  • Registry: ELPA archives

  • Retraction: Archive drop: a package lives in an archive index its maintainers regenerate, so a version is withdrawn by the archive ceasing to list and serve it

  • Publish date: ❌ an archive entry carries a version and its dependencies, never a publication date

With --cooldown set, mpm skips this manager’s install and upgrade operations rather than run them unguarded (fail-closed); --cooldown best-effort opts back in.

Version probe

The version is probed by running:

$ emacs --version
GNU Emacs 31.1
Copyright (C) 2026 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.

and extracted with:

r"GNU Emacs\s+(?P<version>\S+)"

Reference traces

Raw native outputs captured in the bundled definition: the reference mpm’s parsers were written against. If you know GNU Emacs packages well and a transcript below looks wrong, or a newer release changed its output format, report it.

$ emacs --batch --eval (progn (require (quote package)) (package-initialize) (dolist (p package-alist) (princ (format "%s %s\n" (car p) (package-version-join (package-desc-version (cadr p)))))))
queue 0.2

Feed any of these through mpm and the raw output becomes one uniform table, the same shape for every manager: filter it, project columns, or export it (mpm --emacs installed --output json, or csv, toml, yaml), each package carrying a purl and a version comparable across managers.

Changelog

  • 8.0.0.dev0 (unreleased)

    • Add GNU Emacs package manager, driving package.el headlessly for inventory, install, remove and archive refresh.