From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: Turing on tree-sitter Date: Mon, 10 Oct 2022 07:26:55 +0000 Message-ID: <87zge4b0lc.fsf@posteo.net> References: <83czb1jrm3.fsf@gnu.org> <87v8ot2nfi.fsf@posteo.net> <837d19jfia.fsf@gnu.org> <83edvgi3mx.fsf@gnu.org> <87r0zg5g76.fsf@thornhill.no> <78205E8D-B2D4-4460-BE0A-9BF7C627A79B@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11003"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Theodor Thornhill , Eli Zaretskii , emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 10 09:34:51 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 1ohnJK-0002fy-D2 for ged-emacs-devel@m.gmane-mx.org; Mon, 10 Oct 2022 09:34:50 +0200 Original-Received: from localhost ([::1]:48298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohnJJ-000055-EX for ged-emacs-devel@m.gmane-mx.org; Mon, 10 Oct 2022 03:34:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohnBs-0002QC-2B for emacs-devel@gnu.org; Mon, 10 Oct 2022 03:27:08 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:40923) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohnBk-0000ok-Oy for emacs-devel@gnu.org; Mon, 10 Oct 2022 03:27:07 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A2E94240028 for ; Mon, 10 Oct 2022 09:26:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665386818; bh=9ZCBqwjxWBVfeVpr7UUncZg9JfNb3YGfQJMuL+KAe9I=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=RuIYELYhTJA0ivH/IppBtFYl8H0/hzyzCGzD18C8BU0R2mnFVFHN5aelBaMnpMHLh RBgE7p8HhzBlHhvGWYIm1VRcT6XPN5JNdE9Chg28gOYU89WrY0DWQZLcKYO7vPwHMY r4KJ2XXQY1qr7MmNAq3q4VAarCg+IjVDcVm/g9Mzy7sRqIGL0WC1ldmSy9Puu4RWWn AEBE4aVehYQMBLi4xBPJIaalQLNCX+n8nZCBcdS3i3MO6Xru2QHvNgIsIrQ3Lo50/H 1EcCQKKO/eluOS4b50mXYVcxfjc8Nv4ErYUnmOaSF7RKoQ1paOCFTtluK9dFomnSV6 DLqCWko1OQTSw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Mm9TY3Bs7z6tmS; Mon, 10 Oct 2022 09:26:56 +0200 (CEST) In-Reply-To: <78205E8D-B2D4-4460-BE0A-9BF7C627A79B@gmail.com> (Yuan Fu's message of "Sun, 9 Oct 2022 23:54:45 -0700") Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, 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:297326 Archived-At: Yuan Fu writes: >> On Oct 9, 2022, at 11:46 PM, Theodor Thornhill wrote: >> >> Eli Zaretskii writes: >> >>>> Date: Sun, 09 Oct 2022 16:25:17 +0300 >>>> From: Eli Zaretskii >>>> Cc: emacs-devel@gnu.org, casouri@gmail.com >>>> >>>>> From: Philip Kaludercic >>>>> Cc: emacs-devel@gnu.org, Yuan Fu >>>>> Date: Sun, 09 Oct 2022 12:26:09 +0000 >>>>> >>>>> One more thing, it looks like the usage of tree-sitter is enabled for >>>>> python by toggling `python-use-tree-sitter'. Will every mode now have >>>>> this kind of an option? I would hope not... >>>> >>>> That's a separate discussion, so please start a new thread. >>> >>> So here I am, starting that separate discussion. Sorry, I missed the message. >>> Since tree-sitter support is per-language, I do think it makes sense >>> for each mode to have its tree-sitter support turned on separately. >>> But we could also have a global "turn on tree-sitter support in every >>> mode that has it" option, which will turn this on for those modes >>> which can be supported by tree-sitter, if the appropriate >>> language-support library is installed. >>> >>> Comments? >> >> +1 for this, but also keep the per-modes customs. Then we can eat the >> cake and have it too. >> >> Such a mechanism can be made later, I think? >> >> Theo > > +1 for this, but also add a third possible value to per-mode customs > that keeps tree-sitter always off for the mode. That way someone can > enable tree-sitter for all but that mode. Are there precedents for > such ternary variables? nil, t, and 'never? Is there a reason we can't use a minor mode? Something like (add-hook 'python-mode-hook #'treesit-mode) or a list (add-to-list 'treesit-modes 'python-mode) ? > Yuan