Personal notes on recent Emacs configuration tweaks: limiting which tree-sitter modes are enabled after finding yaml-ts-mode unusable and reverting to yaml-mode, adopting a newly written tree-sitter grammar for Cabal files (archiving a homegrown one after over two years), and switching from a custom xref-to-grep workaround plus the wgrep package to Emacs's built-in editable xref and grep-buffer editing support.

2m read timeFrom magnus.therning.org
Post cover image

Questions this post answers

Why does yaml-ts-mode fail to handle YAML indentation properly in Emacs?

yaml-ts-mode is considered rather unusable because it does not properly handle indentation, which is critical for an indentation-sensitive language like YAML. As a workaround, switching back to the older yaml-mode package instead of the tree-sitter based mode resolves the problem until yaml-ts-mode is improved. Developers tracking Emacs tree-sitter mode quirks can follow practical fixes like this on daily.dev.

Is there a tree-sitter grammar available for Cabal files used in Haskell projects?

Yes, a tree-sitter grammar for Cabal files now exists, created by Curtis and described in a post titled 'how-to-not-write-parsers'. Before this, no such grammar existed, so a rough custom grammar had been written as a stopgap for a Haskell tree-sitter mode; that homegrown grammar is now being archived in favor of the new one. daily.dev helps Haskell and Emacs tinkerers keep up with new tree-sitter grammar developments.

Does Emacs have built-in support for editable xref and grep buffers without needing the wgrep package?

Yes, Emacs includes built-in support for making xref buffers editable and for editing grep buffers directly, making the third-party wgrep package and custom xref-to-grep conversion functions unnecessary. Switching to these built-in mechanisms removes the need for extra glue code and an additional dependency. daily.dev surfaces workflow simplifications like ditching wgrep for Emacs enthusiasts refining their setup.

16 Impressions