Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expl3 syntax highlighting #79

Open
yoblanco opened this issue Mar 14, 2014 · 5 comments
Open

expl3 syntax highlighting #79

yoblanco opened this issue Mar 14, 2014 · 5 comments

Comments

@yoblanco
Copy link

When would this be available? Is it planned to be added soon?

@infininight
Copy link
Member

Looking at the Latex 3 page it appears that it is still in a very incomplete state, I don't suspect that anyone will put the time into adding support until it gets closer to a usable state. I'm not aware of how great the differences are between the two versions but if it is too great it may be better to fork a new version of the bundle for it.

Going to close this issue to keep things cleaner since it's not something we plan to tackle soon.

@yoblanco
Copy link
Author

After a few time, here I'm again. Sorry for the late response.

There's no difference rather than : and _ can be included in macro names, that is

  • \somemacroname is the usual,
  • between \makeatletter and \makeatother the letter @ is also part of macro names, like \some@macro@name,
  • with expl3, now between \ExplSyntaxOn and \ExplSyntaxOff there can be : and _ in macro names (not @ in this case), like in \cs_new_protected_nopar:Npn.

It would be nice to add that, so names with _ and : between \ExplSyntaxOn and \ExplSyntaxOff are highlighted as macros (I'm not sure if that scoping is possible).

In case it's done, since _ and : are only intended to separate different parts of the macro name, it would be nice to highlight them in a “lighter” way, so it doesn't draw attention to them.

Moreover, the part after the : is the “signature”, which is also less relevant, and could also be highlighted in a “less important” color.

A little more info here: http://tex.stackexchange.com/questions/129439/latex3-sensitive-editors
(It's particularly nice the WinEdt solution, but that's definitely some extra work, just adding : and _ to the accepted characters in macro names is enough.)

@sanssecours
Copy link
Member

Hi yoblanco,

I just reopened the issue. It might take some time until I have time to revisit this issue tough. I plan to fix the grammar related issue after after all the other problems are taken care of.

Kind regards,
René

@yoblanco
Copy link
Author

It would be better if it was possible that kind of scoping, so in “normal” text \sum_a is \sum with a subscript _a. And only inside \ExplSyntaxOn .. \ExplSyntaxOff that \l_tmpa_tl is recognised as what it is: a macro. If that scoping is not possible, well, it's not perfect, but I think enabling : and _ globally would be nice. In case the scoping is possible it would be good also to scope @ in macro names only inside \makeatletter .. \makeatother.

EDIT: Yes, scoping is definitely possible: it's done with Lua code between \begin{luacode} and \end{luacode} (or, may be I'm mixing memories, it's from the ConTeXt bundle, in that case the Lua code is highlighted between \startlua and \stoplua). So it would be perfect to have, say, two “sublanguages”, LaTeX and expl3, so between \ExplSyntaxOn and \ExplSyntaxOff the highlighting rules are taken from expl3.

@yoblanco yoblanco changed the title LaTeX3 syntax expl3 syntax highlighting Jan 24, 2015
@stone-zeng
Copy link

Note that expl3 syntax has been added into LaTeX-workshop: LaTeX-Expl3.tmLanguage.json. Translate from json to plist is not difficult, so please consider to add it. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants