Skip to content

Instantly share code, notes, and snippets.

@sogaiu
Last active November 28, 2025 06:36
Show Gist options
  • Select an option

  • Save sogaiu/db7968ad2995c744531ad1e5dbe22e92 to your computer and use it in GitHub Desktop.

Select an option

Save sogaiu/db7968ad2995c744531ad1e5dbe22e92 to your computer and use it in GitHub Desktop.
building emacs from source with user-specific tree-sitter
# XXX: draft
# user-specific tree-sitter installation is doable via use of PREFIX
# assuming so...
cd ~/src
git clone https://github.com/emacs-mirror/emacs emacs-30.2
cd ~/src/emacs-30.2
git checkout emacs-30.2
TREE_SITTER_CFLAGS=-I$HOME/.local/include \
TREE_SITTER_LIBS="-L$HOME/.local/lib -ltree-sitter" \
./configure --prefix=$HOME/.local \
--with-cairo \
--with-tree-sitter \
--with-gnutls=ifavailable
# may need following during build as well
LD_LIBRARY_PATH=$HOME/.local/lib
# adjust number as appropriate
make -j 4
# failed so tried
make bootstrap
# was in original instructions
#LD_LIBRARY_PATH=$HOME/.local/lib make install
#make install
# may be runnable "in-place"
./src/emacs
# made a symlink to ~/src/emacs-30.2/src/emacs and trying it out...
# following needed for running:
LD_LIBRARY_PATH=$HOME/.local/lib
references
* https://emacs.stackexchange.com/questions/79709/how-to-build-emacs29-with-tree-sitter-without-sudo
* https://blog.markhepburn.com/posts/experimenting-with-the-built-in-treesitter-support-in-emacs/
* https://cgit.git.savannah.gnu.org/cgit/emacs.git/tree/admin/notes/tree-sitter/starter-guide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment