unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Randy Taylor <dev@rjt.dev>
To: Juri Linkov <juri@linkov.net>
Cc: casouri@gmail.com, 60105@debbugs.gnu.org
Subject: bug#60105: [PATCH] Add yaml-ts-mode
Date: Mon, 02 Jan 2023 21:58:57 +0000	[thread overview]
Message-ID: <d4IAgpQk83SggvF-bQ7aBeyaM3Qoww_2iRN_mBibADY6tOP1_lVNO7YwLyZalksjUlVJr_hSUq_SvQOvkU1HSNkuhzUeqcOizr9PNSV84A4=@rjt.dev> (raw)
In-Reply-To: <864jt8vjyc.fsf@mail.linkov.net>

On Monday, January 2nd, 2023 at 13:52, Juri Linkov <juri@linkov.net> wrote:
> 
> > + :language 'yaml
> 
> > + :feature 'string
> > + :override t
> > + '([(block_scalar)
> > + (double_quote_scalar)
> > + (single_quote_scalar)
> > + (string_scalar)] @font-lock-string-face)
> 
> 
> 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:
> 
> (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)))
> 
> 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 which 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 should 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?





  reply	other threads:[~2023-01-02 21:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15 22:19 bug#60105: [PATCH] Add yaml-ts-mode Randy Taylor
2022-12-16  0:20 ` Stefan Kangas
2022-12-16  2:01   ` Randy Taylor
2022-12-16 22:55 ` Yuan Fu
2023-01-02 18:52 ` Juri Linkov
2023-01-02 21:58   ` Randy Taylor [this message]
2023-01-03 18:21     ` Juri Linkov
2023-01-04 23:30       ` Dmitry Gutov
2023-01-05 18:09         ` Juri Linkov
2023-01-06  1:55           ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='d4IAgpQk83SggvF-bQ7aBeyaM3Qoww_2iRN_mBibADY6tOP1_lVNO7YwLyZalksjUlVJr_hSUq_SvQOvkU1HSNkuhzUeqcOizr9PNSV84A4=@rjt.dev' \
    --to=dev@rjt.dev \
    --cc=60105@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=juri@linkov.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).