joe-syntax icon indicating copy to clipboard operation
joe-syntax copied to clipboard

JOE 4.5 introduced color schemes

Open jjjordan opened this issue 6 years ago • 4 comments

...and somewhat broke old syntax files. Sorry.

In order to support a wide variety of languages with a wide variety of color schemes, syntax files had to be overhauled so that classes could be made more consistent.

Here's an overview of how color schemes and syntaxes interact, and here's a list of the common classes used by both the schemes and the syntax files.

All is not lost, however. Version 4.5 will allow syntax files to specify the 16 basic terminal colors, and map them into the scheme if the scheme supports it. It will not respect any of the extended xterm-256 colors. This was done for backwards compatibility. However, forwards compatibility is impossible; 4.4 and below will fail to read a newer syntax file.

Since we merged many of your syntaxes a few years back, I can provide backports for those changes in the form of a PR. I am also willing to help with upgrading any newer ones. But I thought first I'd open the issue to see what you'd like to do about the issue, especially given the forwards-compatibility problem.

Cheers~

jjjordan avatar Oct 03 '17 09:10 jjjordan

Wow, this is a nice change and totally worth breaking the old syntax files. It's nice to see JOE development continuing at such a pace in the past years - thank you for the heads up! I was planning anyways to split up the contents of this repository into several branches for different (historic) JOE versions.

So the current state of the master branch would go to e.g. baseline-3.8 branch while a new baseline-4.5 branch will be stripped of any syntax files merged upstream to avoid redundancy. This way I think I can solve the forwards compatibility problem while also removing the need to backport the color scheme changes to most of the upstreamed syntax files. People that use multiple or older versions of JOE (like me) can then choose the right branch to depend on.

I'll then look into how to update the handful of newer syntax files after separating them from the old...

@jjjordan regarding the backwards compatibility - did I understand you right in that all syntax files using only 16 basic terminal colors that worked in JOE 4.4 will also work in version 4.5?

cmur2 avatar Oct 03 '17 20:10 cmur2

What I meant wrt backwards compatibility is that all the builtin schemes define term colors, e.g. from zenburn:

-term 0 $3F3F3F
-term 1 $E37170
-term 2 $9CCC9C
-term 3 $EFEF8F
-term 4 $000D18
# ...

The intent here is that pop-up terminals will map black to #3F3F3F, red to #E37170, green to #9CCC9C and so on so that they do not look out of place in the scheme. This also applies to syntax files, so if you have:

=SomeClass green
=Comment green

If JOE can't find SomeClass defined by the scheme, it will fall back to the terminal color mapping for green, above. However, Comment will probably be found defined by the scheme, and will get the correct color. On the other hand, JOE 4.4 has no idea what this means:

=String +Constant

And won't color anything correctly.

jjjordan avatar Oct 03 '17 21:10 jjjordan

This is why I dumped joe - every release post 3.8 something seems changed/breaks. Too bad, it was a good editor up until 3.8. I've tried this latest incantation, but after 20 minutes trying to work out how the colors work, I abandoned ship (I use a black background and #defines etc are unreadable with the default settings). I think the irony of creating an editor and then not using it to create documentation is lost on you people. At the very least this could have been pointed out in the joerc files...

ghost avatar Jun 18 '18 13:06 ghost

#defines were always unreadable with default settings -- that was sort of the point of this change. As for the manual, there's a section on how they work but to be fair it's rather low-level.

jjjordan avatar Jun 18 '18 21:06 jjjordan