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, 07 Sep 2023 18:53:58 +0100 Message-ID: <877cp1lvih.fsf@gmail.com> References: <5F73CB5D-DB00-439F-AD7C-7E209EC83A35@gmail.com> <83jzt2z5mk.fsf@gnu.org> <83y1hhykni.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="2227"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) 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 19:52:12 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 1qeJAq-0000Ip-NP for ged-emacs-devel@m.gmane-mx.org; Thu, 07 Sep 2023 19:52:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeJA1-0001P2-FP; Thu, 07 Sep 2023 13:51:21 -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 1qeJ9y-0001Ou-UU for emacs-devel@gnu.org; Thu, 07 Sep 2023 13:51:18 -0400 Original-Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeJ9w-0004LC-KQ; Thu, 07 Sep 2023 13:51:18 -0400 Original-Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-31c479ede21so1207556f8f.2; Thu, 07 Sep 2023 10:51:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694109074; x=1694713874; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c3OFKfDJChoE2UsJ3+lPk9sH8HiIjiUeNPpUFQtE4kI=; b=QfhtzAqsTJhgywkIb2gJn2MQs/pYVtp6Abt06cszHw5OaxgUbr2AXNdLratm28Hh/K GuStLzP4TeJ94bOmWTANr16Lw6zNvAW9gK0cLwt1H5E1dq4lTdEGpft0BOk0gROMFL6+ YS0L8IquUqyGlQLrfSd/DPSROlrTFJfrICdJGuhdCgW96pLgSijvbqh/STe8MNSe1EwQ 2ecAtJhq6mHUE2SHRb20H7J/sXihyLAvjC+dKjN8R2HjLAoCZy1PiS9fDpIyFsLrUH4C LrIi3ICHwfioJh/HS7zmzGwNKgapvIvRXamu61yb2UZ0P31OcpVdG62KQbRWHdjvBTNm 4rJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694109074; x=1694713874; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=c3OFKfDJChoE2UsJ3+lPk9sH8HiIjiUeNPpUFQtE4kI=; b=tMTaMx/FWdia6a1nTKs1OevCdC5dgutwHfgMFUIM4y9U/YSMx/mdRGZ/cjKmJXMwRz AD/k8MKjZYsSRfiNzebygYwehgwpBTD4MTICkAWF7Cz/EJ4D5G1FgAla8dIbVZ61d5fY wm6qgJGC6BDpZ8Rqh959lPIM5QYulOniIevq/5GXceKCXs3I8UK/KcYIX2Q9qF7zDzUI oM7Lo9vNZPiMxMkl9pNfHf3zj0j+UsqO31ztS25QO/2lwsPztMdOoOpDx9vVM/8gm3J5 QbNRsGxCeDoiDN9WAELx+ndUJTZcFweZ3f64ZaACZHswTj9Qirjsh57Ql4UDoSVU9wri feJQ== X-Gm-Message-State: AOJu0YzNv5h1vVfgaf4Vn8nO8y2Pr7kpzJJqLijx904eevIqZ5PR0dd4 AinhDwLX+GDcJlO079wS/Q2ZbowUuMOmxg== X-Google-Smtp-Source: AGHT+IFGSN0ecxPIu1lSvdan2HAZUMMRzvuc4Ojofevd3p7CF+hAnbv6+Y1hbvnKl/v/YCG4pKIxzw== X-Received: by 2002:adf:ffc9:0:b0:315:9362:3c70 with SMTP id x9-20020adfffc9000000b0031593623c70mr93525wrs.60.1694109073791; Thu, 07 Sep 2023 10:51:13 -0700 (PDT) Original-Received: from krug ([87.196.73.130]) by smtp.gmail.com with ESMTPSA id p15-20020a05600c468f00b003fef19bb55csm3212278wmo.34.2023.09.07.10.51.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 10:51:13 -0700 (PDT) In-Reply-To: <83y1hhykni.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 07 Sep 2023 20:10:09 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=joaotavora@gmail.com; helo=mail-wr1-x42c.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:310273 Archived-At: Eli Zaretskii writes: >> From: Jo=C3=A3o T=C3=A1vora >> Date: Thu, 7 Sep 2023 16:58:29 +0100 >> Cc: casouri@gmail.com, spacibba@aol.com, emacs-devel@gnu.org >>=20 > I think c-ts-mode--indent-styles needs to be refactored toallow fine > control on the indentation parameters that are currently hard-coded > for each supported style. They will need to have different names, > because tree-sitter doesn't use the CC Mode terminology for the > syntactical constructs. Also, there seem to be many more parameters > than in CC Mode. I've been doing some experiments with c-ts-mode-indent-style, which can be set to a function that returns a list that adds new items in front of the list returned by with: (alist-get 'gnu (c-ts-mode--indent-styles 'cpp)) It's not super clean (notice the '--'), but not very dirty either. The hard part is writing the rule in question, but I'll get there I think. > First, please submit a bug report about this with all the details. Done. bug#65810 > And second, I don't seem to be able to reproduce this, assuming that > by C-M-foo you meant C-M-f and C-M-b. Maybe this needs some > particular source file to reproduce? (I tried with one C file and one > C++ file.) You assumed correctly, And no, it works with an empty file even. The recipe is so simple I might as well repost it here: ~/Source/Emacs/emacs/src/emacs -nw -Q ~/tmp/simple.cpp -f c++-ts-mode Then just try any C-M-f or C-M-b or C-M-u etc, and see the error happening. I installed my grammar with M-x treesit-install-language-grammar today. But it also happens with a grammar installed in the same way many months ago. Doesn't seem to happen in c-ts-mode. >> 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? > > Yes, see treesit-defun-tactic. Will check it out, thanks. Jo=C3=A3o