Discussion
Loading...

#Tag

Log in
  • About
  • Code of conduct
  • Privacy
  • About Bonfire
Bozhidar Batsov (a.k.a. Bug)
Bozhidar Batsov (a.k.a. Bug)
@bbatsov@hachyderm.io  ·  activity timestamp 3 hours ago

I've converted some random dev notes I had lying around from working on clojure-ts-mode, neocaml and asciidoc-mode to a blog post with some general advice for building #Emacs major modes powered by #TreeSitter https://batsov.com/articles/2026/02/27/building-emacs-major-modes-with-treesitter-lessons-learned/

I hope some of you will find it useful! I certainly wish someone had written such an article a year ago when I started to get more serious about playing with TreeSitter.

#Clojure #OCaml #AsciiDoc

(think)

Building Emacs Major Modes with TreeSitter: Lessons Learned

Over the past year I’ve been spending a lot of time building TreeSitter-powered major modes for Emacs – clojure-ts-mode (as co-maintainer), neocaml (from scratch), and asciidoc-mode (also from scratch). Between the three projects I’ve accumulated enough battle scars to write about the experience. This post distills the key lessons for anyone thinking about writing a TreeSitter-based major mode, or curious about what it’s actually like.
  • Copy link
  • Flag this post
  • Block
Bozhidar Batsov (a.k.a. Bug)
Bozhidar Batsov (a.k.a. Bug)
@bbatsov@hachyderm.io  ·  activity timestamp 6 days ago

I've put together asciidoc-mode (https://github.com/bbatsov/asciidoc-mode) - a super lean major #Emacs mode for editing #AsciiDoc documents, powered by #TreeSitter

It's a lighter and simpler alternative to the more established adoc-mode (also maintained by yours truly), that has been sitting in the back of my mind for a while and became possible recently when a TS grammar for AsciiDoc was created.

I hope you'll find the new mode useful!

@sanityinc Can you help me get it in MELPA? (https://github.com/melpa/melpa/pull/9850)

GitHub

GitHub - bbatsov/asciidoc-mode: A modern Emacs major mode for editing AsciiDoc files, powered by TreeSitter

A modern Emacs major mode for editing AsciiDoc files, powered by TreeSitter - bbatsov/asciidoc-mode
  • Copy link
  • Flag this post
  • Block

BT Free Social

BT Free is a non-profit organization founded by @ozoned@btfree.social . It's goal is for digital privacy rights, advocacy and consulting. This goal will be attained by hosting open platforms to allow others to seamlessly join the Fediverse on moderated instances or by helping others join the Fediverse.

BT Free Social: About · Code of conduct · Privacy ·
Bonfire social · 1.0.2-alpha.34 no JS en
Automatic federation enabled
Log in
Instance logo
  • Explore
  • About
  • Code of Conduct