racket-mode icon indicating copy to clipboard operation
racket-mode copied to clipboard

Regexp-based highlighting of lines

Open soegaard opened this issue 11 months ago • 0 comments

Hi,

I am using racket-mode to edit text written in a Scribble-inspired format.

It looks something like this:

@chapter{Vektorer i planen}
@table-of-contents[2]{}

@section{Vektor}
@index{vektor}@index{forskydning}@index{hastighed}@index{fart}@index{knob}@index{pil}
@index{vektor, definition}@index{repræsentant}@index{skalar}@index{nulvektor}

I dette kapitel skal vi se på vektorer. Vektorer bruges til at beskrive
objekter, der har en længde og en retning. Begrebsmæssigt er en 
vektor er karakteriseret ved en @it{længde} og en @it{retning}. 

When the document is large, it helps to have chapters, sections and subsections stand out.

I have discovered that highlight-regexp can be used to highlight lines that matches a regexp. It looks something like:

image

But ... this removes the highlighting from racket-mode.

So the question whether it is possible to have an racket-mode-highlight-regexp that sets the background color of a line, if it matches a regexp - and otherwise keep the normal highlighting computed by racket-mode.

soegaard avatar Feb 28 '24 16:02 soegaard