Skip to content

Route devel plugin AI tooling through pkg/use, not raw :straight wiring - #2

Open
yottanami wants to merge 1 commit into
masterfrom
agent/19-devel-pkg-use
Open

Route devel plugin AI tooling through pkg/use, not raw :straight wiring#2
yottanami wants to merge 1 commit into
masterfrom
agent/19-devel-pkg-use

Conversation

@yottanami

Copy link
Copy Markdown
Owner

Summary

plugins/devel/core.el had leftover pre-Nix package wiring that never got migrated when straight.el was dropped (9822f0a):

  • copilot went through pkg/use (which strips :straight and forces :ensure nil) but also carried an explicit :ensure t in its details. Since pkg/use expands to (use-package copilot :ensure nil ...details...), that explicit :ensure t comes after the macro's own :ensure nil, and use-package's plist normalization takes the last occurrence of a keyword — so :ensure t wins, silently defeating the wrapper.
  • shell-maker and copilot-chat used bare use-package with :straight recipes referencing sources straight.el no longer fetches from, instead of pkg/use like every other package in the file.

What I could confirm, and what I couldn't (no nix/emacs binary in my environment):

  • Confirmed by reading: copilot is absent from nix/emacs.nix's package list; shell-maker/copilot-chat are present. copilot.el is on MELPA, and nixpkgs auto-generates emacsPackages recipes for MELPA, so it's addable the same way copilot-chat already is (not a from-source build like helm-ag).
  • Not confirmed by a live run (issue explicitly asks for this): whether copilot was actually broken before this fix. My reasoning it likely was: with :ensure t winning and the :straight recipe being its only real fetch source, use-package would fall through to package.el's default install path, which needs refreshed package-archive-contents — and this build's pkg/initialize deliberately never sets that up ("no network access, no package manager bootstrap", per its own doc comment). That's static reasoning about documented use-package/package.el behavior, not an observed failure — please verify with a real build.

Changes

  • copilot: dropped the vestigial :straight recipe and the harmful redundant :ensure t, letting pkg/use's :ensure nil actually take effect.
  • shell-maker / copilot-chat: converted to pkg/use, dropped their :straight recipes.
  • nix/emacs.nix: added copilot to the package list.

Out of scope, flagged for a possible follow-up

plugins/editor/core.el:52 (smart-mode-line) has the same kind of leftover :straight recipe, but it's a different file and wasn't named in this issue's acceptance criteria, so I left it alone — harmless today since pkg/use strips it regardless, just the same style inconsistency.

Closes Men-in-Black-5/ideas#19

Test plan

  • Parenthesis-balance check on the edited file — balanced
  • grep -rn ":straight" — no more :straight recipes in plugins/devel/core.el
  • nix flake check / a live build confirming copilot, copilot-chat, shell-maker all load — not possible in my environment, needs a real check

@yottanami

Copy link
Copy Markdown
Owner Author

Reviewed and went a bit further than static reading since I can't run Emacs/Nix either (same environment gap as the PR author): confirmed the core technical claim two ways.

  1. The :ensure t-wins claim: fetched use-package's actual source (use-package-core.el, use-package-normalize-plist) — when a keyword is specified twice, it's re-set via plist-put, so the later occurrence overwrites the earlier one. Since pkg/use splices details in after its own :ensure nil, an explicit trailing :ensure t in details really does win, exactly as described. Not just plausible — confirmed against the library's own merge logic.
  2. emacsPackages.copilot existing: found pkgs/applications/editors/emacs/elisp-packages/manual-packages/copilot/package.nix in nixpkgs via GitHub code search — it's a real, manually-packaged (not MELPA-auto-generated) entry, so adding it to nix/emacs.nix's package list the same way copilot-chat already sits there is valid.

Also verified: balanced parens on the edited file, no remaining :straight references in plugins/devel/core.el, and the shell-maker/copilot-chat conversions to pkg/use are mechanical and match the file's existing style.

Same situation as PR #1 though: no agent can actually load this in Emacs or run nix flake check, so per the current policy this waits for @yottanami to confirm a real build/load before I merge — everything I can verify checks out.

plugins/devel/core.el had leftover pre-Nix package wiring that never
got migrated when straight.el was dropped (9822f0a):

- copilot went through pkg/use (which strips :straight and forces
  :ensure nil) but ALSO carried an explicit :ensure t in its details.
  Since pkg/use expands to (use-package copilot :ensure nil
  ...details...), that explicit :ensure t comes after the macro's own
  :ensure nil and use-package's plist normalization takes the last
  occurrence of a keyword -- so :ensure t wins, silently defeating the
  wrapper. Combined with the (now-stripped) :straight recipe being the
  package's only real fetch source and copilot not being in
  nix/emacs.nix's package list at all, use-package would fall through
  to package.el's default install path, which requires refreshed
  package-archive-contents this build's pkg/initialize deliberately
  never sets up ("no network access, no package manager bootstrap",
  per its own doc comment) -- almost certainly broken today.
- shell-maker and copilot-chat used bare use-package with :straight
  recipes referencing sources straight.el no longer fetches from,
  instead of pkg/use like every other package in the file. Both were
  already in nix/emacs.nix's package list, so they likely worked by
  accident via the global use-package-always-ensure nil default, not
  because the :straight recipe did anything.

copilot.el is on MELPA, and nixpkgs auto-generates emacsPackages
recipes for MELPA, so it's wired into nix/emacs.nix the same way
copilot-chat already is, rather than dropped.

I could not do a live check (no nix/emacs binary in my environment)
to confirm copilot was actually broken before this change, as the
issue asks for -- the above is static analysis of use-package's
documented keyword-precedence behavior, not a confirmed runtime
failure. Please verify with a real build.
@yottanami
yottanami force-pushed the agent/19-devel-pkg-use branch from 1cd8ea9 to 9b6f4c3 Compare July 29, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant