zk-phi / highlight-stages

Highlight staged (quasi-quoted) expressions
21 stars 7 forks source link

Provide a face for highlighting #1

Closed Wilfred closed 9 years ago

Wilfred commented 9 years ago

Currently, I can only override highlight-stages-lighten-step to affect how light/dark the background is. If highlight-stages used a customisable face instead, I could do underlining, change the text colour, or use any colour I liked.

zk-phi commented 9 years ago

I'm in two minds whether defining faces is better or not since quasiquotes(`) can be nested

`(foo `(bar ,,(baz)))

and thus we need to define many faces to differentiate them. like:

Wilfred commented 9 years ago

rainbow-delimeters has the same problem, and it solves it by defining 9 levels of faces and looping after that https://github.com/jlr/rainbow-delimiters/blob/29e7bfd8e4445725145f40a820f1aa1c91635f13/rainbow-delimiters.el#L177 .

I would think a similar approach would work for highlight-stages. You could use face inheritance so users only need to customise highlight-stages-face-1, and I imagine it's very unlikely to see more than five levels of quasiquote nesting anyway.

zk-phi commented 9 years ago

Thanks. implemented.