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: Allow indentation styles by use of function in tree-sitter Date: Sun, 6 Nov 2022 16:06:22 -0800 Message-ID: <68532D98-E888-4F12-8C20-8CAA911C7D8B@gmail.com> References: <871qqgjldz.fsf@thornhill.no> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32689"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Theodor Thornhill Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 07 01:07:33 2022 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 1orpfp-0008IM-6L for ged-emacs-devel@m.gmane-mx.org; Mon, 07 Nov 2022 01:07:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orpeq-0008Qt-KF; Sun, 06 Nov 2022 19:06:32 -0500 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 1orpen-0008Qk-Ak for emacs-devel@gnu.org; Sun, 06 Nov 2022 19:06:29 -0500 Original-Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1orpek-0002ae-2Z for emacs-devel@gnu.org; Sun, 06 Nov 2022 19:06:27 -0500 Original-Received: by mail-pj1-x102c.google.com with SMTP id m14-20020a17090a3f8e00b00212dab39bcdso13043220pjc.0 for ; Sun, 06 Nov 2022 16:06:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=WYUHBVpLwBkMgi4LamlXWQ9uf4m3EOAX4Q9TnxXQ+6I=; b=HpJshLfLu/0BWVOCT9YM7gqSihD4iBrSniR2/UJ65rwqA1RPMVlBEPYh99h10SHDcB ioh+YZgqDZKCXXFxixvWc7ugrLkoBoSmS0sueAPLQaChH+Q0dhJz1Jw0WiZbTd6IE9p8 wEWrwv7S2bUtLD3X00usAD5in8WKNuUx6X7pFMJ8QE3mFGqEbigTKO5Cz5wdApauTM3y x59k8UGego8P/86eZFx6oIpugsTE60jlitzArJWHhQ6km8zuU9qqo0DBvkjQuI9p+Ehq Ym7G1lWsIQ8bNrdetcc9fNwTgE0jdU87waiXrtmVmxXoxLLmgk8ZIEsPSW0drQ0CoQE6 YBoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=WYUHBVpLwBkMgi4LamlXWQ9uf4m3EOAX4Q9TnxXQ+6I=; b=HcsN+HVGr5rR6zWDXI3VVL4UDG9CPzvKsLp2b0NicUiSQreC8k+lz8zaw7LlHhlETZ jLhjUYOKPIisnQqEWoehkrlgXlXjDWDmBhVPHxHwu6tCKUUg2qEGwiAFviaDZ+W+jItX T4FGFyddL248ufubUerU/4L2/6BKFpNE5XpcxYVN2vQjWURsBDsIv43TFgeUQ12WY5YN v2hZvQX9to2292zbAUe68vMvZszfit7wCBr1V49jJhf/SZgv0kDCPfPnOTexsMxKzqW8 trDBguHcsLCMouH5tThGPxc5AmSdEFQlWowQivBcNXhHfKmgCMvWL1/KB+HbOrmG53Ib 2lsw== X-Gm-Message-State: ACrzQf1cEv7LHnleJ5pTMvlKxufMjkGiZxIvV5tDIh0UG0wxEQ3SsSSb ac0hGvwnHPEuiXXKH+cRkAuZ66vs16w= X-Google-Smtp-Source: AMsMyM71POKrCQY/X5U3YrVIJt/4fU7R2jLWiWPJ7iEz4Iw4WwtFsOGPQK2ZV+du/WPrn7l6WcC6dA== X-Received: by 2002:a17:902:c405:b0:187:76e:2891 with SMTP id k5-20020a170902c40500b00187076e2891mr43276761plk.25.1667779584164; Sun, 06 Nov 2022 16:06:24 -0800 (PST) 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 p5-20020a170902780500b00186c37270f6sm3612452pll.24.2022.11.06.16.06.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 Nov 2022 16:06:23 -0800 (PST) In-Reply-To: <871qqgjldz.fsf@thornhill.no> X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=casouri@gmail.com; helo=mail-pj1-x102c.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:299270 Archived-At: > On Nov 6, 2022, at 4:52 AM, Theodor Thornhill wrote: > > > Hi Yuan! > > I was thinking that a quick way to enable indentation styles and > customizable indentation styles is to also accept a function in > tree-sitter-simple-indent. > > What do you think of the suggested patch? > > That would allow a defcustom such as > ``` > (defcustom c-ts-mode-indent-rule-function #'c-ts-mode--some-specific-style > "Indentation style of choice" > :group 'c) > ``` > > and in the major-mode init: > ``` > (setq-local treesit-simple-indent-rules c-ts-mode-indent-rule-function) > ``` Hmmm, does assigning treesit-indent-function fit the bill? Yuan