bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#59662: 29.0.50; [PATCH] Add treesit--indent-defun


From: Theodor Thornhill
Subject: bug#59662: 29.0.50; [PATCH] Add treesit--indent-defun
Date: Mon, 28 Nov 2022 20:32:01 +0100

Hi Eli and Yuan!

I've added a function to treesit.el, for use in
treesit-major-mode-setup.  Because the treesit-defun-type-regexp gives
us "defuns" for free, we can set fill-paragraph-function to this new
function, thus enabling quick formatting, and some sensible default for
fill-paragraph.  It aims to mirror c-indent-defun.

I think this is a nice way to get this functionality for free, but I'm
not 100% whether this is considered ok or not.

An alternative could be to add a 'treesit-mode-map' where we can
auto-enable such constructs.


Feel free to apply if it looks ok.

Theo


Attachment: 0001-Add-treesit-indent-defun.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]