Skip to content

Unbundle Emacs support after #4692 - #4730

Open
dimpase wants to merge 25 commits into
Macaulay2:developmentfrom
dimpase:unbundle-emacs
Open

dimpase wants to merge 25 commits into
Macaulay2:developmentfrom
dimpase:unbundle-emacs

Conversation

@dimpase

@dimpase dimpase commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Install Emacs support independently from Macaulay2/M2-emacs, instead of downloading, generating and installing it as part of M2.

Remove the Emacs submodule, CMake/Autotools generation and installation rules, source-archive handling, explicit CI/Docker targets, RPM bundled-file entries and installation-layout settings. Preserve Prism, Vim and Pygments generation, runtime communication with Emacs, and the existing documentation node names.

setup() continues to configure command shells. setupEmacs() prompts before replacing its marked block in ~/.emacs, backing up the previous file. The block uses package-vc-install from the independent repository's main branch (Emacs 29+ and Git). Subsequent startups update VC-installed packages when Emacs becomes idle; tarball/distribution packages remain under their existing package manager. Failures do not abort startup, and F12 starts M2. Documentation covers older Emacs and migration from the bundled configuration.

Related issues and pull requests

Depends on: #4758, including its prerequisites #4728 and #4757. This branch has been rebuilt on that replacement stack and no longer contains #4725's selective-submodule machinery. Review the Emacs-only comparison.

#4692 and Macaulay2/M2-emacs#103 have merged. Installation works with the merged M2-emacs main branch and does not require M2-emacs#105–107 or a hosted package archive.

Testing

  • Fresh CMake configuration with absent submodules and GIT_SUBMODULE=OFF and external libraries succeeds on the replacement stack. The editor-target check confirms M2-editors exists and M2-emacs is absent.
  • Six Emacs behavior checks pass. The installer code and its documentation are byte-for-byte unchanged from the previously tested update, which included an actual GitHub package-vc-install, an actual upgrade using a local Git fixture, and documentation parsing with M2 1.26.06.
  • The live LSP smoke test passes initialization, completion and sibling-M2 selection against the launcher and M2-core built from the prerequisite branch. The launcher is unchanged by this PR.
  • The prerequisite branch builds M2-core and editor grammars and passes all 275 engine tests and core smoke tests through both CMake and pkg-config discovery. No-submodules CI coverage is inherited; the existing LSP smoke test remains in CI.
  • Workflow syntax/expression and diff checks pass. Local actionlint uses the existing ubuntu-26.04 label configured explicitly and skips ShellCheck for pre-existing warnings.

A complete rebuild of this Emacs branch, full documentation/package installation, distribution packaging and GUI testing were not repeated locally. The existing macOS Autotools package-install serialization is retained.

Release notes

Install the Emacs interface separately; setupEmacs() uses Emacs's built-in VC package installer.

AI disclosure

  • 5 — AI produced the content with minimal human review.

Tools and models used: OpenAI Codex.
How AI was used: implementation, conflict resolution, restacking, validation and PR description.
Verification: the checks described above were run by Codex.

License

  • My changes use the existing license of the affected files or package.
  • I release my new material under the GNU GPL, version 2 or later.

dimpase and others added 4 commits September 17, 2026 20:56
Prefer compatible CMake package targets, report the selected provider, and retain bundled fallback and unit tests. Guard the Debug ABI and exclude imported memtailor from local target exports.

Co-authored-by: Codex <noreply@openai.com>
Probe the selected target at configuration time and report MEMT_DEBUG explicitly. Propagate its usage requirements and check Debug compatibility for either discovery method.

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Extend provider selection to mathic and mathicgb, validate transitive debug and TBB metadata, preserve library tests, and document mixed-provider constraints.

Co-authored-by: Codex <noreply@openai.com>
@dimpase

dimpase commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

I did a manual check of this PR, together with its companion Macaulay2/M2-emacs#103,
on a Gentoo Linux machine running systemwide emacs 31.1. Looked and worked OK.

@dimpase
dimpase marked this pull request as ready for review September 22, 2026 04:40
@dimpase

dimpase commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

from zulip: @mikestillman @d-torrance

Michael Stillman: I think I'm good removing emacs support from M2.  Just need to make sure it is easy to install...
Michael Stillman: Not from M2, from the M2 git repo...!
Doug Torrance: I'm thinking that we still have setupEmacs work so most folks will never notice
Michael Stillman: yes, that would be good.  But it might need to download the mode...?
Dima Pasechnik: my PRs make setupEmacs into a noop, printing a warning on how to proceed
Doug Torrance: It can edit .emacs so that Emacs will download it when neededMichael Stillman: That sounds like a good way to do that!

OK, let's amend this here.

@dimpase

dimpase commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

I don't like e3cf252 - it messes up with git instead of using an Emacs mechanism to fetch plugin updates

@dimpase

dimpase commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

🤖 wrote:

 I corrected M2 PR 4730: setupEmacs() now writes package.el commands to
  ~/.emacs. It installs M2 on first startup and checks for updates after Emacs
  becomes idle. M2-emacs PR 103 now builds the Macaulay2 package archive. A
  local archive test passed for both installation and upgrade.

  The public archive is not live yet. PR 103 must merge first; its publishing
  workflow then creates the archive that setupEmacs() uses.

@dimpase

dimpase commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

force-push to add missing co-signed commit headers

@d-torrance d-torrance added build issue platform specific issues involving compiling M2, generating examples, or running tests editors waiting for another PR this pull requests depends on another pull request that must be merged first Infrastructure GitHub workflows, etc. AI-generated This PR contains AI-generated code or this issue was written by AI labels Sep 24, 2026
dimpase and others added 4 commits October 23, 2026 19:00
Co-authored-by: Codex <noreply@openai.com>
…es into cmake-no-submodules

# Conflicts:
#	M2/cmake/check-libraries.cmake

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
…ules into unbundle-emacs-replacement

# Conflicts:
#	M2/BUILD/README.md
#	M2/Macaulay2/CMakeLists.txt
#	M2/Macaulay2/editors/CMakeLists.txt

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
@dimpase dimpase mentioned this pull request Oct 24, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-generated This PR contains AI-generated code or this issue was written by AI build issue platform specific issues involving compiling M2, generating examples, or running tests editors Infrastructure GitHub workflows, etc. waiting for another PR this pull requests depends on another pull request that must be merged first

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants