From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#59662: 29.0.50; [PATCH] Add treesit--indent-defun Date: Sat, 03 Dec 2022 19:54:55 +0200 Message-ID: <83wn78cqz4.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9413"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, 59662@debbugs.gnu.org, theo@thornhill.no, casouri@gmail.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 03 18:56:12 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 1p1WkG-0002FN-1W for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 03 Dec 2022 18:56:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p1WkA-0005nM-80; Sat, 03 Dec 2022 12:56:06 -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 1p1Wk6-0005lg-Ny for bug-gnu-emacs@gnu.org; Sat, 03 Dec 2022 12:56: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 1p1Wk6-0005af-GV for bug-gnu-emacs@gnu.org; Sat, 03 Dec 2022 12:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p1Wk6-0005gY-5J for bug-gnu-emacs@gnu.org; Sat, 03 Dec 2022 12:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Dec 2022 17:56: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.167009012621846 (code B ref 59662); Sat, 03 Dec 2022 17:56:02 +0000 Original-Received: (at 59662) by debbugs.gnu.org; 3 Dec 2022 17:55:26 +0000 Original-Received: from localhost ([127.0.0.1]:52501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1WjV-0005gH-C1 for submit@debbugs.gnu.org; Sat, 03 Dec 2022 12:55:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54604) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1WjT-0005g9-RF for 59662@debbugs.gnu.org; Sat, 03 Dec 2022 12:55:24 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p1WjM-0005Wq-Uu; Sat, 03 Dec 2022 12:55:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=M6deO1GTLtUuUVaC6woRDMOn4U802yDYVLe163kk1ME=; b=PqSOkCLZMK/k 6aEyvIUR4hPdJJqNh72V0Fn+nD7QILaPHXE1+nZtmnyzQbVU1UXxjz57vDMYjGqBk4dGuBMGmfMIF Qu8zMBT+a5OEl+VKOzZ8JBg9E17ddSQiHOFHxLHKgvkBV8goh9mjeIF+rFCKz3H8oJSYrWlaHJkwK ZAPRgo8TdEtCCLz+Pl7UkbpaaWALX2Sh4/b+mCGKpvGH/bdWTgzI9jL/Bbg07uubs1BYstYLg5YNg FYUCZ3DYYqoBI83G04j4yzYqWr60KTuSuFZYSbc8bmgJB4TJY/LEi2PWi6tC9Uo0vXh0xW3AAQMf+ wri1v8ZVvuFSdr7XcLEsMQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p1WjM-0004za-CF; Sat, 03 Dec 2022 12:55:16 -0500 In-Reply-To: <3e25eadb-3f2b-f92d-8b18-bf1daca91b64@yandex.ru> (message from Dmitry Gutov on Sat, 3 Dec 2022 17:59:04 +0200) 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:249859 Archived-At: > Date: Sat, 3 Dec 2022 17:59:04 +0200 > Cc: theo@thornhill.no, casouri@gmail.com, 59662@debbugs.gnu.org, > casouri@gmail.org > From: Dmitry Gutov > > > As for M-q, it should be bound to a fill-SOMETHING command, not to a > > indent-SOMETHING command. So from my POV paredit-mode should be fixed to > > use some other sequence for paredit-reindent-defun, perhaps even "C-c C-q", > > but that is IMO an unrelated issue. > > > > And if you wanted to suggest that an indent-defun command in c-ts-mode be > > bound to M-q, then I'm very much against that: M-q already has a useful > > command bound to it in CC Mode, and should do something similar in > > c-ts-mode; I believe we are discussing that in bug#59763. > > Both c-fill-paragraph and the proposed ts-c-fill-paragraph perform > fill-region when inside a string or comment. Otherwise, do nothing. Yes. > paredit-reindent-defun, like I described, does all that too. But when > outside strings and comments, it reindents the current defun. So maybe paredit-reindent-defun doesn't need any fixes, but using it as a role model for the C-like languages is not TRT, since in C these are two separate commands with two different key bindings. > AFAICT, these behaviors are quite compatible. But paredit's binding > seems to be useful in more contexts. I'm fine with trying something like that on master, to see whether users like this conflation, but not on the release branch.