From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Fu Yuan Newsgroups: gmane.emacs.devel Subject: Re: Average-user-facing interface for tree-sitter Date: Sat, 22 Oct 2022 18:59:35 -0700 Message-ID: <8BAAB6CC-C8BA-4255-9E60-8963A828BE31@gmail.com> References: 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="40941"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Theodor Thornhill , Lars Ingebrigtsen , emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 24 07:45:31 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 1omqHC-000AQ9-4U for ged-emacs-devel@m.gmane-mx.org; Mon, 24 Oct 2022 07:45:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omkAY-0006Y8-G4 for ged-emacs-devel@m.gmane-mx.org; Sun, 23 Oct 2022 19:14:14 -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 1omQH8-00035n-P6 for emacs-devel@gnu.org; Sat, 22 Oct 2022 21:59:42 -0400 Original-Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1omQH7-0004GF-Au for emacs-devel@gnu.org; Sat, 22 Oct 2022 21:59:42 -0400 Original-Received: by mail-pg1-x535.google.com with SMTP id 20so5853475pgc.5 for ; Sat, 22 Oct 2022 18:59:40 -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=IVYkJFcTRVQefGgy+bj6GLxdIsOWJeheHs2XU9hdcoE=; b=BwrTGTYaTCjaq8Z4viYIRgnWc577w/qw7rSwUcXbMuyiJZX2oMova8mcnWCI11d1EE IqbKU/hFHLvQ86J5kRqCsxzbpnal5S7ld1ucXLfXRVt68xz+X92tMFFzp8VfGrVbPNZH rHCC0QA4QTPwJmlVk4U0ZFe02vfNL0tFWTS0VDR7DQjc8ZsnGrauxDIoPAZdzqZlT8Dp sGuHKXeERLfGzHtIXeY/TsqbnDM8jGji3bhb6WyQN+l6Vqro1mIt+nY2xRmHkpAeNsby 6uKs+u7Unc+t6ClESglCZrM7xwl+Ru5oed+0ReweQrAKzpVl1PKpnFMDyj45uF3nrVtF 0Byw== 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=IVYkJFcTRVQefGgy+bj6GLxdIsOWJeheHs2XU9hdcoE=; b=41UqOIbdeJdG6U61sxTol8JoimVwALx0ph8Vai/Dw3bLFPAAX7n+4i/uMpaMi8wIS9 sSBYAtD+H56RXnkthTu9262Vz/iV98Cu5QyqR/9ORG6EOo3FQO4bxSeijUtzeMuBmb+z d4y7vY5Oj0T7TOivGtqnGH0HIqZVtOkpXkc4XVDc3smD6+k9LQ6oqJwUaRqhkXnTXFr5 dh209NZCEtF8gEGJ/vXC+aDMMdJJLZdS8+C5VYouZ/Vpqh8T6RTLV7ha8agfHlJtiT0n VBo9ZKjEXAXNTLb4Mb+1/GGEY1cYCx5hx5nv4O8N+j4gFysvzMHZUv6ObPhU0MB3Gl9k 3LVA== X-Gm-Message-State: ACrzQf0Xl9N80N11dp+KCQ3EDVtd52M6J2q0/LdFqSUlljtd7O6jvmbK fx2jWCzoq1dh74ewX3An08A= X-Google-Smtp-Source: AMsMyM7OunwULk+S78EcPb+hIi92ngO5zXr+uvjVvPzZ+Mxgj4VH7yBYdkSEEYiMbmfgLKm93tOn3A== X-Received: by 2002:a05:6a00:a96:b0:558:8915:2f0e with SMTP id b22-20020a056a000a9600b0055889152f0emr26819819pfl.38.1666490379474; Sat, 22 Oct 2022 18:59:39 -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 u6-20020a63ef06000000b00464aa9ea6fasm15237153pgh.20.2022.10.22.18.59.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Oct 2022 18:59:38 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3696.120.41.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::535; envelope-from=casouri@gmail.com; helo=mail-pg1-x535.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:298332 Archived-At: > =EF=BB=BF >>=20 >>>> Yeah. Shouldn't it be possible to just have a global var instead = of a >>>> mode? That way we can just look for that variable when enabling = the >>>> mode, and avoid calling anything other than what we want. At least = for >>>> the foreseeable future, enabling these per mode in the init file >>>> shouldn't really be too much of a problem, IMO. When more users >>>> actually get to try this we can get a feel for how the init should = best >>>> be handled. >>>>=20 >>>> To me the '*-use-tree-siter' defcustoms was beautiful :) >>>=20 >>> Back to centralized variable, perhaps? >>=20 >> I=E2=80=99ve thought really hard but didn=E2=80=99t come up with any = brilliant ideas, so I=E2=80=99m >> going with centralized variable. Now, should I throw away recent = commits and >> create a new branch so we don=E2=80=99t have so many changes back and = forth on js.el >> and python.el? Plus feature/tree-sitter wouldn=E2=80=99t be used for = long anyway >> since it=E2=80=99s merging into master soon. >=20 > I'd wait a bit more to see if some other ideas come up first. Here=E2=80=99s my thought (that didn=E2=80=99t go anywhere): since major = modes sets a plethora of local hooks and variables, only the major mode = itself knows how to reverse them. The cleanest way is probably to clear = all the local variables and hooks and re-run the major mode setup, which = suggests we should let major mode branch on whether to enable = tree-sitter during initialization. I wonder if minor modes can somehow = work with this model? It would be also nice to leave room for inclusion of other = =E2=80=9Cbackends=E2=80=9D besides elisp and tree-sitter in the future. Yuan=