From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill Newsgroups: gmane.emacs.devel Subject: Re: Average-user-facing interface for tree-sitter Date: Thu, 20 Oct 2022 20:10:59 +0200 Message-ID: <87pmemmklo.fsf@thornhill.no> 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> <87sfjmg69q.fsf@gnus.org> <21B2ADDF-70BC-46D4-98D6-41C5D0EF7D40@gmail.com> <87edv4l6iw.fsf@thornhill.no> <7E474686-A204-493C-A168-48EE4856DC8A@gmail.com> <87r0z3gcse.fsf@thornhill.no> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19690"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuan Fu , Lars Ingebrigtsen , emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 20 20:11:44 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 1ola18-0004qi-7t for ged-emacs-devel@m.gmane-mx.org; Thu, 20 Oct 2022 20:11:42 +0200 Original-Received: from localhost ([::1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ola0w-00057f-GX for ged-emacs-devel@m.gmane-mx.org; Thu, 20 Oct 2022 14:11:34 -0400 Original-Received: from [::1] (helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ola0m-00049Y-6G for ged-emacs-devel@m.gmane-mx.org; Thu, 20 Oct 2022 14:11:20 -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 1ola0c-0003aW-4p for emacs-devel@gnu.org; Thu, 20 Oct 2022 14:11:10 -0400 Original-Received: from out2.migadu.com ([188.165.223.204]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ola0X-0003iB-GR for emacs-devel@gnu.org; Thu, 20 Oct 2022 14:11:09 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1666289461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=r35JjF/TEQ6d8WY7B7D+WFigHngTKgF/Wxmu6Za84bY=; b=IPw2tCI3xCLRUjrskW9DmWb/pNYj6x9kLdbBTzoqQxY06n6Xioj+g+GYkgZnpdmlpC6zUe gHCQhBYkOQcngYENj26ztdnKlEciZqeM8xmBWqnvgWs0/mgWW3CLbhX2pZbqL8nZIEkf1f QDZ1y61iSwqNlZA+CF2J9KLtVfClDuCWVEH6qas/u8+lfOZxDYU8CFQKy6RD2JQm6a0EMo nwCzlCCd4CXKfO1sOpXvKPqDWhAhHkSXKDSFWZ3zpy0iqyeib2WyHG42eURyWxn531perB ralqo0vIaHEi5A8PUxX8k8QssZVrtUK7i8+AVxrw/wdppP+sL8ZXfL0rEaL0pA== In-Reply-To: X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=188.165.223.204; envelope-from=theo@thornhill.no; helo=out2.migadu.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, SPF_HELO_PASS=-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:298165 Archived-At: Stefan Monnier writes: >>> Yes, sorry, I made some further changes to js-mode. Could you have a look >>> and see if it makes sense? >>> >> I'm not sure I really like the new changes. > > [ Context: I'm largely to blame, I proposed the change. ] > No worries :-) >> Now we init everything in >> js-mode in addition to everything treesitter related. So now stuff like >> >> ``` >> (setq-local font-lock-defaults >> (list js--font-lock-keywords nil nil nil nil >> '(font-lock-syntactic-face-function >> . js-font-lock-syntactic-face-function))) >> (setq-local syntax-propertize-function #'js-syntax-propertize) >> (add-hook 'syntax-propertize-extend-region-functions >> #'syntax-propertize-multiline 'append 'local) >> (add-hook 'syntax-propertize-extend-region-functions >> #'js--syntax-propertize-extend-region 'append 'local) >> (setq-local prettify-symbols-alist js--prettify-symbols-alist) >> >> (setq-local parse-sexp-ignore-comments t) >> ``` > > Hmm... yeah, undoing those add-hook settings of various other variables > which treesit-mode doesn't use is a problem. We need to find > a better way. > > 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. To me the '*-use-tree-siter' defcustoms was beautiful :) Theo