From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 02 00:33:13 2022 Received: (at submit) by debbugs.gnu.org; 2 Dec 2022 05:33:13 +0000 Received: from localhost ([127.0.0.1]:44264 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0yfh-0001cu-7j for submit@debbugs.gnu.org; Fri, 02 Dec 2022 00:33:13 -0500 Received: from lists.gnu.org ([209.51.188.17]:47192) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0yff-0001co-Td for submit@debbugs.gnu.org; Fri, 02 Dec 2022 00:33:12 -0500 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 1p0yff-0000hF-Mm for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2022 00:33:11 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p0yfe-0006pe-2k for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2022 00:33:11 -0500 Received: by mail-pl1-x62c.google.com with SMTP id d3so3690379plr.10 for ; Thu, 01 Dec 2022 21:33:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=m3fDl9ZzMp0xTOzCk3gmYvQklOOOoJM4+GzWS9TL9Uc=; b=PxCNHCdDi/0VNLBUPJyMwTt6oG0adyc7iuZ6iVF0aspAH4PK2gfXnMq9fJlq+uGKlE 3Ko8TlZvRAwPKaL8q43FjFcxPKG/6CIsgEx4sKSo8lkluSIK+biOB/CiVLtnECxmj8S4 VRRKbclXw1ZL+JR7/miv/dR9+ntrEcMM52wddYvHGgYDbl6rtaN369dSplLjxYn8FX41 pRBsZgqxxCau2IpY8XABbjT4Z1UkIfE6Xaq3C69ueQ03mFBtJU+dHSSMHS3o7xSdr0aQ NZ/rK6Q2NNSpFhR/Z/W1Hr72ttwZotBEBKsg+Bk1fpM9NS0bwAi+F0+rW0sOW+NjH9hZ /YzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=m3fDl9ZzMp0xTOzCk3gmYvQklOOOoJM4+GzWS9TL9Uc=; b=n818Sm4JR/1OvR2MXzfKZ68q9mlSSzp3/Xq1LX6Z9Un4lvOFQ0SggYXnlBefIxLbKX vSjVD763BP4Rafwdfzff42zckeIRUvG3PqGMmixe1LOQKQ96GtO4j+4g9o9NC9V1bavG GAXgPqosQYDNbdxCOSfc/nXR2RSeDUYjwg9s3hBu1hy9nNsG+Si6aUpHNptH7wBGPUd7 1BOCRNdocMxX1Bj9Uo6QaHP20gthxMqR7akMhzvUcA0Tb9LZzZ2zwgs9lrYyZu2E9ER3 2co5myLm6XSMMI7geKFl6nwx94d3V0h4kWAra51D/X/14KoGMPElG9GWQ6gyclpQ0+Wu FFXw== X-Gm-Message-State: ANoB5pn34gCq3jZ9YfiQigi8hrJYMGKYzcTm89mBNSc6Y5kov/xXjwDr vF7i+xoZD+5hrXWaSmvfdWN2PbaCZMyHAA== X-Google-Smtp-Source: AA0mqf7DqwcW1TUqix4xMJbq52ahfyPMAqYAoNcCvEe01b8CpYvvUZxuClp8XLAQMiEGwL872iiUHg== X-Received: by 2002:a17:902:9a98:b0:189:ac49:fea8 with SMTP id w24-20020a1709029a9800b00189ac49fea8mr10537723plp.14.1669959188285; Thu, 01 Dec 2022 21:33:08 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id q2-20020a635c02000000b004768b74f208sm3387752pgb.4.2022.12.01.21.33.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Dec 2022 21:33:07 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: 29.0.60; Filling for c-ts-mode Message-Id: <69D98973-6824-47B3-900F-6DBEE669932F@gmail.com> Date: Thu, 1 Dec 2022 21:33:06 -0800 To: Bug Report Emacs X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=casouri@gmail.com; helo=mail-pl1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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. (defun ts-c-fill-paragraph (&optional arg) (interactive) (let* ((node (treesit-node-at (point))) (start (treesit-node-start node)) (end (treesit-node-end node)) (pstart (save-excursion (forward-paragraph -1) (skip-syntax-forward "-") (point))) (pend (save-excursion (forward-paragraph 1) (point)))) (when (equal (treesit-node-type node) "comment") (fill-region (max start pstart) (min end pend))) t)) Yuan From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 02 09:58:50 2022 Received: (at 59763) by debbugs.gnu.org; 2 Dec 2022 14:58:50 +0000 Received: from localhost ([127.0.0.1]:47181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p17V4-0006LE-AP for submit@debbugs.gnu.org; Fri, 02 Dec 2022 09:58:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57168) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p17Uz-0006L3-0Z for 59763@debbugs.gnu.org; Fri, 02 Dec 2022 09:58:48 -0500 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 1p17Ut-0001X8-Kz; Fri, 02 Dec 2022 09:58:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=u3ljqyivkppRvQT4rEpfkCBSjem1wcx0mHJHEbV5HfE=; b=Q/yoWW1DdLZeMd/mybM/ ztqpYcZ1zc4U70XF/fG7Bmsp70Qwt6g8+8bbF27RhnUluOIfJk72XtSVqJ5wolEAJonf5Aps/e0oC p/8TA/dvmb80wMVjmDCTYP+IuV0Lh2MepL21gNBWiWN8OQ0WuoKg94rz54aMoCW8307dAl7pj9vYD g04XKemWKYhna/Ixlx+bjSLEEcRHagmsKWeEg3X/avHb1b+1UGdv+UuwX2bjiiefgUrNwzut3nf1N TcDOf7rXNQ0EtrWlHdquivTXGGoOmcpzCONUq5EK56Io6SAYrgSu1F4MmYtSGSyq1Xrade858aXFT speMUrnCo3B2gA==; 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 1p17Us-0001wO-Oq; Fri, 02 Dec 2022 09:58:39 -0500 Date: Fri, 02 Dec 2022 16:58:14 +0200 Message-Id: <838rjpg8e1.fsf@gnu.org> From: Eli Zaretskii To: Yuan Fu In-Reply-To: <69D98973-6824-47B3-900F-6DBEE669932F@gmail.com> (message from Yuan Fu on Thu, 1 Dec 2022 21:33:06 -0800) Subject: Re: bug#59763: 29.0.60; Filling for c-ts-mode References: <69D98973-6824-47B3-900F-6DBEE669932F@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59763 Cc: 59763@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Yuan Fu > Date: Thu, 1 Dec 2022 21:33:06 -0800 > > > 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’s good? Alternatively we could copy out the comment > and fill it in a temp buffer with c-mode, but I didn’t have the time to try > it out and see how well it works. Thanks. >From quick testing, I see a problem: . 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. Btw, this command should be bound to M-q in ts-c-mode. From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 02 19:25:53 2022 Received: (at control) by debbugs.gnu.org; 3 Dec 2022 00:25:53 +0000 Received: from localhost ([127.0.0.1]:49714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1GLo-0003F0-RO for submit@debbugs.gnu.org; Fri, 02 Dec 2022 19:25:53 -0500 Received: from mail-oi1-f177.google.com ([209.85.167.177]:44667) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1GLj-0003Ep-Bl for control@debbugs.gnu.org; Fri, 02 Dec 2022 19:25:51 -0500 Received: by mail-oi1-f177.google.com with SMTP id e205so6944602oif.11 for ; Fri, 02 Dec 2022 16:25:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=XeLpbicN3q0/pbx2YZ3zLnvcEGjxDyibrl2FxnvCGAI=; b=IuovPBi6vlpgNFhOekGGT3C7+G3MnhHzbYq+iN3W5skF03ebURC4nEKvdZ8maP08JD WNoOppbe5xQ6HR+Wt2JyMf8mUeaz3gAiVY5laqMFm1kHabJwlwfHMsE/E2uDQXspJMJC yBQUwx+x/7zhmWjL6Vs0/a4FRC1uQDOnzMEG+1YppN95gGgnH1wpHnuWT64A7y2Md1Y4 +6CtR0D7BIq8YkSznzjRhqa0UXOZB5NJqexUwUd+mKOpOSP2XnGhc8cPjUTQ4KfrxxUw d4yYpmGATiR0IAwjVYz3r0ioq4kl2YNnLO8Jmj6L/08ZNfRU4WgsrWOzv6oozeHjhptU +tQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=XeLpbicN3q0/pbx2YZ3zLnvcEGjxDyibrl2FxnvCGAI=; b=bbn6+B89WXEoMYdLhBRQjdH2UPMpqJmX7JI7GbUA7NpqM7c3YohX3dzWyKO1WVUY1/ rl9XnbF2VyUn9RJboHVq810A1e12Tl8p+JIJ/LkYm4FusIivwDkBTGPVEb4RJ9Kt9dMK ATrK3y5Ff3cltOySNkiFviaEXN5p1UHFV3MEQqbKbZNq0mkUtiWxsPNdqZrDuYxH4gps HiRayeU4WtIkbeo84jjtb7xTFRFaLyABX6xSmpxAhLWx4KjhaHEwQ+PCbPCRLS53Sni8 JZDXP79a2lGMsGR1UVCGW5SaJiVNC/XM8hrFegmT9M6zIHo0fEICAU53c5c/nxzjhOIB Djsw== X-Gm-Message-State: ANoB5pkWZmrps+S/u7r+/1s5Grvw0pIp2B1B2+Fyrl3pe6iftiDUVicT MPB5qCgpGpT1ZyHpNCYdhkiU3s5B58w2f/hUJVmjWvUU X-Google-Smtp-Source: AA0mqf6BCF3PKvu0QBjrpq3lFbZNIdglecngaRTpT11EtwdaJ1kGLzDm21tbLDZMR8PFigmjWnqggSEs/9C47FApoDc= X-Received: by 2002:a05:6808:1287:b0:359:dc32:4f9e with SMTP id a7-20020a056808128700b00359dc324f9emr26731195oiw.92.1670027141703; Fri, 02 Dec 2022 16:25:41 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 2 Dec 2022 16:25:41 -0800 From: Stefan Kangas X-Hashcash: 1:20:221203:control@debbugs.gnu.org::sZShLA4SAwz9s2Ec:0uVJ MIME-Version: 1.0 Date: Fri, 2 Dec 2022 16:25:41 -0800 Message-ID: Subject: control message for bug #59763 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) severity 59763 wishlist quit From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 02 19:54:53 2022 Received: (at 59763) by debbugs.gnu.org; 3 Dec 2022 00:54:53 +0000 Received: from localhost ([127.0.0.1]:49859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1Gns-0005qd-R2 for submit@debbugs.gnu.org; Fri, 02 Dec 2022 19:54:53 -0500 Received: from mail-pj1-f50.google.com ([209.85.216.50]:46889) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1Gnr-0005qX-9n for 59763@debbugs.gnu.org; Fri, 02 Dec 2022 19:54:51 -0500 Received: by mail-pj1-f50.google.com with SMTP id b13-20020a17090a5a0d00b0021906102d05so6544003pjd.5 for <59763@debbugs.gnu.org>; Fri, 02 Dec 2022 16:54:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=nd7dVYdO2vHisMdclZp8iu9pyafe0tqDjozLAI1xjE8=; b=iVUoKFJpVXhDg5v9IIR/koapnEhaTaAizHB1+Qsi+ptXp4oG1WCVtW6UmkU1dBTpcu RZFeR060YbfOkQZ59yIvGYTn2Plgc083tfJh9z0jO8OoYan2nIEkyuzm994XLquvYBOf BQTslelaLYYBevsiAJgzTXJyJjZxtBKPP2FGh+pkHxaCtN0EfjuR2inV8mk7Lk/lZXqD oxerfgSyotuztbMiaq16euHYO6x760DlYfJ2HdunalYVWXkNV737eNoPelv+0HRbGLoU ctYmQmwcHDu9X84PbvwTuJ3I2LETrCmc9Cg3co6/zwYmpsDCzMr44fj+ykbyf3+f/9tX ZcXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nd7dVYdO2vHisMdclZp8iu9pyafe0tqDjozLAI1xjE8=; b=y0cHeW7uyNewABtCgUhV2lMJf+Vx5h6wBHUAvXJzkPx906JPZ8mReTKaTPjQeyVWC/ jEXCffyUq2a8wLfhGBDSzm1i21H+q1CNuU/k84a02DLejV3pr4HkDMqMXbi5VPZVbflB hXONaHHnCt+9Imw3G33vB2ZpzwX/nDsssajhq4Ak7gHlixlQs8PWyfT09FkYK3wMlrgs UhtlIwnYw6ev8FTCR9iJ8s9AtaAgUF9waM9th7zVvlDX6EEdFTZNtgrL3YpLlortyWdM MydnQsWnXkzCNL8iqcc3e2tMU6n3dpQl5qnEHRSYoGS+Tf18s2nSmHA/aUvMbq21jHzk nD1A== X-Gm-Message-State: ANoB5pkypGOYDa6uTYtMPOlzJ2dZqYA9uexyMsRtYUetxMsIebSh0eLJ JVAdMoiZchBpqNDDJ0ieKXI9n1WyOvYRgQ== X-Google-Smtp-Source: AA0mqf7kezdSHqPHl8xH8NjzK959+cX7Muzh5txquFjjp8ldpqtwwWzW3vCdEPP9zYprr0TmNbF+QQ== X-Received: by 2002:a17:90a:b285:b0:216:ab1b:98d0 with SMTP id c5-20020a17090ab28500b00216ab1b98d0mr83904374pjr.67.1670028885648; Fri, 02 Dec 2022 16:54:45 -0800 (PST) Received: from smtpclient.apple (108-241-83-33.lightspeed.irvnca.sbcglobal.net. [108.241.83.33]) by smtp.gmail.com with ESMTPSA id t17-20020aa79471000000b00575c8242849sm5681064pfq.69.2022.12.02.16.54.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Dec 2022 16:54:45 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#59763: 29.0.60; Filling for c-ts-mode From: Yuan Fu In-Reply-To: <838rjpg8e1.fsf@gnu.org> Date: Fri, 2 Dec 2022 16:54:43 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <684D8326-B59B-4A8D-9CD5-F0EB83CF5608@gmail.com> References: <69D98973-6824-47B3-900F-6DBEE669932F@gmail.com> <838rjpg8e1.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59763 Cc: Theodor Thornhill , 59763@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > 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= From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 05 06:47:10 2022 Received: (at 59763) by debbugs.gnu.org; 5 Dec 2022 11:47:10 +0000 Received: from localhost ([127.0.0.1]:35541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p29wD-0003lZ-Ss for submit@debbugs.gnu.org; Mon, 05 Dec 2022 06:47:10 -0500 Received: from out2.migadu.com ([188.165.223.204]:53489) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p29wC-0003lT-CL for 59763@debbugs.gnu.org; Mon, 05 Dec 2022 06:47:08 -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=1670240827; 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=Un917y2WMWORo0MGuVL9oUHV6QBXlBxPtSO2E0lRlyA=; b=sB6v+DcCaxE9kEAC2BF3yD7zv97zXExeKzQMF8dVvNTMpssT6Gkvwhqhk6JUhxwh946UXb sVJlN91D036ikCkIcIbh6aVK2+E5RsvQe5dvA1qOo6EiAcZAU5Sdev62eWIMfmJNRN0zNl lDR12wStrbGHqL/pTM2rDPbmqvTSvlTYuXvne/gImR9ONwmbnAeLV4pEjpxqLt42YyQHgb PGseaWYwtA4A8dzLa+6sI4dVsMcVtY9iObtzcszgd28lQ/AzqK+UrSZFj2PChn8jHmK7B5 CLfKAmhsrRUn5HWJQTJNSCHsdbZnRtVjRGKbMRsc19QM/nN4cMPiZJUOTyBUCg== From: Theodor Thornhill To: Yuan Fu , Eli Zaretskii Subject: Re: bug#59763: 29.0.60; Filling for c-ts-mode In-Reply-To: <684D8326-B59B-4A8D-9CD5-F0EB83CF5608@gmail.com> References: <69D98973-6824-47B3-900F-6DBEE669932F@gmail.com> <838rjpg8e1.fsf@gnu.org> <684D8326-B59B-4A8D-9CD5-F0EB83CF5608@gmail.com> Date: Mon, 05 Dec 2022 12:47:05 +0100 Message-ID: <87iliqdqdi.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59763 Cc: 59763@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 th= e 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 >> From 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 t= he >> 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. Theo From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 24 03:36:31 2022 Received: (at 59763) by debbugs.gnu.org; 24 Dec 2022 08:36:31 +0000 Received: from localhost ([127.0.0.1]:41724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9018-0003Ox-Nu for submit@debbugs.gnu.org; Sat, 24 Dec 2022 03:36:31 -0500 Received: from mail-pj1-f48.google.com ([209.85.216.48]:50900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9017-0003Op-1w for 59763@debbugs.gnu.org; Sat, 24 Dec 2022 03:36:29 -0500 Received: by mail-pj1-f48.google.com with SMTP id fy4so6868054pjb.0 for <59763@debbugs.gnu.org>; Sat, 24 Dec 2022 00:36:29 -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=HKOH+KMjNcBEv+4cv3zan+lUoTHcv8qhD9kw6RQWYNw=; b=efiRTG+391t7bYZXinJiUaCYSR4mYeEOMvUay9jlbEzQHwZERmsFV5zc3jodtoZUq5 00HqZ4z2W8Bb2/ugZMLpFrJf978nk9NfwBaKZhT1B4xQZR5E5NgZ40x33yZ00Q8tkaWP trpxvQHv5/l7hNWVJYEssEG/3joGPxKLHwq79TKnmjaG6uhwHlvdMIJmMwLUvIVMgQ9+ p5s3VUNLfQbbpDEKOeAs7NNah2AivmP1iGgMDIl28GiJP6MCOR3CDm3jlxrd8SPC7Ljc Bv/zePoPTBxBdHFvDI3c3MnkpodN6hJaXKZTxQFfi8jTSw/Tz6+7Cl9rtQ6iHB6nBrXF fZMw== 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=HKOH+KMjNcBEv+4cv3zan+lUoTHcv8qhD9kw6RQWYNw=; b=btqMSf5Ar5j2T53mxtd1tQ7abNxZSyd0eQ7IqrIajwCUQbTaMy/6IZlwjgAFWCTSkV uhXkTwtkRoqAEjjEkiehIw8ceQcCFq2Df6hBfKbO5NV0ruV+UgfIa+7D/tU4OfCuJkOP jz/XRjO8LhXZRdQytDfsbQVFQQZleVUODNV/a3sSM9wr4msNYiK6yo7EONe3OW9dFtpz 0ifwucxdbeKaQOFvuE1FZvVUEqq8LQBBpxtwoWj/9UUq8rBoq+R4Z9pp3j2MtstTS9+K 5J5UCEwgqADOm8DHLvJSN4vAcM+D+AORaFw3CV9dQkqWF+iPE2skhOU/AiAg8wxknxrH Jk2Q== X-Gm-Message-State: AFqh2kpf+DhPl+nUHqOpj4D/rLKezLRfz39ytE2uNqelfLWRkScPTo/Q wBk983wWtkOTezIrPnx+i8d6qdk1V9c= X-Google-Smtp-Source: AMrXdXstL1qZvuyewoIfHVWZbxJiwmV6RECPrInBm5M577LXiKBPUiJ3DBSFrosyr/rr7lJ4yY7RjA== X-Received: by 2002:a17:902:8d8f:b0:191:3b7b:3c2c with SMTP id v15-20020a1709028d8f00b001913b7b3c2cmr12430765plo.22.1671870983178; Sat, 24 Dec 2022 00:36:23 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id f15-20020a170902ab8f00b0018862bb3976sm3495133plr.308.2022.12.24.00.36.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Dec 2022 00:36:22 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#59763: 29.0.60; Filling for c-ts-mode Message-Id: Date: Sat, 24 Dec 2022 00:36:21 -0800 To: Theodor Thornhill X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 59763 Cc: Eli Zaretskii , 59763@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 24 03:44:10 2022 Received: (at 59763) by debbugs.gnu.org; 24 Dec 2022 08:44:10 +0000 Received: from localhost ([127.0.0.1]:41775 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p908Y-0003Uj-Aj for submit@debbugs.gnu.org; Sat, 24 Dec 2022 03:44:10 -0500 Received: from out2.migadu.com ([188.165.223.204]:23276) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p908G-0003UA-CC for 59763@debbugs.gnu.org; Sat, 24 Dec 2022 03:44:09 -0500 Date: Sat, 24 Dec 2022 09:42:30 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1671871431; 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=ypRvxrfVZKAV0Volvo3Iyud5ricWCjouYwkNF3WSF8c=; b=hydBNrMo0/ySeJsOdEoqAwjNxafAY21SiygrfgpfGmlEiR67SO/oNxlwG47NdBXqkDRYRp NGH0WOXaBC6NEbk72Vk+eiltrBeE5KefpgPQftn//RZIphy/Kn+172H47RdWh79NWoPG/r 3pVjy/xxC6PoYP0JswRZsDPb9hBZ5/y9nALxHUR0DWWrQ8O1DHWeWFst9S4K22FQP/wPq2 O1aa3j3Cczo48BPu1xZgW24b9451VH1wEPnsHvLhv437/z8lFyNSx89kCoNCgmpf/fDoqT JB0tG8wgXn0y7tQcpoQBT8F+4niHhUg1HNmNcVNtQj6i4LQFTlpmuQDlPSL9bA== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Theodor Thornhill To: Yuan Fu Subject: Re: bug#59763: 29.0.60; Filling for c-ts-mode In-Reply-To: References: Message-ID: <456ED673-26A2-408C-BC8E-70450C90ABD6@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 59763 Cc: Eli Zaretskii , 59763@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 fill= ing >>>>> function=2E Below is the function I have in my init=2Eel, could some= one 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=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 324= =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 comm= ent's >>>> second line is aligned with the "/*" on the previous line, not wit= h 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 a= ny >>> idea, don=E2=80=99t hesitate to go ahead :-) No obligations, of course= =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? Theo From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 24 20:30:47 2022 Received: (at 59763) by debbugs.gnu.org; 25 Dec 2022 01:30:47 +0000 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 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 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) 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) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#59763: 29.0.60; Filling for c-ts-mode Message-Id: <31451F7E-881F-4AFD-8409-CEFF7940BB61@gmail.com> Date: Sat, 24 Dec 2022 17:30:35 -0800 To: Theodor Thornhill X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 59763 Cc: eliz@gnu.org, 59763@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 25 02:33:27 2022 Received: (at 59763) by debbugs.gnu.org; 25 Dec 2022 07:33:27 +0000 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 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 Date: Sun, 25 Dec 2022 08:33:19 +0100 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. From: Theodor Thornhill To: Yuan Fu Subject: Re: bug#59763: 29.0.60; Filling for c-ts-mode In-Reply-To: <31451F7E-881F-4AFD-8409-CEFF7940BB61@gmail.com> References: <31451F7E-881F-4AFD-8409-CEFF7940BB61@gmail.com> Message-ID: <224EFC60-1826-428C-96AC-8965A2B9B302@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59763 Cc: eliz@gnu.org, 59763@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 26 16:31:18 2022 Received: (at 59763) by debbugs.gnu.org; 26 Dec 2022 21:31:18 +0000 Received: from localhost ([127.0.0.1]:54267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9v41-0002rM-SJ for submit@debbugs.gnu.org; Mon, 26 Dec 2022 16:31:18 -0500 Received: from mail-pl1-f169.google.com ([209.85.214.169]:46794) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9v3z-0002r6-GF for 59763@debbugs.gnu.org; Mon, 26 Dec 2022 16:31:16 -0500 Received: by mail-pl1-f169.google.com with SMTP id jn22so11536761plb.13 for <59763@debbugs.gnu.org>; Mon, 26 Dec 2022 13:31:15 -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=ea9X++Wk11XN3rDuUW9V44c55ssD0/eiIPK/O3FqsCY=; b=UcefBzo/8zbJJ1RzwvjAyaW7zo7jvl/mjqJGxRrYlS+WpVfnf/SEEeqzntexxmriWs hYJzxpZiKl2Lc6nbe0QFfLzqS8+CNdGl8DzgevrGcIdnI83SyWfi4A9jchUpcZOagAWz QPw80C1Kgp27+lxBC/WtyBa2hXp14cmIUE20YwizmZDzqXOL4zXprQPpZUisW6b1frnB 1gTHeoJQNQGxN0fj7X6GmUAdVr+JAKEh2DgVWLiaJRG0GL5fHHW4C86+mTRpKzuG3HFL KJinmZzx06gjPGExd+AgBS5vc9dIcqlejQ70t8Me7cdhrYEGdmtV2FppdEZ+8inHrVIF jKHQ== 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=ea9X++Wk11XN3rDuUW9V44c55ssD0/eiIPK/O3FqsCY=; b=gtRkMTIq7BC4I1pRfDkacDZ1HOHRrs4LxxQcfETbaVHPWbugZy2mxqa0RLTx9OzhJu DYUUTc/j0mp+wqQynD++dyOnpvoJN2YQ4ECV1AEl369R9FFyy64v8LlRgWLaZwKxC6oD 1r2scNbBckEz4sau9PFE7eScrqusYyXuxjAGKOr7ueD1mFth2NZuB6uE7R5skt3FbjmS ZxjGRqnVpx3DpcUcY0z+DYImDRD1o1BsXOeaHphSHaU6VOPH6nVZl+NX3ixesv8nF4d8 rtdKnTnH8TtXKhKScxtuqI8KvpKdgnSsnyqYEHm3vnz5Zb5Q9q+BUtgxlWlR9RUky/eZ 7tUA== X-Gm-Message-State: AFqh2ko152D6gS14AUpIG9NnCP4E18DOt2/gl9WSKOYL5KDRcivdRPeu xEBt4gZLEMqtz3uioCp1/iUVhWt7TFM= X-Google-Smtp-Source: AMrXdXu84130acbXgQSwGlPXyzjqoteBlPwDWz+CfvuEX6ANhFLY6rYXNV0FUxOpGSAj95/QHLC67w== X-Received: by 2002:a05:6a20:d685:b0:ac:83e:a9dc with SMTP id it5-20020a056a20d68500b000ac083ea9dcmr26852201pzb.13.1672090269699; Mon, 26 Dec 2022 13:31:09 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id u12-20020a170902e80c00b0018968d1c6f3sm7587913plg.59.2022.12.26.13.31.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Dec 2022 13:31:09 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#59763: 29.0.60; Filling for c-ts-mode Message-Id: Date: Mon, 26 Dec 2022 13:31:08 -0800 To: Theodor Thornhill X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 59763 Cc: eliz@gnu.org, 59763@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Theodor Thornhill writes: > 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 = 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. I added indent and filling for other C-like modes. >>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 > > How about just having treesit-utils.el, or something like that? There > are probably many things in the future that will be common among > modes, yet won't really warrant inheritance. I think we have such an > example in js/typescript too, iirc. If it=E2=80=99s shared across all tree-sitter modes, it should be in = treesit.el, of course. We are talking about things shared by tree-sitter C-like modes, so the scope is smaller. Since right now it=E2=80=99s only a handful functions, I made other = modes require c-ts-mode.el. In the future if things accumulate, we can put things into a separate file (c-ts-mode-common.el or something). Yuan From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 26 17:03:46 2022 Received: (at 59763) by debbugs.gnu.org; 26 Dec 2022 22:03:46 +0000 Received: from localhost ([127.0.0.1]:54284 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9vZS-0003nu-Cy for submit@debbugs.gnu.org; Mon, 26 Dec 2022 17:03:46 -0500 Received: from out-57.mta0.migadu.com ([91.218.175.57]:21055) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9vZN-0003nf-EM for 59763@debbugs.gnu.org; Mon, 26 Dec 2022 17:03:44 -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=1672092218; 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=s/cR3SauH1D9a5ocTYPBXxE8PMlYstGPKfwwjbDrn+s=; b=xfWzgwEgUuTsn1mYaCjk4TLba3j1AqA7PR7lqihOsPhBq+xPVVP95WrKr6xDkLIQRu2CGi sz6q1Ho/vnDzanF0K97azMUltqCwQ2Sq9ZLxzdkyWhQTaQrvXnxvvHz931u66QBMk8oHzx RoHDtMV/K87lJdu09N6Ubr/KDnmZW2K6UeYaDVfusFRa79k9F58go/IX/wjfhLTNLIyHLK PaKMkUlx7RO1JQOTSyNlNHU3fJ43OqrvIi9VU7VOjsMMjH/o29Gl6AxMN7GT/9gkZO39mE 4Ws5NA+++tKfFnUSO8EeSbWk1V44PA+BIgVCX5juzI5h0MWRpFH32XOvpNtxsw== From: Theodor Thornhill To: Yuan Fu Subject: Re: bug#59763: 29.0.60; Filling for c-ts-mode In-Reply-To: References: Date: Mon, 26 Dec 2022 23:03:36 +0100 Message-ID: <87zgb9g6vb.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 59763 Cc: eliz@gnu.org, 59763@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Yuan Fu writes: > Theodor Thornhill writes: > >> 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 f= illing >>>>>>>>> function. Below is the function I have in my init.el, could someo= ne 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 ha= ve the time to try >>>>>>>>> it out and see how well it works. >>>>>>>>=20 >>>>>>>> Thanks. >>>>>>>>=20 >>>>>>>> From 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 com= ment'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 cou= rse. >>>>>>> >>>>>>> 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. > > I added indent and filling for other C-like modes. > >>>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 mode= s to >>>require c-ts-mode shouldn=E2=80=99t be a big problem, I think? >>> >>>Yuan >> >> How about just having treesit-utils.el, or something like that? There >> are probably many things in the future that will be common among >> modes, yet won't really warrant inheritance. I think we have such an >> example in js/typescript too, iirc. > > If it=E2=80=99s shared across all tree-sitter modes, it should be in tree= sit.el, > of course. We are talking about things shared by tree-sitter C-like > modes, so the scope is smaller. > > Since right now it=E2=80=99s only a handful functions, I made other modes > require c-ts-mode.el. In the future if things accumulate, we can put > things into a separate file (c-ts-mode-common.el or something). > Sure. I just don't like it when these namespaces blend too much. But your call :-) Theo From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 26 17:51:20 2022 Received: (at 59763) by debbugs.gnu.org; 26 Dec 2022 22:51:20 +0000 Received: from localhost ([127.0.0.1]:54323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9wJU-0004zm-3r for submit@debbugs.gnu.org; Mon, 26 Dec 2022 17:51:20 -0500 Received: from mail-pl1-f180.google.com ([209.85.214.180]:40787) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9wJP-0004zV-Hy for 59763@debbugs.gnu.org; Mon, 26 Dec 2022 17:51:18 -0500 Received: by mail-pl1-f180.google.com with SMTP id b2so11691552pld.7 for <59763@debbugs.gnu.org>; Mon, 26 Dec 2022 14:51:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=q7Bj68XZUoMQB9d7LKbY9Gc+3bfSvi+a23u1zrw64JY=; b=T5x8m2OM5Vaz7o0yd2m45yS1BkCtwV4PNMg4sPUVU+8CCf0Q8tj6UIQzbM4+1GgaCP ROlRoMqVFxtmOiUBMNTtv+1JZmKEO0DD/5a0f7VWMdXanVFSWY1uqRlHZzorCSPapvXh 6Y4AxsfnFDhVAdFDsJd0DEG0cJ5i9mTB5PRCgdWHjI1QvHXUodZlSPD4+evbFVj5UTQp hWedHa4US7T/8jDbN09kxofnEC5U7S9E/eLThyrN3E4Nv48egg+n2JxXvksuUnZrEQL/ NWrV8j2eLJvbE4hLQyqY7N3iKe6c9F3WdUL2jvH2rqTsQuxO8qp3Y/94a9fEEs3XPWGV kpTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q7Bj68XZUoMQB9d7LKbY9Gc+3bfSvi+a23u1zrw64JY=; b=qc5MHsH/ZTWjpSdDoeZkQRrk5mBW3+xHwVBgmDS+0Q3aW4r2MMKgTGBQpoj548Krwx lolpyljgVaE1S3uitmZ7wjPD58okkeDN/ipOJFNYF7S+SJZHKKXZ6ruLOwR3o2/xplNC 2Wri4lbKRriJ/tAMpHnY6FIsg2+nwK1IjzaO22Y0Ax+HJTcJi9qI7+Zfuj/8jMt1aLjT yxstgrmbSPXoG2VOpFQzfq64zqL1pFmpSDlW2g97Fu72XKDh9MAziRVLrJi6ZPsF1Cxu 7FJs0k+r1WSjcNzdG+bAmR6uaHyKa9lMBlTblpCc1u3VNaWeacdAf8B5LUnFW2U5lyIY 78Ew== X-Gm-Message-State: AFqh2ko2sALygsSAoCXLptMy/d5sS6cPn0Ae/AnrDJr58RQ7khRo1yH0 FCr+e4r2mHCBEcX2MQokgR4= X-Google-Smtp-Source: AMrXdXvK1c683eHdUqfXxI1lmY0Gy0qhiRKFpwH8N59974yygUj3LkS6RSCn8B4UKu7F0gwyETaUIg== X-Received: by 2002:a17:902:da86:b0:189:d0c9:f7d0 with SMTP id j6-20020a170902da8600b00189d0c9f7d0mr27449798plx.27.1672095069660; Mon, 26 Dec 2022 14:51:09 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id y2-20020a17090264c200b00192749a5257sm3118539pli.189.2022.12.26.14.51.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Dec 2022 14:51:09 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#59763: 29.0.60; Filling for c-ts-mode From: Yuan Fu In-Reply-To: <87zgb9g6vb.fsf@thornhill.no> Date: Mon, 26 Dec 2022 14:51:08 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <87zgb9g6vb.fsf@thornhill.no> To: Theodor Thornhill X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 59763 Cc: Eli Zaretskii , 59763@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Dec 26, 2022, at 2:03 PM, Theodor Thornhill = wrote: >=20 > Yuan Fu writes: >=20 >> Theodor Thornhill writes: >>=20 >>> On 25 December 2022 02:30:35 CET, Yuan Fu wrote: >>>>=20 >>>> Theodor Thornhill writes: >>>>=20 >>>>> On 24 December 2022 09:36:21 CET, Yuan Fu = wrote: >>>>>>=20 >>>>>> Theodor Thornhill writes: >>>>>>=20 >>>>>>> Yuan Fu writes: >>>>>>>=20 >>>>>>>>> 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. >>>>>>>>=20 >>>>>>>> I see. I=E2=80=99ll need to look at how cc-mode fill comments. >>>>>>>>=20 >>>>>>>>>=20 >>>>>>>>> Btw, this command should be bound to M-q in ts-c-mode. >>>>>>>>=20 >>>>>>>> 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. >>>>>>>>=20 >>>>>>>> Yuan >>>>>>>=20 >>>>>>> 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. >>>>>>=20 >>>>>> I did some work in filling, it should work like cc-mode in like = 90% of >>>>>> the cases now, yay! >>>>>>=20 >>>>>> Yuan >>>>>=20 >>>>> Nice! For all cc-ts-modes? >>>>=20 >>>> 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. >>=20 >> I added indent and filling for other C-like modes. >>=20 >>>> 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? >>>>=20 >>>> Yuan >>>=20 >>> How about just having treesit-utils.el, or something like that? = There >>> are probably many things in the future that will be common among >>> modes, yet won't really warrant inheritance. I think we have such an >>> example in js/typescript too, iirc. >>=20 >> If it=E2=80=99s shared across all tree-sitter modes, it should be in = treesit.el, >> of course. We are talking about things shared by tree-sitter C-like >> modes, so the scope is smaller. >>=20 >> Since right now it=E2=80=99s only a handful functions, I made other = modes >> require c-ts-mode.el. In the future if things accumulate, we can put >> things into a separate file (c-ts-mode-common.el or something). >>=20 >=20 > Sure. I just don't like it when these namespaces blend too much. But > your call :-) It can be treesit-c-common.el or something. We=E2=80=99ll figure it out = when the time comes ;-) Yuan= From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 26 18:00:47 2022 Received: (at 59763) by debbugs.gnu.org; 26 Dec 2022 23:00:47 +0000 Received: from localhost ([127.0.0.1]:54329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9wSd-0005E6-A3 for submit@debbugs.gnu.org; Mon, 26 Dec 2022 18:00:47 -0500 Received: from out2.migadu.com ([188.165.223.204]:28762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9wSb-0005Dw-Cp for 59763@debbugs.gnu.org; Mon, 26 Dec 2022 18:00:45 -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=1672095643; 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=wDDWA28agI1wcLEtjztUCUadeSfP05Q3As5OErtmA8w=; b=y3HYLTqtr+SEXSdEuViePsW9ZmPyPDsXplyWIhaOUFwSHq9KtH0DLYzLe0Cw+OD8BUcWbL izDMylorE4y3UPz1N+LlcxOt4FkBkqX1lw0Gal8u43q0mqb5zPEEL9DTwdoHf19RXUYRx0 KLF3oGkqmbiOIZXjggkSD93ZOUeQkk06BoySXs0rTScevhqaRGZBmTjpxc6zNl/TYwESf3 5uyNu3hhgPK0AfyZEzD+FxB1Jakzml9JrJt0asSdwOWrntme3CtWjIYM5oPvTEzXyiYr26 KvObhhp2y7YgpiWqdUv4NJdm1qLWruD+KYZeqdHoi6/ebM3kc+D83bLIvcQaHQ== From: Theodor Thornhill To: Yuan Fu Subject: Re: bug#59763: 29.0.60; Filling for c-ts-mode In-Reply-To: References: <87zgb9g6vb.fsf@thornhill.no> Date: Tue, 27 Dec 2022 00:00:42 +0100 Message-ID: <87r0wlg485.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59763 Cc: Eli Zaretskii , 59763@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Yuan Fu writes: >> On Dec 26, 2022, at 2:03 PM, Theodor Thornhill wrote: >>=20 >> Yuan Fu writes: >>=20 >>> Theodor Thornhill writes: >>>=20 >>>> On 25 December 2022 02:30:35 CET, Yuan Fu wrote: >>>>>=20 >>>>> Theodor Thornhill writes: >>>>>=20 >>>>>> On 24 December 2022 09:36:21 CET, Yuan Fu wrote: >>>>>>>=20 >>>>>>> Theodor Thornhill writes: >>>>>>>=20 >>>>>>>> Yuan Fu writes: >>>>>>>>=20 >>>>>>>>>> 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 som= eone have >>>>>>>>>>> a look and see if it=E2=80=99s good? Alternatively we could cop= y 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 >>>>>>>>>> From 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 t= he >>>>>>>>>> function. Observe how the first non-blank character of the co= mment's >>>>>>>>>> second line is aligned with the "/*" on the previous line, not= with the >>>>>>>>>> text after "/*" as I'd expect. >>>>>>>>>=20 >>>>>>>>> I see. I=E2=80=99ll need to look at how cc-mode fill comments. >>>>>>>>>=20 >>>>>>>>>>=20 >>>>>>>>>> Btw, this command should be bound to M-q in ts-c-mode. >>>>>>>>>=20 >>>>>>>>> Will do, once our fill function works well. BTW, Theo, if you hav= e any >>>>>>>>> idea, don=E2=80=99t hesitate to go ahead :-) No obligations, of c= ourse. >>>>>>>>>=20 >>>>>>>>> Yuan >>>>>>>>=20 >>>>>>>> Sure! Added to my list :) I had a function at some point that us= ed >>>>>>>> c-mode to do this. I'll see if I can polish it a little. >>>>>>>=20 >>>>>>> I did some work in filling, it should work like cc-mode in like 90%= of >>>>>>> the cases now, yay! >>>>>>>=20 >>>>>>> Yuan >>>>>>=20 >>>>>> Nice! For all cc-ts-modes? >>>>>=20 >>>>> 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. >>>=20 >>> I added indent and filling for other C-like modes. >>>=20 >>>>> But I wonder where should we put it, I guess it=E2=80=99s fine to lea= ve it in >>>>> c-ts-mode, since there really isn=E2=80=99t much code. Having other m= odes to >>>>> require c-ts-mode shouldn=E2=80=99t be a big problem, I think? >>>>>=20 >>>>> Yuan >>>>=20 >>>> How about just having treesit-utils.el, or something like that? There >>>> are probably many things in the future that will be common among >>>> modes, yet won't really warrant inheritance. I think we have such an >>>> example in js/typescript too, iirc. >>>=20 >>> If it=E2=80=99s shared across all tree-sitter modes, it should be in tr= eesit.el, >>> of course. We are talking about things shared by tree-sitter C-like >>> modes, so the scope is smaller. >>>=20 >>> Since right now it=E2=80=99s only a handful functions, I made other mod= es >>> require c-ts-mode.el. In the future if things accumulate, we can put >>> things into a separate file (c-ts-mode-common.el or something). >>>=20 >>=20 >> Sure. I just don't like it when these namespaces blend too much. But >> your call :-) > > It can be treesit-c-common.el or something. We=E2=80=99ll figure it out w= hen the time comes ;-) > Yep :) Theo From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 07 18:11:16 2023 Received: (at 59763-done) by debbugs.gnu.org; 7 Jan 2023 23:11:16 +0000 Received: from localhost ([127.0.0.1]:59208 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEILL-0007NI-Ri for submit@debbugs.gnu.org; Sat, 07 Jan 2023 18:11:16 -0500 Received: from mail-pj1-f52.google.com ([209.85.216.52]:40536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEILJ-0007N3-QL for 59763-done@debbugs.gnu.org; Sat, 07 Jan 2023 18:11:14 -0500 Received: by mail-pj1-f52.google.com with SMTP id c8-20020a17090a4d0800b00225c3614161so8967911pjg.5 for <59763-done@debbugs.gnu.org>; Sat, 07 Jan 2023 15:11:13 -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=NarGmpTQ+32DaItfSuVtmvest5DT40T9j4xf7MaTPsk=; b=V0RsAQ6Ff0ZcLAO0Li/UtstAMQOq6zQ/d7zWNNm4r2BUaUnA5Y/6EUtzie8XhKT3Us JR25BZhBbbC/rjnvknuUYxGAB20LpFj1omsQQ050GC7l+XiHYEWXgSgdDGxVOXkGnVJh URBqUmVSQU6FzOEmkBt0i7xSrJqbqdp8KElnStrXryYoX6ifQUzWPRkZbsCUwtMyrcMR hnT0uG7YGMnHgFd3dyLCjImOGum1lWUfa5GSBImOntTy4t13x//ry5UKJxtZEKArxxvR yv3Re6L90UTcYzP/VLqpUvGE8Ad7alW8vV58fc3l/4CL/NI/UL2y2OOc0KFuPE/bc/UU QhAg== 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=NarGmpTQ+32DaItfSuVtmvest5DT40T9j4xf7MaTPsk=; b=YKPEY66HTK8ejNJPmjI6dozG2OKrcU9505L6VqRj4f1dqgSuVmQAz+XziOcIqQXfa4 z2cxV9ikYith3Y2UOhg5v8jfrPeD+2ucCdL1SvPLTe08GOSG6fTAxH60GaIHABDTayeC uJo6Bk3Xd3m7pQquU1B6uOsnIyA4QE3XwveaQKSj9OyehaTTW2qYfr+fTvPgxzm8/Vwm GAmHhC6pe3w5eau+QOtBcP7TohBLSulLorvtcSRWrtUxWOo8TRN0YiIFDBjqpzogZMb4 jx0g36Ls1OJvAPP1P115t16jHAUIAwvjv4XKEas893422n/JelCPz8e2v+ozIBRLNC1t ed4A== X-Gm-Message-State: AFqh2kpvv2xXmqGSs8POS6QaGA1cr6oOlZHqlsEfNFvi8R3WyJldAGZ0 kLR5qGo3KlYu734YfW6BbW19wx8UhGI= X-Google-Smtp-Source: AMrXdXuGIBmoy0/yi/vY2tmsyxxsno0zYwP0VzLm+bht6OtmK/WOnJWYGqDko7Fng0PVCpd8yup2Jg== X-Received: by 2002:a05:6a20:4290:b0:ad:4642:c671 with SMTP id o16-20020a056a20429000b000ad4642c671mr92297045pzj.12.1673133068187; Sat, 07 Jan 2023 15:11:08 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id 187-20020a6214c4000000b005828071bf7asm2006031pfu.22.2023.01.07.15.11.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Jan 2023 15:11:07 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#59763: 29.0.60; Filling for c-ts-mode Message-Id: <5BD2B9A3-8D59-4942-9A97-213AF41DCE8F@gmail.com> Date: Sat, 7 Jan 2023 15:11:07 -0800 To: Theodor Thornhill X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 59763-done Cc: 59763-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Theodor Thornhill writes: > Yuan Fu writes: > >>> On Dec 26, 2022, at 2:03 PM, Theodor Thornhill = wrote: >>>=20 >>> Yuan Fu writes: >>>=20 >>>> Theodor Thornhill writes: >>>>=20 >>>>> On 25 December 2022 02:30:35 CET, Yuan Fu = wrote: >>>>>>=20 >>>>>> Theodor Thornhill writes: >>>>>>=20 >>>>>>> On 24 December 2022 09:36:21 CET, Yuan Fu = wrote: >>>>>>>>=20 >>>>>>>> Theodor Thornhill writes: >>>>>>>>=20 >>>>>>>>> Yuan Fu writes: >>>>>>>>>=20 >>>>>>>>>>> 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=99= t 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. >>>>>>>>>>=20 >>>>>>>>>> I see. I=E2=80=99ll need to look at how cc-mode fill = comments. >>>>>>>>>>=20 >>>>>>>>>>>=20 >>>>>>>>>>> Btw, this command should be bound to M-q in ts-c-mode. >>>>>>>>>>=20 >>>>>>>>>> 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. >>>>>>>>>>=20 >>>>>>>>>> Yuan >>>>>>>>>=20 >>>>>>>>> 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. >>>>>>>>=20 >>>>>>>> I did some work in filling, it should work like cc-mode in like = 90% of >>>>>>>> the cases now, yay! >>>>>>>>=20 >>>>>>>> Yuan >>>>>>>=20 >>>>>>> Nice! For all cc-ts-modes? >>>>>>=20 >>>>>> 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. >>>>=20 >>>> I added indent and filling for other C-like modes. >>>>=20 >>>>>> 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? >>>>>>=20 >>>>>> Yuan >>>>>=20 >>>>> How about just having treesit-utils.el, or something like that? = There >>>>> are probably many things in the future that will be common among >>>>> modes, yet won't really warrant inheritance. I think we have such = an >>>>> example in js/typescript too, iirc. >>>>=20 >>>> If it=E2=80=99s shared across all tree-sitter modes, it should be = in treesit.el, >>>> of course. We are talking about things shared by tree-sitter C-like >>>> modes, so the scope is smaller. >>>>=20 >>>> Since right now it=E2=80=99s only a handful functions, I made other = modes >>>> require c-ts-mode.el. In the future if things accumulate, we can = put >>>> things into a separate file (c-ts-mode-common.el or something). >>>>=20 >>>=20 >>> Sure. I just don't like it when these namespaces blend too much. = But >>> your call :-) >> >> It can be treesit-c-common.el or something. We=E2=80=99ll figure it = out when the time comes ;-) >> > > Yep :) > Theo I=E2=80=99ve added this to other modes, closing this report. Yuan From unknown Sun Jun 22 08:06:53 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 05 Feb 2023 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator