From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Noah Peart Newsgroups: gmane.emacs.bugs Subject: bug#70361: [PATCH] Add font-locking for operators in go-ts-mode. Date: Sat, 13 Apr 2024 00:32:59 -0700 Message-ID: References: <86r0f9ranr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007e86b80615f5668f" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5314"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70361@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 13 09:34:08 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rvXtn-000161-CA for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Apr 2024 09:34:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rvXtZ-0000jw-Dd; Sat, 13 Apr 2024 03:33:53 -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 1rvXtY-0000jm-24 for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2024 03:33:52 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rvXtX-0001j6-Oi for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2024 03:33:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rvXti-000353-2O for bug-gnu-emacs@gnu.org; Sat, 13 Apr 2024 03:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noah Peart Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Apr 2024 07:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70361 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 70361-submit@debbugs.gnu.org id=B70361.171299361111528 (code B ref 70361); Sat, 13 Apr 2024 07:34:02 +0000 Original-Received: (at 70361) by debbugs.gnu.org; 13 Apr 2024 07:33:31 +0000 Original-Received: from localhost ([127.0.0.1]:59979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rvXtB-0002ze-Hy for submit@debbugs.gnu.org; Sat, 13 Apr 2024 03:33:31 -0400 Original-Received: from mail-oo1-xc29.google.com ([2607:f8b0:4864:20::c29]:46456) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rvXt9-0002yH-47 for 70361@debbugs.gnu.org; Sat, 13 Apr 2024 03:33:28 -0400 Original-Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-5aa26990d5aso1125499eaf.1 for <70361@debbugs.gnu.org>; Sat, 13 Apr 2024 00:33:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712993591; x=1713598391; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=M1wLszlEjjpnogH1qOUuhsEDCGWqLOFhGUEjNK4cap8=; b=lhoUizwfE0cNo9gxGDy6Iu1U6+TGkcGsgkkgH6LWU6MLnY4MHnYwurscvIUiN3Visd D00aGMuAh+R6Eo9fBdP7Mo5AUSr1vpkpkKrcmZ0lIXQT0HI9fHbOw4AzSpjY77Qd6yTj woQ0vEd54SaMI9NEH3CvPnJNmZ2KoZbIpxHgcwKpd5Ntfkjwh/d4qTNUvSvH284ry/eq Gz2YA46cfAO9Gc/5PNDfikyPqlBe6b6llYyTY7rtwzrbuP4Uf74WxJfYzMxkJf5TfIsq WmOLyaHD4h/asB/p44iSosJ/FAzvGt4PiacJvUvVGRBG9x/3tmPhe0db36Fmfw/mIqWf oUqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712993591; x=1713598391; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=M1wLszlEjjpnogH1qOUuhsEDCGWqLOFhGUEjNK4cap8=; b=GXTAdP3Fq518W6oROlCpkR2e+tnUafqy9uvDaR6xILleQlsG5dszZXJme4In7r3QBs Zv4MZxJU/UEkLefl259WDygUEWlAwtLV8H3WR/ehJ7YrMy4CH7MAz7+BpKULj0OZUC6M Z8Ho0TFczcMNQwET+wnP6UgmCtqKlRDHDpSx8+2u8U7IZEpsnnYP+Z1xMgGBuuizwwlF JEPPwA8jjrPxa7Y9ibGmhz1k5ujIlxdPgwaSgw8JHu9NQcofhSCKL54+Ugto/4eAdQ68 nbsgFHCJF3pD8QatFvvdXm6KUAKreNne7k7DS5hicFrthGY5HZf61O2wYc31iGdaOaf+ QLPg== X-Gm-Message-State: AOJu0YyW66T2FwW2Ve3z2OJBw7tJc05/oV1+8iHuTCR7lEpZJRts1jkU 3fwmd3RLt0+/wtfW18sisRnWt7NtnblQfB5n9j45/vxDUvW1rybhVyqnX8/YHcm6SseCk1K7QJg ssIAlD/9UumxNmtyy66kir30bZIepYzJra1U= X-Google-Smtp-Source: AGHT+IFtoHo3oD3SuM5oexIB6QF6blW0sXtf7tI5PIrvAqI8vAllwCCUZqmcuIe/rcHLdbSxalYGHPqVN0BsFAIuJrU= X-Received: by 2002:a05:6870:e09:b0:22e:d13b:c13d with SMTP id mp9-20020a0568700e0900b0022ed13bc13dmr5525010oab.18.1712993591000; Sat, 13 Apr 2024 00:33:11 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:283172 Archived-At: --0000000000007e86b80615f5668f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On a somewhat related note, I was wondering why the treesit modes in emacs define their `treesit-font-lock-feature-list`s in the mode definitions. Wouldn't it be more user-friendly to `defvar` the feature list? On Sat, Apr 13, 2024 at 12:27=E2=80=AFAM Noah Peart wrote: > > The operators will be fontified only if treesit-font-lock-level is 4, > right? > > Yea, operator is at level 4 - I didn't change the > treesit-font-lock-feature-list. > > > > On Sat, Apr 13, 2024 at 12:20=E2=80=AFAM Eli Zaretskii wro= te: > >> > From: Noah Peart >> > Date: Fri, 12 Apr 2024 22:23:05 -0700 >> > >> > Adds font-locking for Go operators in `go-ts-mode'. The operator featu= re >> > is already added to `treesit-font-lock-feature-list' in `go-ts-mode` - >> this >> > just adds the missing rule to `go-ts-mode--font-lock-settings'. >> >> Thanks. >> >> The operators will be fontified only if treesit-font-lock-level is 4, >> right? That's the level at which we decided to fontify operators. >> > --0000000000007e86b80615f5668f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On a somewhat related note, I was wondering why the treesi= t=C2=A0modes in emacs
define their `treesit-font-lock-feature-list`s in= the mode definitions.

Wouldn't it be more use= r-friendly to `defvar` the feature list?

On Sat, Apr 13, 2024 at 12:27= =E2=80=AFAM Noah Peart <noah.v= .peart@gmail.com> wrote:
> The operators will be fontified only = if treesit-font-lock-level is 4,
right?

Yea, operator= is at level 4 - I didn't change the treesit-font-lock-feature-list.



On Sat, Apr 13, 2024 at 12:20=E2=80=AFAM E= li Zaretskii <eliz@gnu= .org> wrote:
> From: Noah Peart <noah.v.peart@gmail.com>
> Date: Fri, 12 Apr 2024 22:23:05 -0700
>
> Adds font-locking for Go operators in `go-ts-mode'. The operator f= eature
> is already added to `treesit-font-lock-feature-list' in `go-ts-mod= e` - this
> just adds the missing rule to `go-ts-mode--font-lock-settings'.
Thanks.

The operators will be fontified only if treesit-font-lock-level is 4,
right?=C2=A0 That's the level at which we decided to fontify operators.=
--0000000000007e86b80615f5668f--