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.devel Subject: Re: c-ts-mode Date: Mon, 11 Sep 2023 17:34:12 -0700 Message-ID: References: <5F73CB5D-DB00-439F-AD7C-7E209EC83A35@gmail.com> <83jzt2z5mk.fsf@gnu.org> <83y1hhykni.fsf@gnu.org> <877cp1lvih.fsf@gmail.com> <83v8clyhqi.fsf@gnu.org> <83tts5ygv2.fsf@gnu.org> <83msxxxkc0.fsf@gnu.org> <871qf9ktxd.fsf@gmail.com> <838r9gykia.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) 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="39309"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= , Theodor Thornhill , spacibba@aol.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 12 02:35:06 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qfrMw-0009zJ-Il for ged-emacs-devel@m.gmane-mx.org; Tue, 12 Sep 2023 02:35:06 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfrML-0002ml-S6; Mon, 11 Sep 2023 20:34:29 -0400 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 1qfrMK-0002lR-OP for emacs-devel@gnu.org; Mon, 11 Sep 2023 20:34:28 -0400 Original-Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qfrMH-0004b1-RE; Mon, 11 Sep 2023 20:34:28 -0400 Original-Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-570836f1c79so3560555a12.0; Mon, 11 Sep 2023 17:34:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694478863; x=1695083663; darn=gnu.org; 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=myNP4TBDE+DniuNVMRKQyYrW3myXIHPXB3qQbpvhKP4=; b=W23VtMkPHBBfVvJVh7a1o9p5isJPr1LBdvO163Bg1EE7JV+TZbFTObVO05nq6qDbUw 9fyggzkrAAozn4R2U1mMpAVWJrsPALWRzIERECneZUUPNiWS4xu2mmXdGom+psrkQ750 eEhHo8vYan77qqCC/HIAA182FQBYAdNUfpLUU7UqzBAIeinjbtP+0vSqzUDawX/89Jhy ddtMNkEUdtoypA7MQ7Oq4aPJD5fEHVKUZT44hXyLJKhXm5+YHozPu+PD7LSGAuaDt2Pa roEJbhXfn8qPVIJJHMjbx1CFgKKaZ+N0TkYKLUgbynetjvvwFVkbTNLcRFAJNnFxbcdI OZDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694478863; x=1695083663; 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=myNP4TBDE+DniuNVMRKQyYrW3myXIHPXB3qQbpvhKP4=; b=nXMQoxXBsFH39SDBn0zVE9fhTI0Rr9VW5Nhxdt4QsRC2fslNBFqrKourReOWj/3uib B4AHqxNQrfbZ4/6Rbl1I4rTVW041druv3j9NpnK4OVUn5ROEnNkrXrFKhLqSD/QjLnV5 g4IbXr1Ty2VYMBzSzetsp2l/UQJbmWkdJlnnKolTUpeFZfvGukMeY6hHIk23poZc9LHD yupmqTsLLwZjda1d/MaOWealgRi2FEzdDBJXB0jZwdJ+S2bpk46HC2D27vZXsPTPFI9T 8O/rFx23z7gJWHG/NiD94XflHlOBdISQ8k5jVsDGxjrqUJWSPkKNj5hsSBUG9AYNaxd1 MJYA== X-Gm-Message-State: AOJu0YzFHFn1UwvQkYrPUZgCWLSXXtOWp0VSoGm5aRaa+CQg+OdyLTrm /8ernuxX2ZRVilfPMS/a501puixyogU= X-Google-Smtp-Source: AGHT+IHAN54FuqHlWhZH29BfliF5xxGUwHW2il7abFdoLd8bY6Mbv6IfFJWIomx7yidATxqMhkQm2Q== X-Received: by 2002:a05:6a20:948f:b0:148:14ed:2b88 with SMTP id hs15-20020a056a20948f00b0014814ed2b88mr8762939pzb.30.1694478863643; Mon, 11 Sep 2023 17:34:23 -0700 (PDT) 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 x18-20020a056a00271200b00653fe2d527esm6135572pfv.32.2023.09.11.17.34.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Sep 2023 17:34:23 -0700 (PDT) In-Reply-To: <838r9gykia.fsf@gnu.org> X-Mailer: Apple Mail (2.3731.700.6) Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=casouri@gmail.com; helo=mail-pg1-x52c.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:310493 Archived-At: > On Sep 8, 2023, at 4:25 AM, Eli Zaretskii wrote: >=20 >> From: Jo=C3=A3o T=C3=A1vora >> Cc: Theodor Thornhill , casouri@gmail.com, >> spacibba@aol.com, emacs-devel@gnu.org >> Date: Fri, 08 Sep 2023 08:25:50 +0100 >>=20 >>> What I had in mind was a simple alist, like CC Mode uses, with an >>> infrastructure function to install it. Patches are welcome. >>=20 >> It would certainly work for me, at least for my very simple case, and = I >> would be happy for this. Not sure it is half as powerful, for = example >> how would you make that simple alist express cases where you want to = add >> the rules _after_ the base set? >=20 > How does CC Mode support this (if it does)? I think we should allow > users of CC Mode easy migration to c-ts-mode. Anything beyond that > is, of course, welcome, but it is less important from my POV. >=20 > I'll let Theo and Yuan chime in on the other points you make. I don=E2=80=99t think users would be happy if they need to know CLOS to = customize indentation rules. IMO users would be better off modifying = treesit-simple-indent-rules in the major mode hook. It=E2=80=99s an = alist of (LANGUAGE . RULES).=20 So something like (setf (alist-get 'lang treesit-simple-indent-rules) (append '(custom-rules...) (alist-get 'lang treesit-simple-indent-rules))) Would do the trick. Admittedly that=E2=80=99s a tiny bit clunky, we can add a helper = function like (treesit-simple-indent-add-rules RULES &optional LANG). Yuan=