istib / rainbow-blocks

block syntax highlighting in emacs
GNU General Public License v3.0
124 stars 6 forks source link

Merge with intervening faces instead of overriding #6

Open jonaskoelker opened 8 years ago

jonaskoelker commented 8 years ago

Currently, If I do (def one 1), The def part isn't syntax-highlighted as per my major mode (say, clojure-mode). It would be nice if rainbow-blocks would only set those properties I have explicitly defined in the customized faces but not override/replace/whatever those from the major-mode.

The result I'm hoping for is this: have the foreground color of my text be decided by the token type (builtin, string, comment, etc.) and the background be decided by the scope. Currently rainbow-blocks sets both foreground and background based on scope.

ahungry commented 6 years ago

This would be great, I too would enjoy if keyword faces were highlighted by the major mode and skipped by rainbow-blocks-mode (as if rainbow-blocks-mode painted first, then the major mode painted on top of that).

alphapapa commented 5 years ago

I wanted this feature myself, and I ended up making my own package: https://github.com/alphapapa/prism.el It doesn't override existing faces, but adds colors to them, so e.g. bold text remains bold, italic remains italic, etc. You can also use it to set background colors, but it isn't optimized for that case, so it doesn't look real pretty that way.

@istib Thanks for your work on rainbow-blocks, which inspired and helped me with prism!