From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Randy Taylor Newsgroups: gmane.emacs.bugs Subject: bug#60105: [PATCH] Add yaml-ts-mode Date: Mon, 02 Jan 2023 21:58:57 +0000 Message-ID: References: <864jt8vjyc.fsf@mail.linkov.net> Mime-Version: 1.0 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="16475"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, 60105@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 02 23:00:26 2023 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 1pCSr3-00048D-9R for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 02 Jan 2023 23:00:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCSqh-0007r7-Oo; Mon, 02 Jan 2023 17:00:03 -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 1pCSqh-0007qt-0n for bug-gnu-emacs@gnu.org; Mon, 02 Jan 2023 17:00:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pCSqg-0000L2-Ln for bug-gnu-emacs@gnu.org; Mon, 02 Jan 2023 17:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pCSqg-0005Gp-5F for bug-gnu-emacs@gnu.org; Mon, 02 Jan 2023 17:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Randy Taylor Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Jan 2023 22:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60105 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 60105-submit@debbugs.gnu.org id=B60105.167269675720168 (code B ref 60105); Mon, 02 Jan 2023 22:00:02 +0000 Original-Received: (at 60105) by debbugs.gnu.org; 2 Jan 2023 21:59:17 +0000 Original-Received: from localhost ([127.0.0.1]:44245 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCSpx-0005FE-EN for submit@debbugs.gnu.org; Mon, 02 Jan 2023 16:59:17 -0500 Original-Received: from mail-4022.proton.ch ([185.70.40.22]:50907) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCSpr-0005Ew-BQ for 60105@debbugs.gnu.org; Mon, 02 Jan 2023 16:59:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rjt.dev; s=protonmail2; t=1672696744; x=1672955944; bh=qaU8fDZJmWGc+UFsAXVZN6CuxbaRla3mO/XjiG8w4XQ=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=TVNtOH/Vk5a9doTBTQvpdauNSrIG4o3SZAhS+5IUzhGz60yVqBa1nwgmvtImdmC42 lt5/pEIVUhH7lnGBn2k23NhDyBHRh6H9+t/hcL4mB9Mi3Y/YUqOVHhn0j0917Wurhb COiiEAtZLV5EMFmdUIrspQPRqYqMXMug83iKlYVnX3oY11kCdHJzT1js77devP12jC t8Qta5Jw/QOstA8GqyOwV5St8tJBDSAStYqWFHOwwTIZAPY+Jdlt5iZOPJnGxOC3wI mOulnN62xxIT047aPjwUbyCjFEGxNMmOfxXuOcbDZJG7ZDo5/zX2OnFUPClL6Yy6Sy gWgVprziF3rjQ== In-Reply-To: <864jt8vjyc.fsf@mail.linkov.net> Feedback-ID: 44397038:user:proton 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:252366 Archived-At: On Monday, January 2nd, 2023 at 13:52, Juri Linkov wrote: >=20 > > + :language 'yaml >=20 > > + :feature 'string > > + :override t > > + '([(block_scalar) > > + (double_quote_scalar) > > + (single_quote_scalar) > > + (string_scalar)] @font-lock-string-face) >=20 >=20 > Thanks, yaml-ts-mode works great. One problem is that > with the above setting everything is (over)fontified in the buffer. > This is the only mode I have seen where 100% of text has > non-default colors making it so called "angry fruit salad". > In this regard yaml-mode is not better: it fontifies only text in quotes > that makes an unnecessary distinction between quoted and unquoted text. > I know it's possible to configure this in a hackish way: >=20 > (with-eval-after-load 'yaml-ts-mode > (setq yaml-ts-mode--font-lock-settings > (seq-remove (lambda (e) (eq (nth 2 e) 'string)) > yaml-ts-mode--font-lock-settings))) >=20 > But what I propose is to add a customizable option to enable/disable > font-lock-string-face on most text to lessen the color burden on users. I think using treesit-font-lock-recompute-features is the way to adjust whi= ch features you want, and is what is expected for cases like this (but Yuan= would know best). Alternatively, treesit-font-lock-level dictates which level of features sho= uld be included for highlighting. The default is level 3, and string is on = level 2. We can move string to the 4th level, which may be an OK compromise= ?