From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill 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 17:33:04 +0100 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> <83o7se2n89.fsf@gnu.org> <87tu269mox.fsf@thornhill.no> <34c2b5b5-3312-066e-50f4-2aa776d0273f@yandex.ru> <87k032c577.fsf@thornhill.no> <617cb890-b622-4f76-c446-f4c95c377cc5@yandex.ru> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28679"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 59662@debbugs.gnu.org, casouri@gmail.com, monnier@iro.umontreal.ca To: Dmitry Gutov , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 08 17:42:11 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 1p3JyN-0007Eq-8l for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Dec 2022 17:42:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3JyH-0007xM-Kf; Thu, 08 Dec 2022 11:42:05 -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 1p3JyF-0007xB-LE for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 11:42:03 -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 1p3JyE-0006ia-Pz for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 11:42:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p3JyE-00076y-3d for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 11:42:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Dec 2022 16:42:02 +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.167051769027329 (code B ref 59662); Thu, 08 Dec 2022 16:42:02 +0000 Original-Received: (at 59662) by debbugs.gnu.org; 8 Dec 2022 16:41:30 +0000 Original-Received: from localhost ([127.0.0.1]:57819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3Jxh-00076j-Rd for submit@debbugs.gnu.org; Thu, 08 Dec 2022 11:41:30 -0500 Original-Received: from out-208.mta0.migadu.com ([91.218.175.208]:16741) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3Jxe-00076c-RC for 59662@debbugs.gnu.org; Thu, 08 Dec 2022 11:41:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1670517684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jB0s6c2en75SnDNFxWbQ6ha/r7GzFG33m7HjLdS6R5s=; b=XYclYmYO1W5lErLUzV6X4HH0zCr8I0ufo9R4eZRRuac0b5C9RObb+Musb1OCw0kz9sVZW9 2rEFaaMNWEZg64ys4zgBd4lpSo34Zr4UnGAyO2wtwvtLZEJLSfrQl9Jc4ibW3pWYMSfnH6 Eg63CmWNO5CjZc2L9iszvKzDgzlqLIQZ/DJ8Btw+IjagNrT6XQU/c2wPlChK4jylLnj/xf EUdJ0D4V8e8/ls2zB+gk1YjvF4GnKJs4vBnKlu0naS4G3bYdMXb8DTw85bY3DO7CCihrJX cvGlqMN8ZPIxwjlvT0MPS9xqy/eAyMOSJKRnBCJP5dcykFyqqyNO02wn60XCug== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-Reply-To: <617cb890-b622-4f76-c446-f4c95c377cc5@yandex.ru> X-Migadu-Flow: FLOW_OUT 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:250320 Archived-At: On 8 December 2022 17:06:26 CET, Dmitry Gutov wrote: >On 08/12/2022 16:58, Theodor Thornhill via Bug reports for GNU Emacs, the= Swiss army knife of text editors wrote: >> Dmitry Gutov writes: >>=20 >>> On 08/12/2022 13:09, Theodor Thornhill wrote: >>>> What about this? I changed it to make a point that we should fill if >>>> inside of a string or comment, and indent if inside a code block=2E = We >>>> one such variable for each type, or in both as suggested below=2E >>> Could you rephrase maybe? I'm not seeing the difference=2E >> In the first example I made the variable specific to comments=2E But >> filling should work on everything that's considered text, IIUC=2E So i= f >> the variable refers to both the regex needs to accommodate strings and >> comments=2E That will in turn make it less useful if we want to find >> comments specifically, or strings specifically=2E so we could have both >> 'treesit-comment-regexp' and 'treesit-string-regexp' and match on '(or >> treesit-comment-regexp treesit-string-regexp)' in this particular case= =2E >>=20 >> Not really sure if that made more sense=2E > >Ah=2E So that was about the name of the variable=2E Looks good=2E > Yeah, and thus what nodes it should capture >Note that if the improvement which I described ever comes to life (hopefu= lly), then the variable will probably need to be renamed/moved/multiplied a= gain=2E Why is that?