From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#59763: 29.0.60; Filling for c-ts-mode Date: Sat, 24 Dec 2022 17:30:35 -0800 Message-ID: <31451F7E-881F-4AFD-8409-CEFF7940BB61@gmail.com> References: <69D98973-6824-47B3-900F-6DBEE669932F@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) 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="24627"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eliz@gnu.org, 59763@debbugs.gnu.org To: Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 25 02:31:24 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 1p9FrI-0006EJ-0V for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Dec 2022 02:31:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p9Fqy-0007N3-Kg; Sat, 24 Dec 2022 20:31:04 -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 1p9Fqw-0007Mo-SO for bug-gnu-emacs@gnu.org; Sat, 24 Dec 2022 20:31:02 -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 1p9Fqw-0002hf-Iz for bug-gnu-emacs@gnu.org; Sat, 24 Dec 2022 20:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p9Fqv-0006cE-VS for bug-gnu-emacs@gnu.org; Sat, 24 Dec 2022 20:31:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <69D98973-6824-47B3-900F-6DBEE669932F@gmail.com> Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Dec 2022 01:31:01 +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.167193184725396 (code B ref 59763); Sun, 25 Dec 2022 01:31:01 +0000 Original-Received: (at 59763) by debbugs.gnu.org; 25 Dec 2022 01:30:47 +0000 Original-Received: from localhost ([127.0.0.1]:47359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9Fqh-0006bY-E3 for submit@debbugs.gnu.org; Sat, 24 Dec 2022 20:30:47 -0500 Original-Received: from mail-wr1-f53.google.com ([209.85.221.53]:35500) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9Fqf-0006bJ-KA for 59763@debbugs.gnu.org; Sat, 24 Dec 2022 20:30:46 -0500 Original-Received: by mail-wr1-f53.google.com with SMTP id y16so7640356wrm.2 for <59763@debbugs.gnu.org>; Sat, 24 Dec 2022 17:30:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=yJYQcnTwL4PGIsSyW9l6BI4jgOrgkYjMNAuxYJgaDHg=; b=FbWhnwYjgTTuoBX365quGohYeI21XwjZ4P/vRA6NtcyIk98B4IMKj7Y8WlV7ZEf9Qv 3mupcLC1SziBX5xCO8ipGDFrYpKbArSyzoEwzwRdsIcrFUzDPkx/Jwr32L/hk/tb3NgO 6RQv9zm4EGFZleHOh5Eqxh5nVpKDo9+xrnoXTdCvaL8tK8Emm/skVYklSfRGt3C2qYzi 5C4urgfQ3omVJSagbM5Ogcf7X6uDqIGuPSyqQYtkppXFwSQjRTrrkH8e5nApb2Cp3ndn q3qxTZBguAbZtNyCFGeJxHFak8EQ4fo1HGxEjhtXa4jn4DGuF9H/jumxaGTPb+wL8ulD kYaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yJYQcnTwL4PGIsSyW9l6BI4jgOrgkYjMNAuxYJgaDHg=; b=jEF4LgkMoI4iUVmVWtQQSB4TbxwuJU9Gmd53Tc8mtfmEeMtzmdhFn21AQ7L6wfRk9R OZ1pP4qwSrHPlpHSlGgi1xB9gEhY574DK2qtAoh7Wd0D59cfFQEVAKOBkdJxY4PMteEX 9/PQSBsZONerVTu4/NmFHKzr5nykjw9J7BQd1dNttNEl/01NxqxwYzmzpLyl7Z4uL2Ch l628PgtHl8qe4gnXEIdZ8dvS54YjTQc4ccKEC597gDWwFnSM/+LNga2NTtTm/bc5Tdtr pZ7nY/T5i1YOHPLOC4QBkdP06PehGTt0n+xOk5W059hXzCsJuLBOdtwF9ui54rSwGwlB zh0w== X-Gm-Message-State: AFqh2kqBCyc3b7mxRAotw7nq6KEm2LKESM7oNc/rdZ6gVs6+XpXTQpsz nxWo5H6fXse2Yp7axR72kFo= X-Google-Smtp-Source: AMrXdXsjTIf/fYOW0+mShHIBl/u6ExxZw3DsFe4K70eI1Vyy8lRgiVr39c/5g3IXoXPSRACqvnjHpQ== X-Received: by 2002:adf:e383:0:b0:255:300d:79c7 with SMTP id e3-20020adfe383000000b00255300d79c7mr9884629wrm.18.1671931838986; Sat, 24 Dec 2022 17:30:38 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id h29-20020adfaa9d000000b002368f6b56desm8324473wrc.18.2022.12.24.17.30.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Dec 2022 17:30:38 -0800 (PST) X-Mailer: Apple Mail (2.3696.120.41.1.1) 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:251823 Archived-At: 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 = filling >>>>>> function. Below is the function I have in my init.el, could = someone have >>>>>> a look and see if it=E2=80=99s good? Alternatively we could copy = out the comment >>>>>> and fill it in a temp buffer with c-mode, but I didn=E2=80=99t = have the time to try >>>>>> it out and see how well it works. >>>>>=20 >>>>> Thanks. >>>>>=20 >>>>> =46rom quick testing, I see a problem: >>>>>=20 >>>>> . Visit dispnew.c and go to the comment that starts on line 324. = Delete >>>>> the newline between the two lines of the comment, and invoke = the >>>>> function. Observe how the first non-blank character of the = comment's >>>>> second line is aligned with the "/*" on the previous line, not = with the >>>>> text after "/*" as I'd expect. >>>> >>>> I see. I=E2=80=99ll need to look at how cc-mode fill comments. >>>> >>>>>=20 >>>>> Btw, this command should be bound to M-q in ts-c-mode. >>>> >>>> Will do, once our fill function works well. BTW, Theo, if you have = any >>>> idea, don=E2=80=99t hesitate to go ahead :-) No obligations, of = course. >>>> >>>> Yuan >>> >>> Sure! Added to my list :) I had a function at some point that used >>> c-mode to do this. I'll see if I can polish it a little. >> >>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. 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. But I wonder where should we put it, I guess it=E2=80=99s fine to leave = it in c-ts-mode, since there really isn=E2=80=99t much code. Having other = modes to require c-ts-mode shouldn=E2=80=99t be a big problem, I think? Yuan