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 14:47:02 +0200 Message-ID: <83y1sgmjax.fsf@gnu.org> References: 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="30261"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: =?utf-8?Q?Jo=C3=A3o?= Paulo Labegalini de Carvalho , Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 12 13:48:19 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 1otpvm-0007g4-Cx for ged-emacs-devel@m.gmane-mx.org; Sat, 12 Nov 2022 13:48:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1otpv9-0002cQ-Ca; Sat, 12 Nov 2022 07:47:39 -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 1otpuf-0002T2-QJ for emacs-devel@gnu.org; Sat, 12 Nov 2022 07:47:16 -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 1otpud-0007vF-U5; Sat, 12 Nov 2022 07:47:08 -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=/i5J6sMyfJ1A9a1GHwhvFlWEWxTzxTmzZxxnQ+44xfY=; b=Dew+xBompomCcA0C5I2i TBamZULjC0wPuoY6w6PBdpdniGVtCiM7U/+OrQ9zjHtnMO6Hv/ZIt783nErQgXpvW0tPP60s1RtoY UVHclg3e4a2JfeeNJqC6KDEXPqMUBiWkyzIf2bEWeHeKSRBymazDvSyCL+/bdGJMqjnA4TtLK6d+g oPxfAhG7cXnNRS7uxlym7VSu75z8LVtABekD0YgCoMBrGmc84t9ECHxAFgi38ObUHqluTJiGckkvV vs6bCh78Ln8kF9ZIjA/RrejFSkAEsQNYWDuwg6ge7BLoEm0R2WU4P4b3mifwWUaydJHyZFeDAg3IQ QL6UHb5x/qXhKg==; 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 1otpuS-0000se-4u; Sat, 12 Nov 2022 07:47:03 -0500 In-Reply-To: (message from =?utf-8?Q?Jo=C3=A3o?= Paulo Labegalini de Carvalho on Wed, 2 Nov 2022 12:55:31 -0600) 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:299641 Archived-At: > From: João Paulo Labegalini de Carvalho > Date: Wed, 2 Nov 2022 12:55:31 -0600 > > I missed the update that adds override as the last argument of the capture function. Fixed now. > > On Wed, Nov 2, 2022 at 12:22 PM João Paulo Labegalini de Carvalho wrote: > > Here is another version of the path. This has the queries separated into language related terms and > groups them into lists of features. > > Looking forward to your feedback. > > Thanks. > > On Thu, Oct 27, 2022 at 4:01 PM João Paulo Labegalini de Carvalho wrote: > > Hi everyone, > > Please find the patch for enabling fontification in sh-mode (currently only for bash) using > tree-sitter. > > I welcome all comments and suggestions to improve the patch. > > I noticed a weird behavior with heredocs. Take the code below: > > echo < This is a here document. > EOF > echo "Done." > > My patch correctly fontifies the code above, but if I kill the whole line with the "This is a here > document." text, then the sh-heredoc face bleeds out and all the subsequent comments get > fontified as part of the heredoc. > > A similar behavior happens if tree-sitter is not enabled, if the heredoc is empty then all > subsequent commands are fontified as heredoc. However, as soon as anything is added to the > heredoc, then everything goes back to the correct fontification. > > Such "refreshing" does not happen with tree-sitter enabled, but if I execute M-x sh-mode then the > buffer gets refreshed and everything looks good. > > What am I doing wrong? Yuan, any comments? If you think this is OK for the tree-sitter branch, please install there.