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: Theodor Thornhill <theo <at> thornhill.no>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: larsi <at> gnus.org, 59662 <at> debbugs.gnu.org, casouri <at> gmail.com, monnier <at> iro.umontreal.ca, dgutov <at> yandex.ru
Subject: bug#59662: 29.0.50; [PATCH] Add treesit--indent-defun
Date: Sun, 11 Dec 2022 09:39:46 +0100
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Theodor Thornhill <theo <at> thornhill.no>
>> Cc: dgutov <at> yandex.ru, larsi <at> gnus.org, 59662 <at> debbugs.gnu.org,
>>  casouri <at> gmail.com, monnier <at> iro.umontreal.ca
>> Date: Sat, 10 Dec 2022 21:21:53 +0100
>> 
>> I made another attempt - I think it's a little clearer.  What I want to
>> say is something like this (| denotes point):
>> 
>> 1. If point is inside a comment, refill the paragraph:
>>   // foo bar | baz
>> 
>> 2. If point is before a comment, refill the paragraph:
>>  |  // foo bar baz
>> 
>> 3. If point is inside code, reindent the defun:
>> int
>> main(void)
>> {
>>              int i;          // <-- This will be reindented
>>   /* Some very long comment that will _not_ be refilled in this case.  */
>>   for(;;)
>>     {
>>   |   int x;
>>     }
>> }
>
> What if point is after a comment, like this:
>
>    /* foo bar baz */ |
>

Then the defun will be reindented.  In one line comments the comment
will be filled.


>> +@code{fill-paragraph-function} (@pxref{List Motion,,, elisp, The Emacs
>> +Lisp Reference Manual} or @ref{Filling,,, elisp, The Emacs Lisp
>> +Reference Manual} for more information).
>
> The @pxref should be "see @ref", and please add a comma after the
> closing brace (some old versions of makeinfo insist on that).  @pxref
> is only appropriate if its closing brace immediately precedes the
> closing parenthesis.
>
> Otherwise LGTM, thanks.

Thanks for your patience!

What about this?

Theo

[0001-Add-prog-fill-reindent-defun-bug-59664.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.