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#59763: 29.0.60; Filling for c-ts-mode Date: Sun, 25 Dec 2022 08:33:19 +0100 Message-ID: <224EFC60-1826-428C-96AC-8965A2B9B302@thornhill.no> References: <31451F7E-881F-4AFD-8409-CEFF7940BB61@gmail.com> 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="16837"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eliz@gnu.org, 59763@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 25 08:34:17 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 1p9LWT-00049V-2Z for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Dec 2022 08:34:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p9LWL-0008D1-CR; Sun, 25 Dec 2022 02:34: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 1p9LWF-0008B4-DP for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 02:34: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 1p9LWF-0006mf-1F for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 02:34:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p9LWE-0005eO-Fv for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 02:34: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: Sun, 25 Dec 2022 07:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59763 X-GNU-PR-Package: emacs Original-Received: via spool by 59763-submit@debbugs.gnu.org id=B59763.167195360721662 (code B ref 59763); Sun, 25 Dec 2022 07:34:02 +0000 Original-Received: (at 59763) by debbugs.gnu.org; 25 Dec 2022 07:33:27 +0000 Original-Received: from localhost ([127.0.0.1]:47472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9LVe-0005dI-US for submit@debbugs.gnu.org; Sun, 25 Dec 2022 02:33:27 -0500 Original-Received: from out2.migadu.com ([188.165.223.204]:20268) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9LVc-0005d6-Pp for 59763@debbugs.gnu.org; Sun, 25 Dec 2022 02:33:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1671953603; 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=zovMnLWfneEH0yZk5sKp54YQ9NBhov8O8LbQo1RqFaU=; b=IaeKV3v+ySB7Bod67iou/p8OPFgvJixQuDp9UaCqzWw92fpO7SxnDkKOawepgZAnrYEins G7FHQ4dyk5et3bnRlcJZvY09e74JGEphCboZhRaNwcqBo848wjckGDVB25UUGpUvKVHntF icibKrn+9QkutbnjoPWcB9F7h5PFJ6kElSeIL2whfpG2Yw7k1LSOVKx50tdii5rIGjqwtV x9q59LINDmiSYx7OE6F1nqwxDZZtDNiVk2Gg8eJdYxsTqIie/E2Bmd52BGtPEP1okrM5/K 7EnRGR0NxAzNhO6cIUFmk8RYCQ7HrSP4rddquKL4hJ2VJhyxow8ttLtE/X72xA== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-Reply-To: <31451F7E-881F-4AFD-8409-CEFF7940BB61@gmail.com> 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:251833 Archived-At: On 25 December 2022 02:30:35 CET, Yuan Fu wrote: > >Theodor Thornhill writes: > >> On 24 December 2022 09:36:21 CET, Yuan Fu wrote: >>> >>>Theodor Thornhill writes: >>> >>>> Yuan Fu writes: >>>> >>>>>> On Dec 2, 2022, at 6:58 AM, Eli Zaretskii wrote: >>>>>>=20 >>>>>>> From: Yuan Fu >>>>>>> Date: Thu, 1 Dec 2022 21:33:06 -0800 >>>>>>>=20 >>>>>>>=20 >>>>>>> IMO For c-ts-mode to be usable we need to have at least a basic fi= lling >>>>>>> function=2E Below is the function I have in my init=2Eel, could so= meone have >>>>>>> a look and see if it=E2=80=99s good? Alternatively we could copy o= ut the comment >>>>>>> and fill it in a temp buffer with c-mode, but I didn=E2=80=99t hav= e the time to try >>>>>>> it out and see how well it works=2E >>>>>>=20 >>>>>> Thanks=2E >>>>>>=20 >>>>>> From quick testing, I see a problem: >>>>>>=20 >>>>>> =2E Visit dispnew=2Ec and go to the comment that starts on line 32= 4=2E Delete >>>>>> the newline between the two lines of the comment, and invoke the >>>>>> function=2E Observe how the first non-blank character of the co= mment's >>>>>> second line is aligned with the "/*" on the previous line, not w= ith the >>>>>> text after "/*" as I'd expect=2E >>>>> >>>>> I see=2E I=E2=80=99ll need to look at how cc-mode fill comments=2E >>>>> >>>>>>=20 >>>>>> Btw, this command should be bound to M-q in ts-c-mode=2E >>>>> >>>>> Will do, once our fill function works well=2E BTW, Theo, if you have= any >>>>> idea, don=E2=80=99t hesitate to go ahead :-) No obligations, of cour= se=2E >>>>> >>>>> Yuan >>>> >>>> Sure! Added to my list :) I had a function at some point that used >>>> c-mode to do this=2E I'll see if I can polish it a little=2E >>> >>>I did some work in filling, it should work like cc-mode in like 90% of >>>the cases now, yay! >>> >>>Yuan >> >> Nice! For all cc-ts-modes? > >I only added for c and c++, but support for other modes should be >identical=2E And I think we should have something equivalent to cc-mode= =E2=80=99s >init which sets up things that are the same in all C-like languages, >basically comments and filling=2E > >But I wonder where should we put it, I guess it=E2=80=99s fine to leave i= t in >c-ts-mode, since there really isn=E2=80=99t much code=2E Having other mod= es to >require c-ts-mode shouldn=E2=80=99t be a big problem, I think? > >Yuan How about just having treesit-utils=2Eel, or something like that? There ar= e probably many things in the future that will be common among modes, yet w= on't really warrant inheritance=2E I think we have such an example in js/ty= pescript too, iirc=2E