1 point

It’s very personal.

I like monochrome with very mild weight differences. I find all the colours distracting; from my perspective we don’t colour code regular prose, so why code?

permalink
report
reply
1 point

The problem is monochromacity. The font lock rules in a lot of the TS modes are… not always thought through. Ramp up python-ts-mode’s font lock level to the maximum and most of everything is dyed the same colour. It’s frustrating and I have had to muck around with treesit-font-lock-feature-list to selectively unpick the chaff from the grist. And it’s not exactly easy changing it either: if you’re new to elisp, or not fluent in the extremely awkward interface for changing this stuff, you’ll have to look up how someone else has done it.

It’s not even customizable, so you can’t just click around and change it either.

permalink
report
reply
1 point

The font lock rules in a lot of the TS modes are… not always thought through. Ramp up python-ts-mode’s font lock level to the maximum and most of everything is dyed the same colour.

And then on the other side, people come asking why even when TS is used, highlighting is not “up to par” with VS Code and etc. Then hear about treesit-font-lock-level, ramp it up to the max, and apparently live happily after.

permalink
report
parent
reply
1 point

That’s a misinterpretation of my argument. I said monochromacity: that at the highest level, many disparate node types are font locked with the same face. Try it in Python. Everything is the same shade of whatever your variable name face is.

permalink
report
parent
reply
1 point

So your complaint is about the non-default behavior? The level 3 was chosen as default explicitly to avoid the abundance of color where it’s not really needed.

I said monochromacity: that at the highest level, many disparate node types are font locked with the same face. Try it in Python. Everything is the same shade of whatever your variable name face is.

I don’t see that “everything is the same shade”, even with level 4. There are problems - like the variable matches in particular (which is not useful IMO, but should at least use a different face). The rest use different faces, but since most of those faces are new, it’s up to the theme authors to differentiate them.

Here’s a patch fixing the one problem I found (try it), and below is a screenshot with this patch applied along with the new faces customized to be distinct.

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index d3cb5a77e22..9f9344e0eb4 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1235,7 +1235,7 @@ python--treesit-fontify-variable
   (when (python--treesit-variable-p node)
     (treesit-fontify-with-override
      (treesit-node-start node) (treesit-node-end node)
-     'font-lock-variable-name-face override start end)))
+     'font-lock-variable-use-face override start end)))
 
 
 ;;; Indentation

https://imgur.com/a/iifAmcd

permalink
report
parent
reply
1 point

It’s a good opinion. However, colors work magic for reading code for me, so I guess it depends on the person.

permalink
report
reply
1 point

When you say “however, colors work magic for reading code for me”, do you mean having most text in the same color, say purple, or do you mean having a variety of colors? Because the article specifically complains that “everything is purple” in elixir-ts-mode instead of having a wider variety of color.

permalink
report
parent
reply
1 point

It definitely does. While I like some color (monochrome themes aren’t my bag), a lot of themes are too much for me and distract me more than they help me. I’m definitely on the “less is more” end of the spectrum.

permalink
report
parent
reply
1 point

I think this is a problem for theme makers. Having the option to colorize more tokens is great, but I’m sure we’ll get themes that approach colorizing with more restraint too.

permalink
report
reply
1 point

Emacs

!emacs@communick.news

Create post

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

  • Windows
  • Mac OS X
  • GNU/Linux and BSD (Just get it from your distribution’s package manager)

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for “emacs” and “vi” link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

Community stats

  • 18

    Monthly active users

  • 562

    Posts

  • 2.4K

    Comments