From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#70361: [PATCH] Add font-locking for operators in go-ts-mode. Date: Sun, 14 Apr 2024 16:25:54 -0700 Message-ID: <29DC7974-83D5-425C-83AC-CF9FEF58D091@gmail.com> References: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12711"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70361@debbugs.gnu.org, Noah Peart , dev@rjt.dev To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 15 01:27:07 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 1rw9Fa-000343-HD for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Apr 2024 01:27:06 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rw9FN-0006AK-B1; Sun, 14 Apr 2024 19:26: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 1rw9FL-0006A6-Gi for bug-gnu-emacs@gnu.org; Sun, 14 Apr 2024 19:26:51 -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 1rw9FL-0006Xm-6Y for bug-gnu-emacs@gnu.org; Sun, 14 Apr 2024 19:26:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rw9FW-00053V-2O for bug-gnu-emacs@gnu.org; Sun, 14 Apr 2024 19:27:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Apr 2024 23:27: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.171313719019156 (code B ref 70361); Sun, 14 Apr 2024 23:27:02 +0000 Original-Received: (at 70361) by debbugs.gnu.org; 14 Apr 2024 23:26:30 +0000 Original-Received: from localhost ([127.0.0.1]:36374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rw9Ez-0004yt-Mf for submit@debbugs.gnu.org; Sun, 14 Apr 2024 19:26:30 -0400 Original-Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]:54539) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rw9Et-0004xB-Hb for 70361@debbugs.gnu.org; Sun, 14 Apr 2024 19:26:28 -0400 Original-Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-517ab9a4a13so2058478a12.1 for <70361@debbugs.gnu.org>; Sun, 14 Apr 2024 16:26:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713137166; x=1713741966; darn=debbugs.gnu.org; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=3IpJdkzOYt3IqFNx5xpY+NVJWXhLRd5Fg4TSMAYHY/o=; b=jLuo2/WdjI5r5jCiRAX9zSnQ+oCAfG5OD7vphsvCBhUoBgrTpzwK81ufF7Z04m0Q3K IUBKJeh4e3dk7HtNO4IO3ObmmC00Hyt0hsaeSnCSgIDdKQTdK1Cd5m13+WPdtV3h3/qA RJhC0Afp7xdFyinrGEImnw9epugBh7eM7l1bTGBBqkSXQ6NyIK0kuSK3f6lDErJ760/Y cBuwrufmFEge6rxQXS56IlApfz1dFrjY+YzBk3kbV++0uA6w5m9rIXiKDu1ObmxYv0c8 /xAnExG9OyViLuX1PPdDePyetWASvell9CS/FN5xQ1ls6yQ2PwlADJ+cVNaCixId5O/d 7bhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713137166; x=1713741966; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3IpJdkzOYt3IqFNx5xpY+NVJWXhLRd5Fg4TSMAYHY/o=; b=EFAVzd+DKi890/xPdUywIjXjsgcoouGvPuDwNJfw3svZjg5TEhuJW8f/eYaYhwr8xg O/7ORo5xLfnlsNPxWOtpatbw59QeuHt/qfBBJ3AjzvGNv9WcIiUp5yHOidE0QmU2FXln yQwvHdlCfb2/eHcnCBZnh+WWLTHIHi0c9Vplht7s3y1pmhCUX6DG6Y+80xeB3X4+qMNv BxaNbbSpoBHOJ4QE/lADCECjmJCxJLKjg9QVQMi/UFwAlPgSMDPRHSymCy1Kly4/skGv cqXh8cyf99SZ/JH/S5PGlKU09pReogZOcUXu2qwIo0kWou2rQikOeq0IBZZzG3bR9jZ1 mEtA== X-Forwarded-Encrypted: i=1; AJvYcCXx9Q7lmqgts2greyBwFMZiRiI4PmFt6vc5QEwcaAhelWanaD12dGdVH/92uDPljGHuE+7h2Ll6/imH8vuqOwmZvDouCgY= X-Gm-Message-State: AOJu0YxhD/NmeF931nRGKdnFT+8JuXQhKu3s23la2mrF68mjTu0bn6XD VV3dSfaJm7ZpVUJzInRzURRJLizIQctqENJq9g5F5xOjWOAcrFdd X-Google-Smtp-Source: AGHT+IF9sN1eoRvPqPWD8a4B1CS/oVUEgiqpymYtMbEOU8crXSSQVitiSVmYeFxtxeRCqK5T0EaBWg== X-Received: by 2002:a17:902:e5c6:b0:1e4:2b90:7282 with SMTP id u6-20020a170902e5c600b001e42b907282mr12295064plf.14.1713137166284; Sun, 14 Apr 2024 16:26:06 -0700 (PDT) Original-Received: from smtpclient.apple ([2601:641:300:4910:ddd5:ebc3:f048:bab8]) by smtp.gmail.com with ESMTPSA id h11-20020a170902680b00b001e0bcccc800sm4686442plk.35.2024.04.14.16.26.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Apr 2024 16:26:05 -0700 (PDT) X-Mailer: Apple Mail (2.3731.700.6) 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:283325 Archived-At: Eli Zaretskii writes: >> From: Noah Peart >> Date: Sat, 13 Apr 2024 00:53:45 -0700 >> Cc: Yuan Fu , 70361@debbugs.gnu.org >>=20 >> > What problems do you see with the current approach that would = require >> more fine-grained user control? >>=20 >> The main issue for me is removing the `error` feature from any mode >> that adds it with `:override t`. I find the override font-locking is = jarring - in some >> Languages half the buffer can switch in and out of parse errors when = you >> do something as simple as removing a closing paren. > > Maybe we should have a user option to turn error feature on and off. > Yuan, WDYT? Sure, I=E2=80=99m not a big advocate for highlighting the errors to = begin with. The tree-sitter parse errors aren=E2=80=99t meant to be used for = highlighting anyway. This is just something some major mode provides because it=E2=80=99= s a nice bonus, and it=E2=80=99s effectiveness probably varies by language = grammar. The user can turn off error feature with treesit-font-lock-recompute-features, like they do for any other features. Do we want to add a user option in addition? In any case, even if we add such user option, it should be added at the major mode level, since the error feature is at major mode level, it isn=E2=80=99t = something provided uniformly across all tree-sitter modes. >> Also, allowing users to rearrange features at different levels seems = like a bonus. > > Not sure about this one. We didn't have that in the traditional > font-lock, did we? If major modes define a xxx-mode-feature-list, sure, the user can redefine that list to their liking. Again that=E2=80=99s a major mode = level decision. I CC=E2=80=99ed Randy since he=E2=80=99s the maintainer of go-ts-mode. Yuan