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: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Theodor Thornhill <theo <at> thornhill.no>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 59662 <at> debbugs.gnu.org, Yuan Fu <casouri <at> gmail.com>, larsi <at> gnus.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: bug#59662: 29.0.50; [PATCH] Add treesit--indent-defun
Date: Thu, 08 Dec 2022 14:50:32 -0500
> Sometimes it is good to easily differentiate between textual nodes and
> normal code.  One such case is for a filling and reindenting command,
> where we fill the textual node if point is on one, and reindent code
> otherwise.  This is a part of bug#59662.

I wonder if we shouldn't have something slightly more general, such as
a function which returns nil for "normal code" nodes and non-nil for
"textual" nodes, in which case it could additionally return info such as
whether it's rather like a comment or rather like a string or maybe some
information about how to insert/remove a linebreak from within it (in
case they need to be escaped somehow, or for line-comments).


        Stefan





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.