From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: c-ts-mode Date: Thu, 07 Sep 2023 21:13:09 +0300 Message-ID: <83v8clyhqi.fsf@gnu.org> References: <5F73CB5D-DB00-439F-AD7C-7E209EC83A35@gmail.com> <83jzt2z5mk.fsf@gnu.org> <83y1hhykni.fsf@gnu.org> <877cp1lvih.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37615"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, spacibba@aol.com, emacs-devel@gnu.org To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 07 20:13:50 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 1qeJVj-0009Tf-UW for ged-emacs-devel@m.gmane-mx.org; Thu, 07 Sep 2023 20:13:47 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeJVQ-0001jY-JI; Thu, 07 Sep 2023 14:13: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 1qeJVH-0001i5-Vq for emacs-devel@gnu.org; Thu, 07 Sep 2023 14:13:20 -0400 Original-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 1qeJVH-0004da-NL; Thu, 07 Sep 2023 14:13:19 -0400 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=+vkXwqqZtuPmM6wA3Hhtjmdkq7lCmNyBAXIvjSBSAGg=; b=beeDph/jn3lQLVEPdnuz /gXRpbM3ImjoxRo0LF3rcTJpWqqdE/9i70l4jE9L37u017xtES1R016MXx1BcHurSw/PP5SbAI7/L qpnYCZMN2dImw0rdiEOPc8X1NQVTae0R+Lzijtia07sGRYen+1PAsfTlgBoAQXeE26pMTox/fpL5l obRTaa6/2Igfa7ilxWkUzpi2lS0OVeU21VsoMDVnGvtjAewT/rKZ0s2J82OnWh7xefJfdg9jZTYUu 9C+iNFmZdy8AAeZ97peDF+LRD3iHp4oIe81Si9vDEHoj4jKzPo0unq+8jRdCBKUnN8GXhuSVo4bTH OpNtirJOP11BaA==; In-Reply-To: <877cp1lvih.fsf@gmail.com> (message from =?utf-8?B?Sm/Do28g?= =?utf-8?B?VMOhdm9yYQ==?= on Thu, 07 Sep 2023 18:53:58 +0100) 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:310276 Archived-At: > From: João Távora > Cc: casouri@gmail.com, spacibba@aol.com, emacs-devel@gnu.org > Date: Thu, 07 Sep 2023 18:53:58 +0100 > > Eli Zaretskii writes: > > >> From: João Távora > >> Date: Thu, 7 Sep 2023 16:58:29 +0100 > >> Cc: casouri@gmail.com, spacibba@aol.com, emacs-devel@gnu.org > >> > > 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. My preference would be to provide the same interface as CC Mode: an alist with the parameters and their values, or something similar (e.g., a keyword/value plist). Asking users to write Lisp functions to customize indentation style is less friendly, especially if the user comes from CC Mode.