From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: c-ts-mode style customization Date: Wed, 22 Mar 2023 20:05:57 -0400 Message-ID: <1870bc95688.2829.cc5b3318d7e9908e2c46732289705cb0@dancol.org> References: <87355wu4hn.fsf@dancol.org> <45CB19FB-4D80-4C71-8083-D836F51DFB49@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="1870bc9584211f02829ffd0bf9" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31043"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: AquaMail/1.43.0 (build: 104300275) Cc: To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Mar 23 01:07:20 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 1pf8UB-0007qx-Ih for ged-emacs-devel@m.gmane-mx.org; Thu, 23 Mar 2023 01:07:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pf8TY-0001iF-Es; Wed, 22 Mar 2023 20:06:40 -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 1pf8TW-0001hx-Hn for emacs-devel@gnu.org; Wed, 22 Mar 2023 20:06:38 -0400 Original-Received: from dancol.org ([2600:3c01:e000:3d8::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pf8Sw-0007p4-Hd for emacs-devel@gnu.org; Wed, 22 Mar 2023 20:06:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Type:MIME-Version:Subject:References:In-Reply-To:Message-ID: Date:CC:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=vQel8o+QJ1eC3KoLlEn3xbukZC/UNLJOaE0H7Rqyq0Q=; b=ISm4B22bUIG+NxHNP+e/4iJoST CnmayFFeVKhkMOfTmZJpbZNIptG9HZzUfiypbQrkoFED+/f6GqBOavoWgbUjbwBC2K1zY+GQhak1j lXhliY4fo/118juxG7cWTAc4YYg+CLpCY8R0aDJ131SJkDVJVqPBvTkizy97CkBwiwEfRVCRsIpd8 vjOZ7BEOOMshQkFSV7gKmDj0Yyr9K6W1WsATeebbbycI4ubmmX1kvE+4x+zCmwroLzk+eLBiYt5qo uQFRSBKLlryh+YALgKMXVhvt22ZRqg7Ejsk/jSovTvayNljuz4TguMaInIqiPLsHtGRIgECytlgpJ 4U6+8E4w==; Original-Received: from 097-104-088-154.res.spectrum.com ([97.104.88.154]:42516 helo=[192.168.86.235]) by dancol.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1pf8Ss-0000cu-HJ; Wed, 22 Mar 2023 17:05:59 -0700 In-Reply-To: <45CB19FB-4D80-4C71-8083-D836F51DFB49@gmail.com> Received-SPF: pass client-ip=2600:3c01:e000:3d8::1; envelope-from=dancol@dancol.org; helo=dancol.org 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, HTML_MESSAGE=0.001, SPF_HELO_PASS=-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:304725 Archived-At: This is a multi-part message in MIME format. --1870bc9584211f02829ffd0bf9 Content-Type: text/plain; format=flowed; charset="us-ascii" Content-Transfer-Encoding: 8bit On March 22, 2023 19:58:22 Yuan Fu wrote: >> On Mar 22, 2023, at 8:53 AM, Daniel Colascione wrote: >> >> Shouldn't customization of styles in c-ts-mode look more like cc-mode's >> style machinery? Right now, the closest thing we have to defining a new >> style is add-advice on c-ts-mode--indent-styles, which isn't >> particularly convenient or future-proof. You can't drop a new style in, >> say, .dir-locals. > > Actually, you can define a custom function, say, c-ts-mode-my-style, and > set c-ts-mode-indent-style to the name of it. > > Yuan But that doesn't add the new style to the UI selection menu and doesn't let you define a style in dir-locals. IMHO, cc-mode got this right. --1870bc9584211f02829ffd0bf9 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable


On March 22, 2023 19:58:22 Yuan Fu <casouri@gmail.com&= gt; wrote:

On Mar 22, 2023, at 8:53 AM, Daniel Colascione <dancol= @dancol.org> wrote:

Shouldn't customization of styles in c-ts-mode look more = like cc-mode's
style machinery? Right now, the closest thing we have to = defining a new
style is add-advice on c-ts-mode--indent-styles, which is= n't
particularly convenient or future-proof. You can't drop a= new style in,
say, .dir-locals.


Actually, you can define a custom function, say, c-ts-mod= e-my-style, and set c-ts-mode-indent-style to the name of it.

Yuan


But that doesn't add the new style to the UI selection menu and doesn'= t let you define a style in dir-locals. IMHO, cc-mode got this right.
=

--1870bc9584211f02829ffd0bf9--