-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
emacs: Add basic tree-sitter support #219559
Conversation
This commit adds basic support for tree-sitter in the emacs build, such that (if the user opts into tree-sitter support), tree-sitter will be enabled and binary library files for tree-sitter can be included in the `lib` directory of packages passed to `emacsWithPackages`. The libraries will be aggregated and included in treesit-extra-load-path. The previous pattern for this in the community was to add tree-sitter libaries by patching emacs's `RUNPATH` with `patchelf` in a post-fixup phase. However, this has the substantial drawback that two different emacs installations with different lists of available tree-sitter libraries must be entirely separate builds. By supplying the tree-sitter libraries in the wrapping layer of `emacsWithpackages`, it becomes possible to share a single, more-cacheable "core emacs". This support defaults to "on" only in emacs 29 and up, since previous versions do not support tree-sitter out of the box.
I think you also need to add |
Does setting that variable on the emacs mkDerivation args actually do anything? I'm not aware of anything that reads it and everything seems to work just fine without it on my Linux system. Is it possibly relevant on Darwin? |
Sorry, you are right, it's not needed. I was using the emacs overlay as reference, but it seems to be outdated. |
No worries! I just followed the upstream instructions from Emacs. |
@adisbladis Do you think you could review this? It seems like some others are eager to see this go in ( ❤️'s on the PR) plus, selfishly, it would let me stop having to update my nixpkgs fork 😉. |
This looks great! |
Thanks for the merge! |
Description of changes
From the commit message:
Additional notes:
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)