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: Average-user-facing interface for tree-sitter Date: Tue, 18 Oct 2022 13:58:40 -0700 Message-ID: References: <3A7E7CD1-74A7-4352-9DFE-FC982EAA398E@gmail.com> <87ilko9r9e.fsf@gnus.org> <9794E2EF-4DB5-4A04-90F0-3EB51E6BE008@gmail.com> <87977C2D-844B-4F4E-BEA4-8BCBFC8AE354@gmail.com> <6A0F847F-910D-449B-B461-466493CC9847@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) 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="23555"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 18 23:09:30 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 1oktq6-0005uB-KK for ged-emacs-devel@m.gmane-mx.org; Tue, 18 Oct 2022 23:09:30 +0200 Original-Received: from localhost ([::1]:33714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oktq5-0006kL-9F for ged-emacs-devel@m.gmane-mx.org; Tue, 18 Oct 2022 17:09:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oktgH-0006al-Vc for emacs-devel@gnu.org; Tue, 18 Oct 2022 16:59:21 -0400 Original-Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:33426) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oktgF-000376-CA for emacs-devel@gnu.org; Tue, 18 Oct 2022 16:59:21 -0400 Original-Received: by mail-pf1-x436.google.com with SMTP id m6so15321596pfb.0 for ; Tue, 18 Oct 2022 13:59:16 -0700 (PDT) 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=5oKIAO+omgrkKOqIfB0nqsTJ8nXFB0kyyNBwWrxJygE=; b=IyEXqmichYzK0qHFhlkz15Pe3GWyHY/DetnxsEU3Tm+Gtj034RXxpSOq8G8ovHB+ls hwUm0ryUM1oNvRvJX5SZLJY3zvkVNjBsZHKGvJOmQXh+hrZ7uZWyPWgdN5mjfzXZPkpx 629u5GSIi84AndpaIA+4nv4O0RIEXSyQFBK3do7/wD6dURWUsb4Ja2GY8tq8Aa3KMTKQ qhVtypiEy/1Td6vCPsWFSysUuxLxTFbALnUk8G1wTFncy1RYQZkXmSr6ieYQPoWFDFyb 3YXxZg90ZmZX4UPl1eSXCYXunlI7P87hjE8d1M6nGOom6UZZcVhQ5rKm1bNWnw2BJdsa /nqw== 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=5oKIAO+omgrkKOqIfB0nqsTJ8nXFB0kyyNBwWrxJygE=; b=bv7gKCZiuB7WKCSoEiABpgIZujwJPCCC17LI1uveyi+lPSdEviPa7cvb+mt5JxV7eh DwPnfYJvtYDYqcVP/6y6Trf6yYOx7l9s9lmLv6YSn1mbr3HvsJUnNQfAXN5frn15E6aG Q9A5BGscjjK7koZKlFZU4YgGptj+iYaQjR5pg6zqA73fLjx6r9MiJQ2RyIH9VkAX9on6 ChN770qL+iLL+YXqIvdBuCZKXCB+V4TUg7RFWl1nIhN04uyM4Iid6PrM+/Ho4HVxGzJo tU896Vs47pNNo7sDn8rQZKNc2Lq0Ia+0j9rTEHZnupInR0RpNr3kHxq1ilLFf9XeyU3C QeOQ== X-Gm-Message-State: ACrzQf28K9i/gQiPx24PlGfrQyQDSxEb+7RVGc4FH6Hxmr+MQLP8UGmY u3Zmd8QFiPYZctd4RymLwV3uHmqGnMg= X-Google-Smtp-Source: AMsMyM5+XhDS7EcTYtHhG5BTZxIL5MF+JeZ6HjNX+JhQUIaU3eFjZaiinvKk4L6ClBdqcwaXeZBKEg== X-Received: by 2002:a65:6954:0:b0:445:fdb8:738e with SMTP id w20-20020a656954000000b00445fdb8738emr4084345pgq.520.1666126755842; Tue, 18 Oct 2022 13:59:15 -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 o2-20020a17090a55c200b0020d45a155d9sm11872897pjm.35.2022.10.18.13.58.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Oct 2022 13:59:03 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=casouri@gmail.com; helo=mail-pf1-x436.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" Xref: news.gmane.io gmane.emacs.devel:298081 Archived-At: > On Oct 18, 2022, at 1:49 PM, Stefan Monnier = wrote: >=20 >> How about a function mode-specific-value that takes any variable with = the following shape: >>=20 >> ((MODE VALUE INHERIT)=E2=80=A6) >>=20 >> And returns the right VALUE for the current mode? INHERIT decides >> whether VALUE is inherited by MODE=E2=80=99s derived modes. >=20 > FWIW, `inherit` should be the default, IMO, so the third part should > specify DONT-INHERIT. >=20 >> This function would handle derived mode ok, but I don=E2=80=99t know = what are >> the other problems you are think of, maybe you can tell me what this >> function falls short for. And we can go from there. >=20 > The function is one thing. Another question is when it is run, and > hence how it interacts with other ways to enable/set/control the thing > you want to control (in this case enabling `treesit-mode`, IIUC). >=20 > I recommend you focus on making the `treesit-mode` minor mode work > regardless when it's called. So it can be controlled by the usual > (add-hook foo-mode-hook #'treesit-mode). >=20 > Then we can worry about how `global-treesit-mode` should be controlled > (and worry about harmonizing it with `global-font-lock-mode`, for > example, which relies on `font-lock-global-modes` which is also such > a centralized way to specify the behavior per-mode (and a poor one at > that if you ask me)). I installed treesit-mode and global-treesit-mode. Errr = global-treesit-mode uses define-globalized-minor-mode so it has a = global-treesit-modes, sooo... Yuan=