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 style customization Date: Wed, 22 Mar 2023 17:20:07 -0700 Message-ID: References: <87355wu4hn.fsf@dancol.org> <45CB19FB-4D80-4C71-8083-D836F51DFB49@gmail.com> <1870bc95688.2829.cc5b3318d7e9908e2c46732289705cb0@dancol.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25983"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Mar 23 01:21: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 1pf8hk-0006YP-K6 for ged-emacs-devel@m.gmane-mx.org; Thu, 23 Mar 2023 01:21:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pf8h2-0008E7-HH; Wed, 22 Mar 2023 20:20:36 -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 1pf8gs-000877-14 for emacs-devel@gnu.org; Wed, 22 Mar 2023 20:20:29 -0400 Original-Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pf8gn-0005vk-J1 for emacs-devel@gnu.org; Wed, 22 Mar 2023 20:20:22 -0400 Original-Received: by mail-pl1-x62f.google.com with SMTP id ix20so20817010plb.3 for ; Wed, 22 Mar 2023 17:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679530820; 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=AeEcLxDBMjKKtssjRh//yDIOXJQo9/Ooj/dhnOzgzHU=; b=qOLrc5QFPsy1dX4dyYl8yE5zyZapoymSSHM80ZKuYpUbwr5wJFW5W5gJI8Ac4UAsFX Rxb7+PSQ+hXNh2KXIDuWotqz1R4mQN4YbCH4HXInfjP/m/fZyNFQEMIEdEnMgwdTNs/c yN9qOPJYWCApmW5uP1OIj76+l9h1V7+CJ6B0nuV3+F48pjqTpXZh9kFy3qjLNe6QnSgK xgTyWpSXWMq3evc42MaeosX2v5icaqi7l3FrH8VWyfWe9sANcnp3i/mjV+nRnYz0xIsx JYCdt0kcvn7pLRyjKhqVws+i+o82NfVxRSGUWIJDBqlPxrMOwVw5LVL/rkYflSjDjB9B 04dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679530820; 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=AeEcLxDBMjKKtssjRh//yDIOXJQo9/Ooj/dhnOzgzHU=; b=6YkI+qlzKpUbQvn6NW+QzkjwwplJdqBtpWP9uSixRD+dmbgKyMxJM+0GKK1q+88kH7 JMSRUoxSaqn+mIRmVn93sZw98DuDJS+SRcW03iOvMeefDixiEBNobaSP0EJ9APW4L/OF qWvChy5kNYpokzdUOyQC0F1e0MRlmE+r40dVJV49pLNyodEfNUwr6chLzIFeHdMDWs5e QkJN0H5EBWuZ9Wvo8zWHP7TZcGISNQTil6H0+qA+mNRSh8faQtrjcT55ujRH9YjcWQAL c1pGy5b/pei2wJtPhofti4rb0PdBhbC39ZC2hYceSnfNkR/a44zOFkIULRDWEmologv7 PEIQ== X-Gm-Message-State: AO0yUKUMB8OuxOOMqX6luc0/h/CM9thVUoEpH9pz19hGi2hBsr770vGa om6Zl64LqlXbXFzvwnJjLH4= X-Google-Smtp-Source: AK7set/x5/JsJmcmEvG2CI5uOXjxuZc1xenlqJYLy/S2On0t4dtrmJObHNMsoP901WWi5im40lo4oQ== X-Received: by 2002:a17:902:d2cf:b0:19c:e664:5e64 with SMTP id n15-20020a170902d2cf00b0019ce6645e64mr5442687plc.2.1679530819664; Wed, 22 Mar 2023 17:20:19 -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 t23-20020a632257000000b0050f7208b4bcsm6668107pgm.89.2023.03.22.17.20.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2023 17:20:19 -0700 (PDT) In-Reply-To: <1870bc95688.2829.cc5b3318d7e9908e2c46732289705cb0@dancol.org> X-Mailer: Apple Mail (2.3731.400.51.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=casouri@gmail.com; helo=mail-pl1-x62f.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:304728 Archived-At: > On Mar 22, 2023, at 5:05 PM, Daniel Colascione = wrote: >=20 >=20 >=20 > On March 22, 2023 19:58:22 Yuan Fu wrote: >=20 >>> On Mar 22, 2023, at 8:53 AM, Daniel Colascione = wrote: >>>=20 >>> 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. >>>=20 >>=20 >> 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. >>=20 >> Yuan >=20 >=20 > 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. You can set c-ts-mode-indent-style in dir-locals, no? You have a point = for UI selection, we can add a c-ts-mode-indent-style-alist that maps = style names to rules/functions that returns rules, like c-style-alist. Yuan