From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: c-ts-mode Date: Thu, 7 Sep 2023 16:58:29 +0100 Message-ID: References: <5F73CB5D-DB00-439F-AD7C-7E209EC83A35@gmail.com> <83jzt2z5mk.fsf@gnu.org> 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="24023"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, 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 Thu Sep 07 17:59:43 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 1qeHPy-0005vw-Pl for ged-emacs-devel@m.gmane-mx.org; Thu, 07 Sep 2023 17:59:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeHP7-0003NS-6I; Thu, 07 Sep 2023 11:58:49 -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 1qeHP5-0003N9-Nh for emacs-devel@gnu.org; Thu, 07 Sep 2023 11:58:47 -0400 Original-Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeHP3-0000ZK-CV; Thu, 07 Sep 2023 11:58:47 -0400 Original-Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2bcc846fed0so19480761fa.2; Thu, 07 Sep 2023 08:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694102322; x=1694707122; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=p3yfAVhcooF2sTuD7DoQNL0vG4rOmPukt/E/nt1FWU0=; b=NoH2Ne9F27S4Gk3Z8QHErP/41Z5VDNe3HHKFIO3Sr3nOdmXJJ3cQX8rQ0VI7bx0Td0 +lmJ3/9HqH4xAhvQu0+O3/kpvDuz2fpjL95mmakv26Bz5QzCjwb3qBSUpIUwS5wSSbkG evkhW8xpZvFTCESMPKL6Lky0JB2oTdAkhAqX4pfnYkB4wKMDT3XOhM9mLzcqCH1jRJ3R QiA0+57K8bLlBo85KfyHGeNrc59l84ZWuig6/0MbsVajT/SK7KFrf69aa7TG4onFO2xr Qz61jptvE7ax8WA/gq0nfyQwyy1GVBjtdeyUKLHTRallErpMdCpXpVgYW/jNuTDoBuyT ozHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694102322; x=1694707122; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p3yfAVhcooF2sTuD7DoQNL0vG4rOmPukt/E/nt1FWU0=; b=QfGStLBTz2vaoy/XYhbERn0KfTWE+22rj23o0P4DPGV7rmrkd2+sOF8z8W86aLd6mU L8LqsNoqLwqBm/85Os+tOFNRHMud4PnJ8IVxHCVF3vOfjImM5SGXGVKginatgX6pW5c4 2yVnPhsQz0UYSOndMbc47GHLmaldIYy8fLGk6gXsxDVahm68I1Km12fENuelX6Kn9CnE Cvt5WTljAT5X/6+i1tkQW3tnbvMP3zvlzUl9umFd61NBvIKsBIdJL86hQlzBvkDByEY/ JFMNkLKlVn5+BFVMLol+wFbbyIVYyvVIPEesNrIHJrlEBXcpuhLOAoYhA4p2QgRayCo5 pWpw== X-Gm-Message-State: AOJu0YyJvL3FAyyCPmJadxVfJX/TnaI1cYxMsppA+/oQe7WaqgtP60SJ isczN+/LHlDZhDLSp19S1K1Mfwpzb8A26x1X/XMr/N6M+yQzfQ== X-Google-Smtp-Source: AGHT+IHdGyf9Pkq+llor7JbBM0/JEwX3v0gM69EoxfTecJNabLneOPX4iDJuR2vDBpm4jtd+JLpr67ICgTx/8sqflsk= X-Received: by 2002:a2e:98d3:0:b0:2bc:ffec:742 with SMTP id s19-20020a2e98d3000000b002bcffec0742mr4797628ljj.49.1694102321552; Thu, 07 Sep 2023 08:58:41 -0700 (PDT) In-Reply-To: <83jzt2z5mk.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::22f; envelope-from=joaotavora@gmail.com; helo=mail-lj1-x22f.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-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:310263 Archived-At: On Thu, Sep 7, 2023 at 10:37=E2=80=AFAM Eli Zaretskii wrote: > Some of the styles are already supported. The rest should also be > possible (at least most of them), but someone will have to write the > code. It is not a simple matter of "importing", since CC Mode > implements these features based on infrastructure that either doesn't > exist or makes no sense in treesit-supported modes. Thanks for clarifying. My current cc-mode user style is very simple (I think) it inherits from the 'gnu' style and adds minimal things. (c-add-style "user" '("gnu" (c-special-indent-hook) (c-offsets-alist (substatement-open . 0) (namespace-open . -2) (innamespace . -2) (extern-lang-open . -2) (inextern-lang . -2)))) Basically I'd just like to keep code inside top-level C++ namespaces and extern blocks unindented. As to substatement-open I don't even know what the purpose is anymore. I see that c++-ts-mode already has a gnu user style, so I would just need to add my preferences. Is there a manual entry somewhere for learning how to do this? Also, if I may go on a tangent: Is the forward-sexp-function for c++-ts-mode currently undergoing work on master? It doesn't seem to work and all C-M-foo navigation is broken as a result. Debugger entered--Lisp error: (treesit-invalid-predicate nil) treesit-node-match-p(# sexp t) #f(compiled-function (node) #)(#) treesit-node-top-level(# #f(compiled-function (node) #) t) treesit--things-around(47 sexp) treesit--navigate-thing(47 1 end sexp restricted) treesit-end-of-thing(sexp 1 restricted) treesit-forward-sexp(1) Setting the variable to nil brings me to more familar and satisfactory terrain where, and I suppose the non-treesit syntax table is being used for that. Is there any big advantage in switching to treesitter's forward-sexp-function? Jo=C3=A3o