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

Customize highlighted delimiters (in Org files) #53

Closed
scolobb opened this issue Aug 31, 2020 · 5 comments
Closed

Customize highlighted delimiters (in Org files) #53

scolobb opened this issue Aug 31, 2020 · 5 comments

Comments

@scolobb
Copy link

scolobb commented Aug 31, 2020

After an Emacs update, I realized that rainbow-delimiters started to highlight < and >. When I am writing math, this is rather inconvenient, because something like k > 1 highlights the > and all the following delimiters as mismatched.

Is there a way to customize which delimiters are highlighted?

@scolobb
Copy link
Author

scolobb commented Aug 31, 2020

I have just realized that this behavior seems to be specific to Org files. The characters < and > are not highlighted in text mode, Lisp interaction mode, Racket mode, etc.
2020-08-31_23-40

@scolobb scolobb changed the title Customize highlighted delimiters Customize highlighted delimiters (in Org files) Aug 31, 2020
@Fanael
Copy link
Owner

Fanael commented Sep 1, 2020

rainbow-delimiters relies solely on the syntax table information provided by the major mode. If org-mode incorrectly sets < and > as a bracket pair even when they're not, it's a bug in org-mode and should be fixed there, especially since it has the potential to break any code that uses syntax information directly or indirectly (e.g. through syntax-ppss).

There is an ancient, moribund branch, see #1, that lets you control what delimiters are considered by rainbow-delimiters, but it hasn't been updated for the past six years, and it's incomplete enough that it's highly unlikely it will ever land unless someone puts in the (serious!) effort require to make it fully functional.

@scolobb
Copy link
Author

scolobb commented Sep 1, 2020

Thank you @Fanael for the quick and detailed answer. I'll contact the maintainers of Org-mode.

One last question: when you say "Org-mode sets < and > as a bracket pair", do you mean that there is some variable which lists the bracket pairs? From the rest of your answer I understand that this is not so simple, but I would like to have a confirmation of my hypothesis.

@Fanael
Copy link
Owner

Fanael commented Sep 1, 2020

It's controlled by syntax tables and syntax properties: https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Tables.html

@scolobb
Copy link
Author

scolobb commented Sep 1, 2020

Thank you @Fanael ! This part of the manual is what I needed, but didn't have the keywords.

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

2 participants