From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#59662: 29.0.50; [PATCH] Add treesit--indent-defun Date: Thu, 8 Dec 2022 18:06:26 +0200 Message-ID: <617cb890-b622-4f76-c446-f4c95c377cc5@yandex.ru> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4326"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Cc: larsi@gnus.org, 59662@debbugs.gnu.org, casouri@gmail.com, monnier@iro.umontreal.ca To: Theodor Thornhill , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 08 17:07:14 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 1p3JQY-0000sF-93 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Dec 2022 17:07:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3JQT-0004N6-Sy; Thu, 08 Dec 2022 11:07:09 -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 1p3JQM-0004KR-Sg for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 11:07: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 1p3JQM-00035k-8F for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 11:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p3JQL-0004TM-MY for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 11:07:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Dec 2022 16:07: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.167051559617183 (code B ref 59662); Thu, 08 Dec 2022 16:07:01 +0000 Original-Received: (at 59662) by debbugs.gnu.org; 8 Dec 2022 16:06:36 +0000 Original-Received: from localhost ([127.0.0.1]:57616 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3JPv-0004T5-Pm for submit@debbugs.gnu.org; Thu, 08 Dec 2022 11:06:36 -0500 Original-Received: from mail-wm1-f54.google.com ([209.85.128.54]:34464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3JPu-0004Sz-SX for 59662@debbugs.gnu.org; Thu, 08 Dec 2022 11:06:35 -0500 Original-Received: by mail-wm1-f54.google.com with SMTP id ay8-20020a05600c1e0800b003d0808d2826so4348356wmb.1 for <59662@debbugs.gnu.org>; Thu, 08 Dec 2022 08:06:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=p1ETjYNQF1Wcw2ITBu06KcxlOjnAY1FYnOK2RwmrbOk=; b=WUhSvipW7bd+R28BCisBxSecs+rbh7stS5sQpDuLlyhlWpYlToSEOfNOMMs+JGhL+o +maJjxWnWCA9RB6848qSYIDFjDbkv0dZD5qWaNZa/bMDQ5rjIbQD0VpbETHc64toBAkB OMBH8+6iZa3U+WzFZOflLt0K2zwMeCqfDqBZjqsfjT3r1n/HuPuG4+YP7WL6QUitVqs8 ekyxzUiRwC7HfRHmo0RQH+/0q4Yu46Olibum1JFtl2Nt0Z/seH+D+5AZ13UuRHasgNtW zHJ34fRzV+rXy3oWE/LgGObhjZ/Dh71lQGoYDJ2QY/dBLM0BTRB/Bu7zUeWgAmgX2wRT mSHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=p1ETjYNQF1Wcw2ITBu06KcxlOjnAY1FYnOK2RwmrbOk=; b=4CD6kw8H1hPBgjHuVPWnqmbVovDt0SRaAcne5Y9TbmsKEIs9gysB88umSlshGcE7ZA il+x3kL28FqNA5KWEMVMlhg62gW6HRMBQxJK9ShuiAtslixXiIndHV/9LIE6nb0xwxIb 3tMTE1MgzaXLSeWGaTZGT9xhHxSPdsHZb5zYI5xGMrCq1zVvc4mUkOFCmRxB8s+VVqtx stRP0ZnTdnVuzmuB07APdJl8Kg7pyuNTBbRf1pn8aSI1Ls3mPvZzKiYyccnazkfknKOD Q4Gr8GkqLOWOdCwSYukT+ddylzziqZylTd530UU/tD9rF7gc1eEHpWBbt/6W7HSdGAeH jYrg== X-Gm-Message-State: ANoB5pn0/0kmQ+AX71MxqOaNsuvW2iFiE7a+ADzGQlvCvztBEf875bbT pFY2nX3PiI3YGS4lyZ87RSU= X-Google-Smtp-Source: AA0mqf7jUlqLvMI+MTJEtUn036VXsZ+nVWkp3yKBZQpizrdXufOfI/8HQ4RwoaP7HpKN8KKcPjlFNA== X-Received: by 2002:a05:600c:3b8a:b0:3d1:f0f1:ceb4 with SMTP id n10-20020a05600c3b8a00b003d1f0f1ceb4mr2145655wms.19.1670515589103; Thu, 08 Dec 2022 08:06:29 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id i10-20020a1c540a000000b003d1f2c3e571sm5190839wmb.33.2022.12.08.08.06.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Dec 2022 08:06:28 -0800 (PST) Content-Language: en-US In-Reply-To: <87k032c577.fsf@thornhill.no> 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:250316 Archived-At: 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: > >> 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. Ah. So that was about the name of the variable. Looks good. Note that if the improvement which I described ever comes to life (hopefully), then the variable will probably need to be renamed/moved/multiplied again.