Auto-install Emacs 30 in Codespaces - #8
Merged
Merged
Conversation
Add an install_emacs step to install-codespaces.sh that pulls Emacs 30 (emacs-nox) from ppa:ubuntuhandbook1/emacs, which ships Emacs 30 debs for both Ubuntu 22.04 and 24.04. Wired into main() via run_step so a PPA hiccup does not abort the rest of the install. Adds bats coverage and a README note. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds automatic installation of Emacs 30 (terminal-only emacs-nox) during Codespaces bootstrap by introducing a new install step in the Codespaces installer, plus Bats coverage and a README note describing the behavior.
Changes:
- Add an
install_emacsstep toinstall-codespaces.shand wire it intomain()viarun_step. - Add
tests/install_emacs.batsto validate the expected commands are invoked (via stubs). - Update README Codespaces section to mention Emacs 30 installation via the specified PPA.
Show a summary per file
| File | Description |
|---|---|
| install-codespaces.sh | Introduces install_emacs() and runs it during Codespaces setup. |
| tests/install_emacs.bats | Adds Bats tests for PPA addition and package installation behavior. |
| README.md | Documents the new Emacs installation behavior for Codespaces. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Low
Chain install_emacs commands with && so an intermediate failure (e.g. add-apt-repository) propagates a non-zero status to run_step instead of silently falling through to the distro Emacs. Drop the unused hyphenated add-apt-repository stub from the bats test, which some shells reject in export -f. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Codespaces VMs run Ubuntu 22.04 or 24.04, whose default apt repos ship older Emacs versions. I want Emacs 30 available automatically whenever a Codespace starts.
What
Adds an
install_emacsstep toinstall-codespaces.shthat installs Emacs 30 (emacs-nox) from theppa:ubuntuhandbook1/emacsPPA, which provides Emacs 30 debs for both 22.04 (Jammy) and 24.04 (Noble). The function ensuressoftware-properties-commonis present, adds the PPA, then installs the package.It is wired into
main()via the existingrun_stephelper, so a PPA hiccup degrades gracefully and does not abort the rest of the install.Notes
emacs-nox(terminal-only) is intentional since Codespaces is headless, avoiding GUI dependencies.tests/install_emacs.batscovering PPA addition and package install (sudo/add-apt-repository stubbed), and a short README note.bats tests/passes 5/5 andshellcheckis clean.