From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Initial fontification in sh-mode with tree-sittter Date: Sat, 12 Nov 2022 21:53:52 +0200 Message-ID: <83h6z4lzjj.fsf@gnu.org> References: <83y1sgmjax.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40088"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jaopaulolc@gmail.com, emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 12 20:54:10 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 1otwZu-000AGW-5E for ged-emacs-devel@m.gmane-mx.org; Sat, 12 Nov 2022 20:54:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1otwZc-0006rO-3E; Sat, 12 Nov 2022 14:53:52 -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 1otwZa-0006rG-Sl for emacs-devel@gnu.org; Sat, 12 Nov 2022 14:53:50 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1otwZa-0001pH-K7; Sat, 12 Nov 2022 14:53:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=iZPgQD+Y91fnPuL57oWThMQjhcv1DwazaL6edNF1etw=; b=MmAHLRC4yYQRcLTVNIkB Z9/s3N01TiMLU2akHCHFhveERxawZMOTWYc0U99k2lp9rdPj2M9idG5fe6OluJClUWkxlxC2S4IXX OeKFCHD3SRsXVFUwiP/5EY1SIrkjphCtlwNTts1SVdTLUqxu7YyaWynFORZADisXEca76HdB5Il0G 2Sedm2IosLFySyl6yzjvNEIKAktk+OOsTaTkSPV5Vh79hz8iVcf9oMjRW/OfRMUQnFMhuplmd0lRD wwLFqKhOqWd72SlYE8q3tDropRFO8iPN1xJcGDv2o/4b8HRvUbZxPsrQub1YIGCtyIn8T7VD+Zm39 6cS7eYKscp7yuA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1otwZU-00038m-Te; Sat, 12 Nov 2022 14:53:50 -0500 In-Reply-To: (message from Yuan Fu on Sat, 12 Nov 2022 11:45:53 -0800) 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:299676 Archived-At: > From: Yuan Fu > Date: Sat, 12 Nov 2022 11:45:53 -0800 > Cc: João Paulo Labegalini de Carvalho , > emacs-devel@gnu.org > > > Yuan, any comments? If you think this is OK for the tree-sitter > > branch, please install there. > > I think there are still some details need to be addressed, eg, > > > Also, when defining sh-mode--treesit-settings, instead of using the value sh-shell as the language, it’s better to just use ‘bash. Here is what happened to me: my default value for sh-shell is fish, so sh-mode--treesit-settings was defined with language = fish. When I open heredoc-issue.sh, sh-mode parses the shebang and sets sh-shell to bash. Since bash does have a parser, (treesit-ready-p ’sh-mode sh-shell) returns t, and tree-sitter is activated. However when font-lock tries to use the query, it errors because query tries to load a parser for fish. > > (I can make the change myself though) Fine with me, it's up to you two. Thanks.