GNU bug report logs - #59662
29.0.50; [PATCH] Add treesit--indent-defun

Previous Next

Package: emacs;

Reported by: Theodor Thornhill <theo <at> thornhill.no>

Date: Mon, 28 Nov 2022 19:33:01 UTC

Severity: wishlist

Tags: patch

Found in version 29.0.50

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Theodor Thornhill <theo <at> thornhill.no>
Subject: bug#59662: closed (Re: bug#59662: 29.0.50; [PATCH] Add
 treesit--indent-defun)
Date: Sat, 07 Jan 2023 23:02:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 59662 <at> debbugs.gnu.org.

-- 
59662: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59662
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Yuan Fu <casouri <at> gmail.com>
To: Theodor Thornhill <theo <at> thornhill.no>
Cc: 59662-done <at> debbugs.gnu.org
Subject: Re: bug#59662: 29.0.50; [PATCH] Add treesit--indent-defun
Date: Sat, 7 Jan 2023 15:01:03 -0800
Theodor Thornhill <theo <at> thornhill.no> writes:

> Dmitry Gutov <dgutov <at> yandex.ru> writes:
>
>> On 11/12/2022 16:13, Theodor Thornhill via Bug reports for GNU Emacs, 
>> the Swiss army knife of text editors wrote:
>>> Nice. Will you or Dmitry install?
>>
>> Pushed to master, thank you.
>
> Thanks!
>
> Theo

Closing this :-)

Yuan

[Message part 3 (message/rfc822, inline)]
From: Theodor Thornhill <theo <at> thornhill.no>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; [PATCH] Add treesit--indent-defun
Date: Mon, 28 Nov 2022 20:32:01 +0100
[Message part 4 (text/plain, inline)]
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


[0001-Add-treesit-indent-defun.patch (text/x-diff, attachment)]

This bug report was last modified 2 years and 158 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.