From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59662: 29.0.50; [PATCH] Add treesit--indent-defun Date: Thu, 08 Dec 2022 14:50:32 -0500 Message-ID: References: <5B538888-E454-4F75-B3B8-AB20E10B3E89@gmail.com> <83o7sniokt.fsf@gnu.org> <4D5A1640-4F0F-4C21-8ED6-770B88A870EA@thornhill.no> <83r0xhdluq.fsf@gnu.org> <3e25eadb-3f2b-f92d-8b18-bf1daca91b64@yandex.ru> <83wn78cqz4.fsf@gnu.org> <4d605e69-7df9-6480-c1c5-dcb22abd3bde@yandex.ru> <83y1ri2wnj.fsf@gnu.org> <875yemz55b.fsf@thornhill.no> <83r0xa2tc4.fsf@gnu.org> <87zgbyxohf.fsf@thornhill.no> <837cz22bgd.fsf@gnu.org> <2C2420B5-A0BE-4A81-A924-0F40DD57F211@thornhill.no> <877cz1d7vq.fsf@thornhill.no> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26410"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 59662@debbugs.gnu.org, Yuan Fu , larsi@gnus.org, Dmitry Gutov To: Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 08 20:52:24 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p3MwS-0006g2-P1 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Dec 2022 20:52:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3Mw8-0001Ci-Uj; Thu, 08 Dec 2022 14:52:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3Mw6-0001C4-HA for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 14:52:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p3Mw6-00025B-7x for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 14:52:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p3Mw5-00030l-Ud for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 14:52:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Dec 2022 19:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59662 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 59662-submit@debbugs.gnu.org id=B59662.167052909711566 (code B ref 59662); Thu, 08 Dec 2022 19:52:01 +0000 Original-Received: (at 59662) by debbugs.gnu.org; 8 Dec 2022 19:51:37 +0000 Original-Received: from localhost ([127.0.0.1]:58769 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3Mvg-00030U-Od for submit@debbugs.gnu.org; Thu, 08 Dec 2022 14:51:36 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:5294) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3Mve-00030O-Q2 for 59662@debbugs.gnu.org; Thu, 08 Dec 2022 14:51:35 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 326FE1000EF; Thu, 8 Dec 2022 14:51:29 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 55DA41000DC; Thu, 8 Dec 2022 14:51:27 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1670529087; bh=QnnNQ+M0CEcgh3dyQWYM0tuq8Eh9amjpbSRxjUu7l6g=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ksXLr3NJ8rHa1Hdo1XzNqpO7DnKSheSzDqDjH13q+yoOYfwOGQiZFCXvZ9YwrFYJc Uo3uVjVG8TXiFvf0IliFgc4ZCcF6pE+mZxYmeotMdNwriLrgI6N/ElpZSrE9Gm6rXp hHr7g5DOTBhdr2mf1viZRc3L6rnYfh2jWFDLsj2PJgX8pRIOCMnMWfeK2qABwntQ++ +sNirdyMATLEb7RlHG2YqiQ+/NaMQogHSrDCnI2wt4c7Jlvt+eOPcysm8PExkRFChA mNtu9xt8hTfXYvEwXQiD9gG0dWwHg4l3hz6DXiop8Jd3k2F9nc8YrnBGWq0lO2UIFj 4azr46XgfzcPA== Original-Received: from alfajor (unknown [45.44.229.252]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id ED361120FD8; Thu, 8 Dec 2022 14:51:26 -0500 (EST) In-Reply-To: <877cz1d7vq.fsf@thornhill.no> (Theodor Thornhill's message of "Thu, 08 Dec 2022 20:15:37 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250333 Archived-At: > 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