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 15:58:52 +0100 Message-ID: <87k032c577.fsf@thornhill.no> 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> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9433"; 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 15:59:32 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 1p3IN1-0002Gy-B9 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Dec 2022 15:59:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3IMn-0005kR-2m; Thu, 08 Dec 2022 09:59:17 -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 1p3IMZ-0005fh-IO for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 09:59:05 -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 1p3IMY-0002Hh-D9 for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 09:59:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p3IMX-0003pG-O5 for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 09:59:01 -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 14:59: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.167051153914700 (code B ref 59662); Thu, 08 Dec 2022 14:59:01 +0000 Original-Received: (at 59662) by debbugs.gnu.org; 8 Dec 2022 14:58:59 +0000 Original-Received: from localhost ([127.0.0.1]:57265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3IMV-0003p2-DA for submit@debbugs.gnu.org; Thu, 08 Dec 2022 09:58:59 -0500 Original-Received: from out2.migadu.com ([188.165.223.204]:35820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3IMS-0003ow-Vc for 59662@debbugs.gnu.org; Thu, 08 Dec 2022 09:58:58 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1670511534; 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: in-reply-to:in-reply-to:references:references; bh=8yebdnKLnbhRIEI5sLDHjM1BW1YKMpJW/TDSpBi6l5Q=; b=ZeLNLQ0uXmjAWd6oYxaDcA6/DD9rQD74fQY9OMUKDUUPfrYXbZRVh84Zf4SvIev7yYvnHS xISBuuHiw+2KzGg1nQk7pgm7amLzdEy9GQcIFvQqFFa/KFTYvboI7CDtVMPIM4xx7boNok wt1NlaDlhWBsbxhIb8C72aXFUOCmS0Aa5sXyTHiWz3gxyjGNqNDABrP8gFpY9JBZ1KJw1K QmvuUYQO+JtGgfoYPVk8P7i9QeqNwL3JgUJKjF+VQZhEQHF6tpHGrukj3r6iDDgsoccpvm 0TKxkeKq2x1nnhPEMLKG4rFFWa13Dc5OXkoqV4nImNo1eNfJHwhO/sH8lrBUIw== In-Reply-To: <34c2b5b5-3312-066e-50f4-2aa776d0273f@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:250301 Archived-At: Dmitry Gutov writes: > 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. We >> one such variable for each type, or in both as suggested below. > > Could you rephrase maybe? I'm not seeing the difference. In the first example I made the variable specific to comments. But filling should work on everything that's considered text, IIUC. So if the variable refers to both the regex needs to accommodate strings and comments. That will in turn make it less useful if we want to find comments specifically, or strings specifically. 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. Not really sure if that made more sense.